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

ComboBox currentText is empty when using a JSON model

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.4.2, 6.5.0 Beta2
    • Quick: Controls 2
    • None

    Description

      When using a ComboBox whith the model being a QVariantList each variant being a QJsonObject , setting textRole does not work properly.

      Items in the drop down menu are correctly displaying the text, but the "current text" of the combo box is empty.

      Properties currentText and displaytext are empty.

      It was working fine with Qt 6.3 (see screenshots).

      I have attached a minimal example that reproduce the behavior.

      Attachments

        1. qt6.3.png
          qt6.3.png
          2 kB
        2. qt6.4.png
          qt6.4.png
          2 kB
        3. test_comboxboxrole.zip
          2 kB

        Issue Links

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              bterrier Benjamin Terrier
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: