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

When MouseArea goes from one window to another, its containsMouse property is not updated

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12.2, 5.12.3, 5.12.4, 5.13, 6.4.0 RC1
    • None
    • macOS, Windows

    Description

      I have an Item (I) that contains a MouseArea (MA) as a title bar. When I move I from its initial window to another window while the mouse is hovering over MA, the containsMouse property of MA is not updated.

       

      Here's a minimal example:

      import QtQuick 2.12
      import QtQuick.Controls 2.12
      import QtQuick.Window 2.12Window {
          id: root
          width: 480
          height: 640
          visible: true    Rectangle {
              id: rect
              width: 480
              height: 100
              color: ma.containsMouse ? "green" : "red"        MouseArea {
                  id: ma
                  anchors.fill: parent
                  hoverEnabled: true
                  onClicked: {
                      rect.parent = window2.contentItem
                  }
              }
          }    Window {
              id: window2
              x: root.x + root.width
              y: root.y
              width: 300
              height: 300
              visible: true
          }
      }

       

      Once you click on the rectangle, you'll notice that the rectangle is still green even if the mouse is not hovering over it.

      Attachments

        1. test.qml
          0.6 kB
        2. pushpull.qml
          1 kB
        For Gerrit Dashboard: QTBUG-78014
        # Subject Branch Project Status CR V

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            furkanzmc Furkan Üzümcü
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change