hi,
I query a database, if the current record has gender male, i want set the combobox item to "male". If the current record is gender female I want to set the combobox item to "female".
To find the text in the combo, use findText(); this will return the index of the searched string;
Then set the currentindex using setCurrentIndex() with the searched index.
myCombo->setCurrentIndex(myCombo->findText(rs.value(0).toString()))
myCombo->setCurrentIndex(myCombo->findText(rs.value(0).toString()))
To copy to clipboard, switch view to plain text mode
This comobobox automatically shows the first record by default. How do i change it so that the combox is blank to begin with
simply put -1 in setCurrentIndex();
myCombo->setCurrentIndex(-1);
myCombo->setCurrentIndex(-1);
To copy to clipboard, switch view to plain text mode
How do I achieve this? I'm sure it's pretty simple, I just can't seem to get it to work.
Just gothrough all the Qtexamples in your free time. we cant get quality results without knowing much about it ![Smile](images/smilies/smile.png)
hope it helps
Bala
Bookmarks