qt - How to enable a down arrow on QPushButton? -
By using (with you) method will add a menu and then draw down arrow button style settings).
Is it possible to enable the drawing of the same arrow by any other method? When I click, I would like to use this style button to show a custom popup widget.
You You can add it to appear in a pop-up menu to your widget toolButton are: Your custom widget can be a list of different elements or it may be other widget you can add multiple instances of QToolButton instead of
QPushButton Use Can and add actions on QToolButton. # include & lt; QWidgetAction & gt; Category myCustomWidgetAction: Public QWidgetAction {Q_OBJECT Public: Clear myCustomWidgetAction (QWidget * parent); Protected: QWidget * createWidget (QWidget * parent); }; myCustomWidgetAction :: myCustomWidgetAction (QWidget * parent): QWidgetAction (parent) {} QWidget * myCustomWidgetAction :: createWidget (QWidget * parent) {myCustomWidget * widget = new myCustomWidget (parent); Return widget; }
myCustomWidgetAction * widgetAction = new myCustomWidgetAction (this ); UI- & gt; ToolButton- & gt; AddAction (widgetAction);
myCustomWidgetAction toolButton.
Comments
Post a Comment