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

QMenu crash if app loses focus immediately after selecting sub-menu item

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.2.10, 6.5.3, 6.6.0 Beta3, 6.7.0 FF
    • 6.3.1, 6.5.2
    • GUI: Menus
    • None
    • Qt 6.5.2 and 6.3.1
      Qt Creator 11.0.0
      macOS 12.6.4
    • macOS
    • e66cbdf68 (dev), 3ef96cc18 (6.6), 09d561b07 (6.5), af43fa46d (tqtc/lts-6.2)

    Description

      There's a crash on macOS if the app loses focus immediately after a QMenu sub-menu item is selected. The QMenu has Qt::WA_DeleteOnClose set and is displayed using QMenu::Popup().

      1. Build and run the attached sample project. (20230731-1001.zip.)
      2. Click the Show menu button to show a context menu.
      3. Position the mouse cursor over a window from another app.
      4. Use the keyboard arrow keys to navigate to the Fruit > Apple sub-menu item.
      5. Press the space key (to select the menu item) and immediately click the left mouse button (to switch focus to the other app).
      6. The sample app crashes.

      I've tested Qt 6.3.1 and 6.5.2 and the same happens in both.

      Possibly related: QTBUG-82349.

      Attachments

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

        Activity

          People

            axelspoerl Axel Spoerl
            lidl Damian Lettie
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: