Details
-
Suggestion
-
Resolution: Out of scope
-
P2: Important
-
4.3.3
-
None
Description
When a QAction is given a menu via setMenu() and this action is added to a QToolBar, the respective QToolButton gets the menu set on it and when the user clicks on it, the menu is shown. Unfortunately the method setPopupMode() only exists for QToolButton, not for QAction. When adding an action that has a menu to a toolbar, and wanting the menu to
appear via an extension button, it is necessary to do something like
(QToolButton *) (drawToolBar->widgetForAction(actionPart_Contour)))->setPopupMode(QToolButton::MenuButtonPopup);
which is error-prone and looks clumsy.
It would be useful to have setPopupMode() for an action, too or have a method
QToolButton::ToolButtonPopupMode QAction::popupModeHint();
This method's return value could be used for the default behavior of theQToolButton, but could be overwritten by
QToolButton::setPopupMode();