diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2013-04-10 23:59:03 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-12 01:25:37 +0200 |
commit | fc06df5c77e9ea08a3b2572f048e47fb7865954a (patch) | |
tree | a74173969972c4789915c941a4144a77ff87018c /src/testlib/qtestmouse.h | |
parent | 89e6183a197f4745ef934395cfa51067107d5dc5 (diff) |
Warn if mouse event occurs outside target window in tests.
This class of bug seems to occur in 'flaky' CI tests, so give
more information about what the problem is. Found here:
https://codereview.qt-project.org/#change,44210
Change-Id: I73908e309bdecf1fd3bc323dd4e8febe47c1239a
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/testlib/qtestmouse.h')
-rw-r--r-- | src/testlib/qtestmouse.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/testlib/qtestmouse.h b/src/testlib/qtestmouse.h index ea57ac5b8c..4d70aff27e 100644 --- a/src/testlib/qtestmouse.h +++ b/src/testlib/qtestmouse.h @@ -84,6 +84,9 @@ namespace QTest QTEST_ASSERT(window); extern int Q_TESTLIB_EXPORT defaultMouseDelay(); + if (!window->geometry().contains(pos)) + QTest::qWarn("Mouse event occurs outside of target window."); + static Qt::MouseButton lastButton = Qt::NoButton; if (delay == -1 || delay < defaultMouseDelay()) |