Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-1453

setPopupMode: make is available for QAction

XMLWordPrintable

      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();

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            bjnilsen Bjørn Erik Nilsen
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes