summaryrefslogtreecommitdiff
path: root/tests/shared/qt_quick_controls_quicktest.h
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2013-04-11 19:49:39 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-15 15:09:57 +0200
commit5857ea03a77e44879191dd922b7c38c49616517b (patch)
treebff6d278b83e1ee1699ae36a89dfea463d08caa9 /tests/shared/qt_quick_controls_quicktest.h
parent2b309cf52dfff7307a055b2662e7ce1a53d44bdb (diff)
downloadqtquickcontrols-5857ea03a77e44879191dd922b7c38c49616517b.tar.gz
Remove hard dependency on widgets
Change-Id: I1fabb4efcc931f12f0a65ac5c66e6e085108269b Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'tests/shared/qt_quick_controls_quicktest.h')
-rw-r--r--tests/shared/qt_quick_controls_quicktest.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/shared/qt_quick_controls_quicktest.h b/tests/shared/qt_quick_controls_quicktest.h
index 0e1873af..8bcd0d47 100644
--- a/tests/shared/qt_quick_controls_quicktest.h
+++ b/tests/shared/qt_quick_controls_quicktest.h
@@ -43,7 +43,12 @@
#define QT_QUICK_CONTROLS_QUICKTEST_H
#include <QtQuickTest/quicktestglobal.h>
+
+#ifndef QT_NO_WIDGETS
#include <QtWidgets/QApplication>
+#else
+#include <QtGui/QGuiApplication>
+#endif
QT_BEGIN_NAMESPACE
@@ -53,12 +58,18 @@ QT_BEGIN_NAMESPACE
#define QT_QUICK_CONTROLS_TEST_MAIN_VAR 0
#endif
+#ifndef QT_NO_WIDGETS
+#define Application QApplication
+#else
+#define Application QGuiApplication
+#endif
+
#define QT_QUICK_CONTROLS_TEST_MAIN(name) \
int main(int argc, char **argv) \
{ \
- QApplication* app = 0; \
+ Application* app = 0; \
if (!QCoreApplication::instance()) \
- app = new QApplication(argc, argv); \
+ app = new Application(argc, argv); \
int i = quick_test_main(argc, argv, #name, QT_QUICK_CONTROLS_TEST_MAIN_VAR); \
delete app; \
return i; \
@@ -66,4 +77,4 @@ QT_BEGIN_NAMESPACE
QT_END_NAMESPACE
-#endif
+#endif // QT_QUICK_CONTROLS_QUICKTEST_H