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

Button menu pops up at wrong position on a QGraphicsProxyWidget

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 6.2.0, 6.2.1
    • Fix Version/s: None
    • Component/s: Widgets: GraphicsView
    • Labels:
      None
    • Platform/s:
      Linux/X11, Windows

      Description

      This is a regression between 5.15.2 and 6.2

      Menu on a QToolButton widget in a QGraphicsScene pops up at wrong position

      Samplce code to reproduce the issue:

      #include <QApplication>
      #include <QGraphicsView>
      #include <QToolButton>
      #include <QMenu>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          QGraphicsScene scene;
          auto *button = new QToolButton();
          button->setText("B");
          auto *menu = new QMenu();
          menu->addAction("Action1");
          menu->addAction("Action2");
          button->setMenu(menu);
          button->setPopupMode(QToolButton::InstantPopup);
          scene.addWidget(button);
      
          QGraphicsView view(&scene);
          view.show();
          return a.exec();
      }
      

      Run application and press on a button:

      Works ok in Qt 5.15.2:

        Attachments

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

          Activity

            People

            Assignee:
            bibr Andreas Aardal Hanssen
            Reporter:
            volodymyr_zibarov Volodymr Zibarov
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes