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
A dropdown button lets the user select from a number of items. The button shows the currently selected item as well as an arrow that opens a menu for selecting another item.
Build A Paint Program With TKinter and Python First, we will instantiate an object of StringVar(), then we will set the initial value of the dropdown menu. We will create the dropdown menu by creating an object of OptionMenu and passing the value of window, menu object, and options which are to be displayed.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With