diff options
author | Tony Sarajärvi <tony.sarajarvi@qt.io> | 2017-11-12 15:35:48 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2017-11-12 15:35:48 +0000 |
commit | 212f92182ad468ec93472ed93ae3839f7122cb68 (patch) | |
tree | 3e1d272570eb6caa022545828f80c24b656bad6e /tests/auto/widgets/graphicsview/qgraphicsitem | |
parent | 3bbeb1e9dce958ddba54f6b102bb409a63c9f889 (diff) | |
parent | 88cf04458002d863750e9121af7dcd9bcbfaa169 (diff) |
Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into refs/staging/5.10
Diffstat (limited to 'tests/auto/widgets/graphicsview/qgraphicsitem')
-rw-r--r-- | tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro | 2 | ||||
-rw-r--r-- | tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp | 14 |
2 files changed, 3 insertions, 13 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro b/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro index 88526144fc..ae6de48195 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro @@ -1,6 +1,6 @@ CONFIG += testcase TARGET = tst_qgraphicsitem -QT += widgets widgets-private testlib +QT += widgets widgets-private testlib testlib-private QT += core-private gui-private SOURCES += tst_qgraphicsitem.cpp DEFINES += QT_NO_CAST_TO_ASCII diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp index da15583d5d..2220ef8d2f 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp @@ -28,6 +28,7 @@ #include <QtTest/QtTest> +#include <QtTest/private/qtesthelpers_p.h> #include <private/qgraphicsitem_p.h> #include <private/qgraphicsview_p.h> @@ -128,17 +129,6 @@ static void sendKeyClick(QGraphicsScene *scene, Qt::Key key) sendKeyRelease(scene, key); } -static inline void centerOnScreen(QWidget *w, const QSize &size) -{ - const QPoint offset = QPoint(size.width() / 2, size.height() / 2); - w->move(QGuiApplication::primaryScreen()->availableGeometry().center() - offset); -} - -static inline void centerOnScreen(QWidget *w) -{ - centerOnScreen(w, w->geometry().size()); -} - class EventSpy : public QGraphicsWidget { Q_OBJECT @@ -4212,7 +4202,7 @@ void tst_QGraphicsItem::cursor() QWidget topLevel; topLevel.resize(250, 150); - centerOnScreen(&topLevel); + QTestPrivate::centerOnScreen(&topLevel); QGraphicsView view(&scene,&topLevel); view.setFixedSize(200, 100); topLevel.show(); |