summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-06-05 14:00:47 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-08 08:31:14 +0200
commit5fc8cc830e09bdf5f94762d9ed90fb2a417b00c6 (patch)
tree630d933b812d52aad943b5834db8309aa231695a /tests
parent027cd4c1b9304f05cb6f1b4a163274482aff052b (diff)
Make qfont autotest build without widgets
Change-Id: I2ab344d44cb2aa8c59c1c28f7368784849d4b74d Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/text/qfont/qfont.pro3
-rw-r--r--tests/auto/gui/text/qfont/tst_qfont.cpp12
2 files changed, 11 insertions, 4 deletions
diff --git a/tests/auto/gui/text/qfont/qfont.pro b/tests/auto/gui/text/qfont/qfont.pro
index 480def120f..a744d52984 100644
--- a/tests/auto/gui/text/qfont/qfont.pro
+++ b/tests/auto/gui/text/qfont/qfont.pro
@@ -1,7 +1,8 @@
CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qfont
-QT += widgets testlib
+QT += testlib
+!contains(QT_CONFIG, no-widgets): QT += widgets
SOURCES += tst_qfont.cpp
diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp
index ea26b9262b..b5cbe54354 100644
--- a/tests/auto/gui/text/qfont/tst_qfont.cpp
+++ b/tests/auto/gui/text/qfont/tst_qfont.cpp
@@ -47,8 +47,10 @@
#include <qfontdatabase.h>
#include <qfontinfo.h>
#include <qstringlist.h>
-#include <qapplication.h>
+#include <qguiapplication.h>
+#ifndef QT_NO_WIDGETS
#include <qwidget.h>
+#endif
#include <qlist.h>
class tst_QFont : public QObject
@@ -67,7 +69,9 @@ private slots:
void exactMatch();
void compare();
void resolve();
+#ifndef QT_NO_WIDGETS
void resetFont();
+#endif
void isCopyOf();
void setFontRaw();
void italicOblique();
@@ -468,6 +472,7 @@ void tst_QFont::resolve()
QCOMPARE(f4.pointSize(), 55);
}
+#ifndef QT_NO_WIDGETS
void tst_QFont::resetFont()
{
QWidget parent;
@@ -491,14 +496,15 @@ void tst_QFont::resetFont()
QVERIFY(child->font().pointSize() == parent.font().pointSize());
QVERIFY(parent.font().resolve() != 0);
}
+#endif
void tst_QFont::isCopyOf()
{
QFont font;
- QVERIFY(font.isCopyOf(QApplication::font()));
+ QVERIFY(font.isCopyOf(QGuiApplication::font()));
QFont font2("bogusfont", 23);
- QVERIFY(! font2.isCopyOf(QApplication::font()));
+ QVERIFY(! font2.isCopyOf(QGuiApplication::font()));
QFont font3 = font;
QVERIFY(font3.isCopyOf(font));