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

QMenu location is wrong

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.0
    • GUI: Menus
    • None
    • wyland
    • Linux/Wayland

    Description

          When window A is covered by window B, right-click on window A, the position of QMenu is displayed incorrectly, as shown in the video

       

       

      //代码占位符
      #include <QMenu>
      
      Widget::Widget(QWidget *parent)
          : QWidget(parent)
      {
      
      }
      
      Widget::~Widget()
      {
      
      }
      void Widget::contextMenuEvent(QContextMenuEvent *event)
      {
          QMenu *pmenu = new QMenu();
          pmenu->addAction("menu action 1");
          pmenu->addAction("menu action 2");
          pmenu->addAction("menu action 3");
          pmenu->exec(QCursor::pos());
      }
      
      

      Attachments

        1. 97e02030ff3095a767313e2bcd2fa0a0.jpg
          289 kB
          haixiang tang
        2. c9680a1d7a418a904b90099d081cd1a6.jpg
          502 kB
          haixiang tang
        3. VID_20200628_145428_cps.mp4
          3.52 MB
          haixiang tang
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            tanghaixiang haixiang tang
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes