-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.5.0 RC
-
None
This bug originally had the following description, but its focus has changed upon further consideration. The summary is now accurate. See discussion in following comments.
I know this is the expected behavior, but I believe it's a bit odd/non intuitive.
The doc says:
http://doc.qt.io/qt-5/qcombobox.html#currentText-prop
"The setter setCurrentText() simply calls setEditText() if the combo box is editable."But if an item has the same text as one of the item values, this item doesn't get selected.
IMO it would be better to first check for a corresponding item in the list and, if there is one, select it. If there is none, simply ignore it if the combobox isn't editable or call setEditText otherwise (current behavior).I've attached an small reproduce to illustrate what I mean, but I will create a code review to make things clearer.
For reference, using git blame, it seems this new function was introduced with commit 84787d82ee9369b2a83c5b0568ee62ab602a5528.
For Gerrit Dashboard: QTBUG-46904 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
115390,1 | QTBUG-46904: Try to find a matching item when calling setCurrentText in an editable QCombobox | dev | qt/qtbase | Status: ABANDONED | -1 | 0 |