Important: Please read the Qt Code of Conduct -

How to display ComboBox item based on value?

  • Hi,

    I'm try to display one of pre-existing values of a combobox.


    Basically, if member->getGender() returns male or female, I want that to display. The combobox was created using qt designer.

    When I run the code above, a blank item is displayed in the combobox. If I click the drop down arrow, it displays male and female.

  • How about QComboBox::setCurrentText(const QString& text)?


Log in to reply