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

the "hoverEnabled" property is not working on MouseArea

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P1: Critical
    • None
    • 5.10.0
    • None
    • Windows qtcreator 4.5.0 (MSVC 2015, 64 bit)

    Description

      the hoverEnabled property is working on the version below 5.10.0.

      See the below code:

      import QtQuick 2.6
      
      Rectangle {
          id: _rect
          width: 100
          height: 100
          color: _mouseArea.containsMouse ? "red" : "green"
      
          Component.onCompleted: {
              console.log("completed", _mouseArea.containsMouse, _rect.color)
          }
      
          MouseArea {
              id: _mouseArea
              anchors.fill: _rect
              hoverEnabled: true
              onPositionChanged: console.log("pc", _mouseArea.containsMouse )
              onContainsMouseChanged: console.log("cm", _mouseArea.containsMouse)
          }
      }
      

       

      In version 5.9.2, onPositionChanged will show output "true" when mouse is hovering on the widget but won't show on version 5.10.0 unless I press the mouse button.

       

      But according doc on qt 5.10, for the description of hoverEnabled is 

      "This property affects the containsMouse property and the onEntered, onExited and onPositionChanged signals."

       

      I think it is a serious bug.

      Attachments

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

        Activity

          People

            w00t Robin Burchell
            yu-hsuan yu-shuan chien
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes