23
23
24
24
#include < QtCore/qglobal.h>
25
25
26
- #if QT_VERSION >= 0x050000
27
26
#include < QtGui/QGuiApplication>
28
27
#include < QtQml/QQmlContext>
29
28
#include < QtQml/QQmlEngine>
30
29
#include < QtQuick/QQuickView>
31
- #else
32
- #include < QtGui/QApplication>
33
- #include < QtDeclarative/QDeclarativeContext>
34
- #include < QtDeclarative/QDeclarativeView>
35
- #include < QtDeclarative/QDeclarativeEngine>
36
- #endif
37
30
38
31
#ifdef QT_OPENGL_LIB
39
32
#include < QtOpenGL/QGLWidget>
@@ -44,24 +37,15 @@ int main(int argc, char *argv[])
44
37
QByteArray data = " 1" ;
45
38
qputenv (" QML_IMPORT_TRACE" , data);
46
39
47
- #if QT_VERSION >= 0x050000
48
40
QGuiApplication app (argc, argv);
49
41
QQuickView view;
50
- #else
51
- QApplication app (argc, argv);
52
- QDeclarativeView view;
53
- #endif
54
42
55
43
Launcher launcher;
56
44
57
45
view.engine ()->rootContext ()->setContextProperty (" launcher" , &launcher);
58
46
view.engine ()->addImportPath (" ../../src/imports" );
59
47
60
- #if QT_VERSION >= 0x050000
61
- view.setSource (QUrl (" qrc:/main-qt5.qml" ));
62
- #else
63
- view.setSource (QUrl (" qrc:/main-qt4.qml" ));
64
- #endif
48
+ view.setSource (QUrl (" qrc:/main.qml" ));
65
49
66
50
#ifdef QT_OPENGL_LIB
67
51
view.setViewport (new QGLWidget);
0 commit comments