forked from zxing-cpp/zxing-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ZXingQtCamReader.cpp
31 lines (25 loc) · 759 Bytes
/
ZXingQtCamReader.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
* Copyright 2020 Axel Waggershauser
*/
// SPDX-License-Identifier: Apache-2.0
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include "ZXingQtReader.h"
int main(int argc, char *argv[])
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
ZXingQt::registerQmlAndMetaTypes();
QGuiApplication app(argc, argv);
app.setApplicationName("ZXingQtCamReader");
QQmlApplicationEngine engine;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
engine.load(QUrl(QStringLiteral("qrc:/ZXingQt5CamReader.qml")));
#else
engine.load(QUrl(QStringLiteral("qrc:/ZXingQt6CamReader.qml")));
#endif
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}