fine tune the use of QZXing::registerQMLTypes to include the QZXingFilter. Update QZXingLive with the latest changes

This commit is contained in:
favoritas37 2017-01-16 19:57:25 +02:00
parent 905ee3359a
commit 75eb47e8c5
3 changed files with 9 additions and 3 deletions

View File

@ -5,7 +5,7 @@
#include <QDebug>
#include <Qt>
#include "QZXingFilter.h"
#include <QZXing.h>
int main(int argc, char *argv[])
{
@ -13,8 +13,7 @@ int main(int argc, char *argv[])
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
qmlRegisterType<QZXingFilter>("QZXing", 2, 3, "QZXingFilter");
qmlRegisterType<QZXing>("QZXing", 2, 3, "QZXing");
QZXing::registerQMLTypes();
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
return app.exec();

View File

@ -79,6 +79,11 @@ public:
static void registerQMLTypes()
{
qmlRegisterType<QZXing>("QZXing", 2, 3, "QZXing");
#ifdef QZXING_MULTIMEDIA
qmlRegisterType<QZXingFilter>("QZXing", 2, 3, "QZXingFilter");
#endif //QZXING_MULTIMEDIA
}
#endif //QT_VERSION >= Qt 4.7

View File

@ -262,6 +262,8 @@ qzxing_qml {
qzxing_multimedia {
QT += multimedia
DEFINES += QZXING_MULTIMEDIA
HEADERS += \
$$PWD/QZXingFilter.h