PDA

View Full Version : Set value to QComboBox



Archa4
19th May 2011, 12:00
Hi, it's me again.
To complete my app I need to learn, how to set a value to the QComboBox. Is that eve possible? Fact is - my QComboBox has 6 values. How can I set one of them to be the active one, when all I know is the QString of the value?

stampede
19th May 2011, 12:15
You can find item's index with int QComboBox::findText() method, and pass this index to void setCurrentIndex ( int index ), it's all in the docs.

Archa4
19th May 2011, 12:46
Thanks for fast answer, i was trying to find something like that but failed...