summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/styles
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-11-09 11:05:03 +0100
committerLiang Qi <liang.qi@qt.io>2017-11-09 11:47:57 +0100
commit88cf04458002d863750e9121af7dcd9bcbfaa169 (patch)
treecaccae211eef1a27fa5caae3a8403830b615bd5e /tests/auto/widgets/styles
parent19b0ce5daa31e2ffebfcf2701143742302f1deb4 (diff)
parent579d0cb2bed193ccb1901b121a360f85d1c57a54 (diff)
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts: src/gui/kernel/qwindow.cpp src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/windows/qwindowssystemtrayicon.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp tests/auto/widgets/kernel/qaction/tst_qaction.cpp Change-Id: Ifa515dc0ece7eb1471b00c1214149629a7e6a233
Diffstat (limited to 'tests/auto/widgets/styles')
-rw-r--r--tests/auto/widgets/styles/qstyle/qstyle.pro2
-rw-r--r--tests/auto/widgets/styles/qstyle/tst_qstyle.cpp12
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro2
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp7
4 files changed, 7 insertions, 16 deletions
diff --git a/tests/auto/widgets/styles/qstyle/qstyle.pro b/tests/auto/widgets/styles/qstyle/qstyle.pro
index a1e5a70a08..0fb7499946 100644
--- a/tests/auto/widgets/styles/qstyle/qstyle.pro
+++ b/tests/auto/widgets/styles/qstyle/qstyle.pro
@@ -1,6 +1,6 @@
CONFIG += testcase
TARGET = tst_qstyle
-QT += widgets testlib
+QT += widgets testlib testlib-private
SOURCES += tst_qstyle.cpp
android {
diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
index d5ef2fe94b..cd8ba95b06 100644
--- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
+++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
@@ -60,15 +60,9 @@
#include <algorithm>
-// Make a widget frameless to prevent size constraints of title bars
-// from interfering (Windows).
-static inline void setFrameless(QWidget *w)
-{
- Qt::WindowFlags flags = w->windowFlags();
- flags |= Qt::FramelessWindowHint;
- flags &= ~(Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
- w->setWindowFlags(flags);
-}
+#include <QtTest/private/qtesthelpers_p.h>
+
+using namespace QTestPrivate;
class tst_QStyle : public QObject
{
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro b/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro
index 7d9a8576d3..3bf1b94050 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro
+++ b/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro
@@ -1,6 +1,6 @@
CONFIG += testcase
TARGET = tst_qstylesheetstyle
-QT += widgets widgets-private gui-private testlib
+QT += widgets widgets-private gui-private testlib testlib-private
SOURCES += tst_qstylesheetstyle.cpp
RESOURCES += resources.qrc
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 693b0b8aee..7953077152 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -33,12 +33,9 @@
#include <QMetaObject>
#include <private/qstylesheetstyle_p.h>
+#include <QtTest/private/qtesthelpers_p.h>
-static inline void centerOnScreen(QWidget *w)
-{
- const QPoint offset = QPoint(w->width() / 2, w->height() / 2);
- w->move(QGuiApplication::primaryScreen()->availableGeometry().center() - offset);
-}
+using namespace QTestPrivate;
class tst_QStyleSheetStyle : public QObject
{