Use build-system to declare tests that are low-DPI

Change-Id: I6da7204683b3c46232cfc542ed5e28131a82e87d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Tor Arne Vestbø 2020-08-27 17:29:14 +02:00
parent 1aa412987f
commit 9d2b43de19
12 changed files with 11 additions and 22 deletions

View File

@ -64,6 +64,10 @@
#include <QtCore/qurl.h>
#include <QtCore/quuid.h>
#if defined(TESTCASE_LOWDPI)
#include <QtCore/qcoreapplication.h>
#endif
#include <QtCore/qpoint.h>
#include <QtCore/qsize.h>
#include <QtCore/qrect.h>
@ -461,6 +465,7 @@ bool compareSequence(ActualIterator actualIt, ActualIterator actualEnd,
#if defined(TESTCASE_LOWDPI)
void disableHighDpi()
{
QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, false);
}
Q_CONSTRUCTOR_FUNCTION(disableHighDpi);

View File

@ -286,9 +286,6 @@ class tst_QGraphicsItem : public QObject
{
Q_OBJECT
public:
static void initMain();
private slots:
void cleanup();
void construction();
@ -494,10 +491,6 @@ private:
QPointingDevice *m_touchDevice = QTest::createTouchDevice();
};
void tst_QGraphicsItem::initMain()
{
}
void tst_QGraphicsItem::cleanup()
{
QVERIFY(QApplication::topLevelWidgets().isEmpty());

View File

@ -5,6 +5,7 @@
#####################################################################
qt_add_test(tst_qgraphicsscene
LOWDPI
SOURCES
tst_qgraphicsscene.cpp
DEFINES

View File

@ -1,4 +1,4 @@
CONFIG += testcase
CONFIG += testcase testcase_lowdpi
TARGET = tst_qgraphicsscene
QT += widgets widgets-private testlib
QT += core-private gui-private

View File

@ -185,7 +185,6 @@ class tst_QGraphicsScene : public QObject
Q_OBJECT
public:
tst_QGraphicsScene();
static void initMain() { QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); }
public slots:
void cleanup();

View File

@ -104,7 +104,6 @@ class tst_QHeaderView : public QObject
public:
tst_QHeaderView();
static void initMain();
private slots:
void initTestCase();
@ -265,10 +264,6 @@ protected:
QElapsedTimer timer;
};
void tst_QHeaderView::initMain()
{
}
class QtTestModel: public QAbstractTableModel
{
Q_OBJECT

View File

@ -11,6 +11,7 @@ file(GLOB_RECURSE test_data_glob
list(APPEND test_data ${test_data_glob})
qt_add_test(tst_qframe
LOWDPI
SOURCES
tst_qframe.cpp
PUBLIC_LIBRARIES

View File

@ -1,4 +1,4 @@
CONFIG += testcase
CONFIG += testcase testcase_lowdpi
TARGET = tst_qframe
QT += testlib widgets

View File

@ -38,9 +38,6 @@ class tst_QFrame : public QObject
{
Q_OBJECT
public:
static void initMain() { QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); }
private slots:
void testDefaults();
void testInitStyleOption_data();

View File

@ -5,6 +5,7 @@
#####################################################################
qt_add_test(tst_qopenglwidget
LOWDPI
SOURCES
tst_qopenglwidget.cpp
PUBLIC_LIBRARIES

View File

@ -1,4 +1,4 @@
CONFIG += testcase
CONFIG += testcase testcase_lowdpi
TARGET = tst_qopenglwidget
QT += opengl opengl-private gui-private core-private testlib widgets openglwidgets

View File

@ -48,9 +48,6 @@ class tst_QOpenGLWidget : public QObject
{
Q_OBJECT
public:
static void initMain() { QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); }
private slots:
void initTestCase();
void create();