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

QMenuBar doesn't open neighbouring menus on mouseover

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.5.3, 6.6.0 Beta3, 6.7.0 FF
    • 6.5.1, 6.5.2, 6.6.0
    • GUI: Menus
    • None
    • Ubuntu 22.04, Gnome 42.9, wayland
    • Linux/Wayland
    • 1da23c86d (dev), 964764e31 (6.5), 2d724b40d (6.6)

    Description

      The following program adds a menu bar to a window. The menu bar has two menus and each menu has several items.

      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QMainWindow mainWindow;
          
          // add a menu bar with two menus
          QMenuBar* menuBar = new QMenuBar(&mainWindow);
          
          QMenu* menuA = new QMenu("AAAAAAA", menuBar);
          menuA->addMenu("a1");
          menuA->addMenu("a2");
          menuA->addMenu("a3");
          menuA->addMenu("a4");
          menuA->addMenu("a5");
          QMenu* menuB = new QMenu("BBBBBBB", menuBar);
          menuB->addMenu("b1");
          menuB->addMenu("b2");
          menuB->addMenu("b3");
          menuB->addMenu("b4");
          menuB->addMenu("b5");
          
          menuBar->addMenu(menuA);
          menuBar->addMenu(menuB);
          
          mainWindow.setMenuBar(menuBar);
          mainWindow.show();
          
          return a.exec();
      }

      When the program is built and run with Qt 6.5.0 the menu bar behaves as expected. Clicking a menu title will pop up a menu. While one menu is popped up placing the cursor over another menu title will pop up another menu.

      As of Qt 6.5.1 the behaviour has changed. Mousing over another menu title will cause all menus to be dismissed. This happens with versions 6.5.1, 6.5.2, and 6.6.0.

      This only happens using the wayland platform. xcb is unaffected.

      Attachments

        For Gerrit Dashboard: QTBUG-116051
        # Subject Branch Project Status CR V

        Activity

          People

            zzag Vlad Zahorodnii
            jabernathy Jason Abernathy
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes