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

currentValue not updated after model change in ComboBox if currentIndex does not change

    XMLWordPrintable

Details

    • Windows
    • 3adeceaa1cfe5fae55ca6bd75226c52363a7e7d3 (qt/qtquickcontrols2/dev) bf9397c535971ec38668200ab465ebf20fa55ccf (qt/qtquickcontrols2/5.15)

    Description

      When the model of a ComboBox is changed, in the setModel function (line 896 in qquickcombobox.cpp) the currentIndex is set to 0 if there are elements in the model and the currentText is updated (lines 919 & 920).

      The currentText is correctly updated, it uses currentIndex to retrieve the text from the model.

      But the update of the currentValue is done in setCurrentIndex, which is never done if the currentIndex does not change (return at line 579).

      So in the end we have the correct model, the correct text and the correct index but a wrong currentValue.

      I guess that what's done to update the currentText in setModel() should be also done for the currentValue.

      Attachments

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

        Activity

          People

            mitch_curtis Mitch Curtis
            thomas12345 Thomas Lenoir
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes