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

Displayed text in ComboBox cannot be translated

XMLWordPrintable

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

      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
      

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes