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

Set the PopupMode option for QAction without needing to know about the underlying widget.

XMLWordPrintable

      Being able to set the PopupMode option for QAction without needing to know about the underlying widget.

      The code below demonstrates how the PopupMode is currently set:

      #include <QApplication>
      #include <QMenu>
      #include <QToolButton>
      #include <QToolBar>
      int main(int argc, char *argv[])

      {     QApplication a(argc, argv);     QToolBar bar;     auto action = bar.addAction("Action");     QMenu* menu = new QMenu;     menu->addAction("Subaction");     action->setMenu(menu);     bar.show();     QWidget * widget = bar.widgetForAction ( action );     QToolButton* button = qobject_cast<QToolButton*>(widget);     button->setPopupMode(QToolButton::InstantPopup) ;     return a.exec();   }

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            mahdi.belila Mehdi Belila
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes