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

Translation not working in a model constructed with QVariantList

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.8.0, 6.8.1, 6.8.2, 6.8.3
    • Active Qt
    • None
    • Linux/Wayland, macOS, Windows

    Description

      All the translations are working well except for one particular case :

      When I fill a ComboBox with a QVariantList of QVariantMap, items are not translated.

      Il fill the model with QList<QVariantMap> and each QVariantMap is constructed with :

       

      map.insert("id", QVariant::fromValue(myObject));
      map.insert("name", toString(myObject));

      where myObject is an attribute from an enum class and toString(myObject) is a function that transforms the attribute into a readable string to be displayed in the ComboBox.

      For example, toString(Enums::Encryption::SRTP) returns QObject::tr("media_encryption_srtp")

      I can see "media_encryption_srtp" value in the translation files and the translations are actually filled but all I can see in my UI ComboBox is the value "media_encryption_srtp".

       

      Thank you for your help.

       

      Attachments

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

        Activity

          People

            owolff Oliver Wolff
            gaelle Gaelle Braud
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes