Qt: Drop-down button?

nonot1 picture nonot1 · Apr 17, 2011 · Viewed 31.1k times · Source

How can I create a "drop down button" in Qt?

For a non-Qt example, see: Combination button/dropdown in office

The key point is that the widget needs an icon for the primary action, and a visually separate "pulldown arrow" to show secondary icons / actions.

Upon clicking the "pulldown arrow" for secondary options, the user should be presented with a grid of other icons to choose from. (All icons, no text.)

Does Qt have a widget that can do this?

If not, how can this be created in Qt? (I'm a new Qt user, so a Qt Designer based solution would be ideal.)

Thank you

Answer

chrisparker2000 picture chrisparker2000 · Sep 5, 2012

Actually, a QToolButton does this quite well.

http://qt-project.org/forums/viewthread/5377

It appears the OP asked this in a Qt forum and got a better answer. Adding it here for completeness.