Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-82020

Displayed text in ComboBox cannot be translated

    XMLWordPrintable

Details

    • Windows
    • 814682bb9a5c9ccaff30662dd757cd827f39aad0 (qt/qtquickcontrols2/5.15)

    Description

      QQmlApplicationEngine::retranslate does not work for display text in ComboBox.

      How to reproduce:
      1. Run the sample code (QTBUG8202_sample.zip)
      2. Press "j" to translate to Japanese, Press "e" to translate to English.

      The elements of ComboBox are translated but not the display text.

      Workaround?
      Adding the following to ComboBox solves the problem

      displayText: qsTr(currentText)
      

      or

      displayText: listViewModel.get(currentIndex).label
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              andysh Andy Shaw
              nagrohn Nahomi Gröhn (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes