#include #if (QT_VERSION < QT_VERSION_CHECK(5,0,0)) #include #include "qmlapplicationviewer.h" #include "droparea.h" #include #include #include #else #include #include "qtquick2applicationviewer.h" #endif #include Q_DECL_EXPORT int main(int argc, char *argv[]) { #if (QT_VERSION < QT_VERSION_CHECK(5,0,0)) QScopedPointer app(createApplication(argc, argv)); QZXing::registerQMLTypes(); QmlApplicationViewer viewer; viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); qmlRegisterType("DropArea", 1, 0, "DropArea"); viewer.setMainQmlFile(QLatin1String("qml/QZXingTestApp/main_QtQuick1.qml")); #else QGuiApplication* app = new QGuiApplication(argc, argv); QZXing::registerQMLTypes(); QtQuick2ApplicationViewer viewer; viewer.setMainQmlFile(QStringLiteral("qml/QZXingTestApp/main_QtQuick2.qml")); #endif viewer.showExpanded(); return app->exec(); }