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

[Windows] Context menu mouse event is propagated further

XMLWordPrintable

    • Windows

      Triggering an event from the default/native context menu of TextArea on Windows 11 propagates the event to e.g. a MouseArea that’s under the menu.

      The issue is reproducible with 6.9.1 (and dev)

      The attached example reproduces the issue with the following steps:

      • Select all text in the TextArea
      • Do a right click on the TextArea
      • Select the Copy menu item

      Expected:

      The menu accepts the mouse event and it’s not propagated further

      Actual:

      The global mouse area receives the mouse press event

      import QtQuick
      import QtQuick.Controls
      
      ApplicationWindow {
          width: 800
          height: 500
          visible: true
      
          MouseArea {
              anchors.fill: parent
              acceptedButtons: Qt.LeftButton
      
              onPressed: (mouse)=> {
                  console.log(">> pressed detected")
              }
      
              Rectangle {
                  width: 200
                  height: 100
                  color: "lightblue"
      
                  TextArea {
                      anchors.centerIn: parent
                      text: "Hello, World!"
                      color: "black"
                  }
              }
          }
      }
      

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

            mitch_curtis Mitch Curtis
            tiheikka Titta Heikkala
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change