summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-02-15 01:00:50 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-02-15 01:00:51 +0100
commitef2ddcf551dec13215cb45cb000731f94b2f8e34 (patch)
treec8810f6ee77a81c3003ccc8783c9d3b17f0b8a5e /tests/auto/widgets/widgets
parente2cf6ade3535467bc2f21b54b82ed007d5ce279b (diff)
parent501cca2c4b0851cea7133ba56c3a05d71c25ce6d (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Diffstat (limited to 'tests/auto/widgets/widgets')
-rw-r--r--tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
index 37bb28dec9..1d106f94f3 100644
--- a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
+++ b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
@@ -53,6 +53,8 @@
#include <QStyleOptionSpinBox>
#include <QStyle>
#include <QProxyStyle>
+#include <QScreen>
+
class SpinBox : public QSpinBox
{
@@ -343,6 +345,14 @@ tst_QSpinBox::tst_QSpinBox()
void tst_QSpinBox::init()
{
QLocale::setDefault(QLocale(QLocale::C));
+
+#if QT_CONFIG(cursor)
+ // Ensure mouse cursor was not left by previous tests where widgets
+ // will appear, as it could cause events and interfere with the tests.
+ const QScreen *screen = QGuiApplication::primaryScreen();
+ const QRect availableGeometry = screen->availableGeometry();
+ QCursor::setPos(availableGeometry.topLeft());
+#endif
}
void tst_QSpinBox::setValue_data()