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

Context submenu with arrow navigation doesnt navigate to child item

    XMLWordPrintable

Details

    • macOS

    Description

      Happens only on Mac with QT 4.8, works ok on Qt5
      Use this following code ,

      #include <QtGui>
      #include <QApplication>
      #include <QMenu>
      #include <QContextMenuEvent>
      
      class Foo : public QWidget
      {
      public:
          Foo() : QWidget(0) {resize(200,200);}
      
          void contextMenuEvent(QContextMenuEvent* event)
          {
              QMenu menu("Menu");
              QMenu* subMenu = new QMenu("Parent", &menu);
              menu.addMenu(subMenu);
              subMenu->addAction("Child Item");
      
              menu.exec(event->globalPos());
          }
      
      };
      
      int main(int argc, char* argv[])
      {
          QApplication app(argc, argv);
          Foo foo;
          foo.show();
          return app.exec();
      }
      

      steps to reproduce,
      1. right click to launch context menu
      2. down arrow to select parent item, right arrow to select child item.
      3. left arrow to close child item.
      4. right arrow again to open child item

      The child item flickers but doesnt show up.

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            tapadar Indrajit Tapadar (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes