diff options
author | Jan Arve Sæther <jan-arve.saether@qt.io> | 2018-08-23 14:00:01 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-03-04 12:39:53 +0000 |
commit | 1c7213dbc00fa595aeaa98ad5631bac56782599e (patch) | |
tree | a2821c20fccb994693c4bd41686fd22225bc53ae /tests/auto/quickwidgets | |
parent | 042f2b67739439c020451843d887d131d5f9cbdc (diff) |
Fix a bug where hover events were not sent if the mouse was never moved
This happened if the "real mouse" was never moved, since moving the real
mouse caused it to update the internal
QQuickWindowPrivate::lastMousePosition. If the window never got any
mouse events, it would therefore fail to generate proper hover events.
However, if the window got exposed under a mouse cursor it would generate
a hover enter event. We therefore update lastMousePosition when that
happens also.
Change-Id: I77d9b1bd779a813756c4056b015f2e81664b6d36
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/quickwidgets')
-rw-r--r-- | tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp index 42dc766a13..aaf37b32cd 100644 --- a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp +++ b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp @@ -569,7 +569,10 @@ void tst_qquickwidget::mouseEventWindowPos() QVERIFY(!rootItem->property("wasClicked").toBool()); QVERIFY(!rootItem->property("wasDoubleClicked").toBool()); - QVERIFY(!rootItem->property("wasMoved").toBool()); + // Moving an item under the mouse cursor will trigger a mouse move event. + // The above quick->move() will trigger a mouse move event on macOS. + // Discard that in order to get a clean slate for the actual tests. + rootItem->setProperty("wasMoved", QVariant(false)); QWindow *window = widget.windowHandle(); QVERIFY(window); |