CuriousCase
CuriousCase

Reputation: 775

Qt:creating a dynamic button

I want to create an application in which i will create a button and by pressing that button as list of options will open and i can choose one of them.for example i will create a button named "searching algorithm" and by clicking this button a list will open at same place which display two options as linear search and binary search.can anyone give me an idea how to do that?

Upvotes: 0

Views: 914

Answers (2)

Caleb Huitt - cjhuitt
Caleb Huitt - cjhuitt

Reputation: 14941

You want a QComboBox:

The QComboBox widget is a combined button and popup list.

Upvotes: 1

serge_gubenko
serge_gubenko

Reputation: 20482

I believe what you need is a popup window where you can have list of options, whenever your button is clicked show this window, hide it when user selects an item in the list or clicks outside of the working area. There is an example you can use as a reference:

QT 4.7 Google Suggest Example

alt text

hope this helps, regards

Upvotes: 0

Related Questions