How to set the current index in QCombo box
Unsolved
General and Desktop
-
this is the code i am using for QComboBox
QComboBox *comboboxAlignment = new QComboBox; comboboxAlignment->addItem("Left"); comboboxAlignment->addItem("Center"); comboboxAlignment->addItem("Right");
like we can set the index of combo box using a int value comboboxAlignment->setCurrentIndex(0)
can i do it by passing the string value for example if is pass "Right" than the item in the combo box having "Right" as text should become current item.