QComboBox - setCurrentText???
-
-
please correct me if I got confused here.
If "abc" isn't found the index returned by "findText" is -1 in which case, the setCurrentIndex will not work. Your code only works if "abc" already exists somewhere within the dropdown items, setting item "0" (the currently shown) to it.
My intention was to programmatically simulate a situation where a user clicks on the edit-box portion of the drop down, and types something, regardless of whether it exists in the dropdown items, which brings me to this question: will a user-typing actually change the "item 0" in real time?
-
Maybe "QComboBox::setItemText() ":http://doc.qt.nokia.com/4.7/qcombobox.html#setItemText in pair with currentIndex () fits your need too.