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

Pane/Page with Layout steals all events of parent MouseArea

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.10.1, 5.11.2
    • Quick: Controls 2
    • None
    • All

    Description

      See example.

      This bug comes in various forms, but in short if you have a hierarchy like: [MouseArea]>[Pane/Page]>[RowLayout/ColumnLayout/StackLayout]>[Item] (with width, height or preferredWidth/preferredHeight), the root MouseArea will not receive any events as soon as you hover the child. If additionally the Layout of the MouseArea is anchored/ has a specified size, the MouseArea doesn't get any events at all.

      import QtQuick 2.6
      import QtQuick.Window 2.2
      import QtQuick.Controls 2.1
      import QtQuick.Layouts 1.3
      
      Window {
          id: window
          visible: true
          width: 640
          height: 480
          MouseArea {
              id: area
              anchors.fill: parent
              hoverEnabled: true
              preventStealing: true
              propagateComposedEvents: false
              property color positionColor: Qt.hsla(mouseX / width, 1, mouseY / height, 1);
              onPositionChanged: console.log(new Date().getTime())
              onClicked: console.log("CLICK")
              Pane {
                  //anchors.fill: parent //this will completely break it
                  leftPadding: 0
                  rightPadding: 0
                  topPadding: 0
                  bottomPadding: 0
                  RowLayout {
                      anchors.fill: parent
                      Rectangle {
                          color: area.positionColor
                          Layout.preferredWidth: window.width / 2
                          Layout.preferredHeight: window.height
                      }
                  }
              }
          }
      }
      

       

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            mr.greywater mr.greywater
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes