PDA

View Full Version : QCombobox - interaction between edit text and list items



John_P
15th January 2009, 09:55
Hi,

I'm trying to understand the interation between the text in the edit control and the list items in a QCombobox - version 4.4.3.

Take an empty combo and call setEditText( "peach") the state is
count() = 0
currentIndex() = -1
currentText() = peach

Now add items "apple", "orange" & "pear"
count() = 3
currentIndex() = 0
currentText() = apple
The current text has been wiped and replaced by the 1st item in the list.

Now set the edit text again setEditText( "peach")
count() = 3
currentIndex() = 0
currentText() = peach
The current index and text are now mismatched because "peach" is not in the list.

When the edit text is not empty, I would have expected the addItems() only to change the count. Does the api require a call to setCurrentIndex(-1) for every setEditText() call?

Thanks for any help.

John.

jpn
15th January 2009, 10:34
I would submit that as a bug to the task-tracker.