开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜