summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@jollamobile.com>2013-08-17 15:49:33 +1000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-18 07:52:54 +0200
commitc2106683461bc02da95f7bd014eca17beeec4319 (patch)
tree4d8e51cd80c45e3ec15557de2bc9aeef305e30f1 /src
parentd20f003f366741829522aa0aedbb0b6e28f58253 (diff)
Fix mouse test event in window warning message.
The tests use local coordinates, but window->geometry() gives the global position on the window, i.e. offset by the size of the decoration. Change-Id: Id63ffd7e160b77ddb0f5563d8c3c65c36ad45e89 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/testlib/qtestmouse.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/testlib/qtestmouse.h b/src/testlib/qtestmouse.h
index 4d70aff27e..8efa80789c 100644
--- a/src/testlib/qtestmouse.h
+++ b/src/testlib/qtestmouse.h
@@ -61,6 +61,8 @@
#include <QtWidgets/qwidget.h>
#endif
+#include <QDebug>
+
QT_BEGIN_NAMESPACE
Q_GUI_EXPORT void qt_handleMouseEvent(QWindow *w, const QPointF & local, const QPointF & global, Qt::MouseButtons b, Qt::KeyboardModifiers mods = Qt::NoModifier);
@@ -84,8 +86,10 @@ namespace QTest
QTEST_ASSERT(window);
extern int Q_TESTLIB_EXPORT defaultMouseDelay();
- if (!window->geometry().contains(pos))
+ // pos is in window local coordinates
+ if (window->geometry().width() <= pos.x() || window->geometry().height() <= pos.y()) {
QTest::qWarn("Mouse event occurs outside of target window.");
+ }
static Qt::MouseButton lastButton = Qt::NoButton;