2014-01-15 16:18:02 +00:00
|
|
|
#include <QtGlobal>
|
|
|
|
#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
|
2013-07-28 20:11:37 +00:00
|
|
|
#include <QtGui/QApplication>
|
|
|
|
#include "qmlapplicationviewer.h"
|
|
|
|
#include <QDeclarativeEngine>
|
|
|
|
#include <QDeclarativeContext>
|
|
|
|
#include <qdeclarative.h>
|
2014-01-15 16:18:02 +00:00
|
|
|
#else
|
|
|
|
#include <QtGui/QGuiApplication>
|
|
|
|
#include "qtquick2applicationviewer.h"
|
|
|
|
#endif
|
2016-01-08 19:49:49 +00:00
|
|
|
#include "droparea.h"
|
2014-01-15 16:18:02 +00:00
|
|
|
|
2013-07-28 20:11:37 +00:00
|
|
|
#include <QZXing.h>
|
|
|
|
|
|
|
|
Q_DECL_EXPORT int main(int argc, char *argv[])
|
|
|
|
{
|
2014-01-15 16:18:02 +00:00
|
|
|
#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
|
2013-07-28 20:11:37 +00:00
|
|
|
QScopedPointer<QApplication> app(createApplication(argc, argv));
|
|
|
|
|
|
|
|
QZXing::registerQMLTypes();
|
|
|
|
|
|
|
|
QmlApplicationViewer viewer;
|
|
|
|
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
|
|
|
|
qmlRegisterType<DropArea>("DropArea", 1, 0, "DropArea");
|
2014-01-15 16:18:02 +00:00
|
|
|
viewer.setMainQmlFile(QLatin1String("qml/QZXingTestApp/main_QtQuick1.qml"));
|
|
|
|
#else
|
|
|
|
QGuiApplication* app = new QGuiApplication(argc, argv);
|
|
|
|
|
|
|
|
QZXing::registerQMLTypes();
|
|
|
|
|
|
|
|
QtQuick2ApplicationViewer viewer;
|
2016-01-08 19:49:49 +00:00
|
|
|
qmlRegisterType<DropArea>("DropArea", 1, 0, "DropArea");
|
2014-01-15 16:18:02 +00:00
|
|
|
viewer.setMainQmlFile(QStringLiteral("qml/QZXingTestApp/main_QtQuick2.qml"));
|
|
|
|
#endif
|
2013-07-28 20:11:37 +00:00
|
|
|
viewer.showExpanded();
|
|
|
|
|
|
|
|
return app->exec();
|
|
|
|
}
|