qt how to obtain a button that when you click it presents you a list of elements where you can select somethng?
I am new to Qt Creator. I want to add on my form a button that when you click it presents you a list of names for example (i'm talking about a dropd开发者_开发知识库own button i guess). i didn't find it in qt creator.
Thx!
It's called ComboBox
in Qt Creator, it's in the "Input Widgets" category.
Edit:
To select some specific text, you need to find the index of the text, then select that index:
int index = comboBox->findText(someText);
comboBox->setSelectedIndex(index);
精彩评论