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

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.14.1
    • Fix Version/s: 5.15.1
    • Component/s: Quick: Controls 2
    • Labels:
      None
    • Platform/s:
      Windows
    • Commits:
      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

        For Gerrit Dashboard: QTBUG-83554
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            mitch_curtis Mitch Curtis
            Reporter:
            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