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

Menu with Window popupType propagates mouse events

    XMLWordPrintable

Details

    • Windows

    Description

      Selecting (by clicking) an Action from a Menu propagates the mouse event to the underlying MouseArea when popupType is Window. If the popupType is Item the event is not propagated. Propagating the events causes issues with the underlaying MouseArea.

      The following code snippet can be used to reproduce the issue:

      import QtQuick
      import QtQuick.Controls
      
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Test Menu")  
        
          MouseArea {
              anchors.fill: parent
              onClicked: console.log("Mouse click:", mouseX, mouseY)
          }
      
          MenuBar {
              id: menuBar
              Menu {
                  id: fileMenu
                  title: "&File"
                  popupType: Popup.Window
                  Action {
                      text: "New"
                      shortcut: StandardKey.New
                      onTriggered: console.log("New Action")
                  }
              }
          }
      } 

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            tiheikka Titta Heikkala
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change