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

QMenu pops up on wrong screen

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Fixed
    • Affects Version/s: 6.2.0
    • Fix Version/s: 6.2.5, 6.3.1, 6.4.0 Beta1
    • Component/s: QPA: Windows
    • Labels:
      None
    • Environment:
      2 screens, Primary - 1080p 17inch laptop. Secondary - 32 inch 1440p external monitor
    • Platform/s:
      Windows
    • Commits:
      58d4645661 (qt/qtbase/dev) daabed5107 (qt/qtbase/6.3) daabed5107 (qt/tqtc-qtbase/6.3) 43ab2d4966 (qt/tqtc-qtbase/6.2)

      Description

      QMenu always pops up on the primary screen, regardless of popup cordintates
      Attached is the code to reproduce, the code works fine with qt 5.15 but not with qt 6.2

       #include <QApplication>
       #include <QPushButton>
       #include <QMenu>
       #include <QAction>
      
      int main(int argc, char *argv[])
       {
       QApplication a(argc, argv);
       QWidget w;
      
      auto b = new QPushButton(&w);
       QObject::connect(b, &QPushButton::clicked, &w, [b](bool)
      
      { auto m = new QMenu(b); m->addAction("action 1"); m->popup(b->mapToGlobal(QPoint(0, b->height()))); }
      
      );
      
      w.show();
       return a.exec();
       }
      

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              anrocha André De La Rocha (Inactive)
              Reporter:
              jagannatharjun Prince Gupta
              Votes:
              2 Vote for this issue
              Watchers:
              15 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes