aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickmousearea/data
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-04-26 16:18:54 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-27 20:36:57 +0200
commitd054755e9e452df05fb590510d25bf4167b97af7 (patch)
tree1f419b2c75bce91a2a5cb4da351602a6609f1622 /tests/auto/quick/qquickmousearea/data
parent53e317468626284fe26877659dff551ce3bc0e55 (diff)
Fix hover after press event
When a mouse press event was rejected, we would unconditionally cancel the hover and claim that the mouse is not contained any more. Instead check if the mouse left and only then cancel the hover state. Task-number: QTBUG-30783 Change-Id: I5fac6f3a1f2807ef03e07982c603492d40d2a249 Reviewed-by: Florian Boucault <florian@boucault.net> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'tests/auto/quick/qquickmousearea/data')
-rw-r--r--tests/auto/quick/qquickmousearea/data/hoverAfterPress.qml29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickmousearea/data/hoverAfterPress.qml b/tests/auto/quick/qquickmousearea/data/hoverAfterPress.qml
new file mode 100644
index 0000000000..69ec8fbd47
--- /dev/null
+++ b/tests/auto/quick/qquickmousearea/data/hoverAfterPress.qml
@@ -0,0 +1,29 @@
+import QtQuick 2.0
+
+Item {
+ width: 500
+ height: 500
+
+ Rectangle {
+ width: 300
+ height: 300
+ color: "grey"
+ x: 100
+ y: 100
+
+ MouseArea {
+ id: mouseArea
+ objectName: "mouseArea"
+ anchors.fill: parent
+ hoverEnabled: true
+ onPressed: mouse.accepted = false
+ //onContainsMouseChanged: print("containsMouse changed =", containsMouse)
+
+ Rectangle {
+ visible: parent.containsMouse
+ color: "red"
+ width: 10; height: 10
+ }
+ }
+ }
+}