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>
This commit is contained in:
Stephen Kelly 2013-04-10 23:59:03 +02:00 committed by The Qt Project
parent 89e6183a19
commit fc06df5c77

View File

@ -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())