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

MouseArea doesn't receive hover event if cursor isn't moving

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.8.0 Alpha
    • 5.3.1
    • None
    • Qt 5.3.1 MSVC 2010 x32
    • 6f84a09dfbd15aac023580cf06e7b8c24f3b524c

    Description

      MouseArea doesn't recieve hover eaven when it's moved and cursor isn't

       
      import QtQuick 2.2
      Rectangle {
          width: 400
          height: 200
      
          Rectangle {
              id: rect1
              width: 100; height: 100
              color: "red"
      
              SequentialAnimation on x {
                  loops: Animation.Infinite
                  PropertyAnimation { duration: 1000; to: 200 }
                  PropertyAnimation { to: 0 }
              }
      
              MouseArea {
                  id: mouseArea
      
                  anchors.fill: parent
                  hoverEnabled: true
      
                  states: [
                      State {
                          when: mouseArea.containsMouse
                          PropertyChanges { target: rect1; color: "blue" }
                      }
                  ]
              }
          }
      }
      

      In this example if you move you mouse to the path of the rectangle but not into rectangle the color of rectangle will not change even it will contains mouse.
      You have to move your cursor.

      Attachments

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              zvava Alexander
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes