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

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

XMLWordPrintable

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

      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.

        For Gerrit Dashboard: QTBUG-40475
        # Subject Branch Project Status CR V

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes