Milian Wolff a7103d5cac Expand QZXingFilter example code
- allow autofocus and manual focus
- count number of tags matched
- allow configuring the barcode scanner from QML
2017-01-10 13:17:54 +01:00

29 lines
755 B
C++

#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QDebug>
#include <Qt>
#include "QZXingFilter.h"
#if defined(Q_OS_IOS)
/// Reference for iOS entry point:
/// http://stackoverflow.com/questions/25353686/you-are-creating-qapplication-before-calling-uiapplicationmain-error-on-ios
extern "C" int qtmn(int argc, char **argv)
#else
int main(int argc, char *argv[])
#endif
{
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
qmlRegisterType<QZXingFilter>("QZXing", 2, 3, "QZXingFilter");
qmlRegisterType<QZXing>("QZXing", 2, 3, "QZXing");
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
return app.exec();
}