PDA

View Full Version : Value from QComboBox instead of Index



arunvv
17th May 2007, 22:21
How to read Values from QComboBox instead of Indexes . I am able to get Indexes for QComboBox using currentIndex() function. But I want to get value of currentIndex.

Ex: Index Value
0 10
1 11
2 12

If I select '0' I want 10 to be printed. With currentIndex() function I can print Indexes as '0', '1' etc only.

How can I get the values for that corresponding indexes?

Thanks
Arun

wysota
17th May 2007, 22:22
QComboBox::currentText()

jpn
17th May 2007, 22:24
QComboBox::currentText() (http://doc.trolltech.com/4.2/qcombobox.html#currentText-prop)
QComboBox::currentIndexChanged(const QString& text) (http://doc.trolltech.com/4.2/qcombobox.html#currentIndexChanged-2)


Edit: Wow, did it really take me two minutes to copy-paste the links? :)