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

MouseArea incorrectly reports containsMouse when visibility changes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.3.0
    • 5.2.0
    • None
    • Mac OSX 10.9
    • f58dff46f59555bbd6a6ae96bb1d1439f8c4feca

    Description

      This was reported against the SplitView in QTBUG-35898 but can easily be reproduced with the following example:

      import QtQuick 2.1
      import QtQuick.Window 2.0
      
      Window {
          id: root
          width: 640
          height: 480
          MouseArea {
              id: mouseArea
              anchors.fill: parent
              hoverEnabled: true
              visible: false
              Component.onCompleted: {
                  print ("before " + containsMouse)
                  visible = true
                  print ("after " + containsMouse)
              }
          }
      }
      

      The printed output of this example is:

      before false
      after true

      This is obviously wrong as the windows does not contain the mouse cursor at any point. The problem does not occur if the MouseArea starts in the visible state.

      Attachments

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

        Activity

          People

            frederik Frederik Gladhorn
            bachewii Jens
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes