Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.14.1
-
None
-
-
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.