Details
-
Bug
-
Resolution: Duplicate
-
P4: Low
-
None
-
5.0.1
-
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
- is replaced by
-
QTBUG-30783 MouseArea.containsMouse becomes false when rejecting press event
- Closed