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

mouseMove has no effect when hover is enabled and no mouse pressed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4: Low
    • None
    • 5.0.1
    • Testing: qtestlib
    • None

    Description

      Run the following test. Last mouseMove does not pass the test. Since hoverEnabled is set to true, mouseMove should work even when no buttons are pressed.

      import QtQuick 2.0
      import QtTest 1.0
      
      Item {
          id: wrapper
          width: 500
          height: 500
      
          Rectangle {
              id: interactiveRect
              width: 100
              height: 100
              anchors.centerIn: parent
      
              MouseArea {
                  id: mouseArea
                  anchors.fill: parent
                  hoverEnabled: true
              }
          }
      
          TestCase {
              when: windowShown
      
              function test_some(){
      
                  mouseMove(wrapper, -100, -100)
                  compare(mouseArea.containsMouse, false)
                  compare(mouseArea.pressed, false)
      
                  mousePress(interactiveRect, interactiveRect.width/2, interactiveRect.height/2)
                  compare(mouseArea.containsMouse, true)
                  compare(mouseArea.pressed, true)
      
                  mouseMove(wrapper, -100, -100)
                  compare(mouseArea.containsMouse, false)
                  compare(mouseArea.pressed, true)
      
                  mouseMove(interactiveRect, interactiveRect.width/2, interactiveRect.height/2)
                  compare(mouseArea.containsMouse, true)
                  compare(mouseArea.pressed, true)
      
                  mouseRelease(interactiveRect, interactiveRect.width/2, interactiveRect.height/2)
                  compare(mouseArea.containsMouse, true)
                  compare(mouseArea.pressed, false)
      
                  mouseMove(wrapper, -100, -100)
                  compare(mouseArea.containsMouse, false, "<error here. Expected: passed, actuall failed")
                  compare(mouseArea.pressed, false)
              }
          }
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              carochao Caroline Chao (Inactive)
              qtcomsupport Qt Support
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes