From 1e4369fce7bb5298ee8d6fa543b9e25095ef20f8 Mon Sep 17 00:00:00 2001 From: Nikolaos Ftylitakis Date: Thu, 2 Dec 2021 19:17:42 +0200 Subject: [PATCH] fix processing time per frame calculation and QML component version --- src/QZXing.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/QZXing.cpp b/src/QZXing.cpp index c404d66..69da3b2 100644 --- a/src/QZXing.cpp +++ b/src/QZXing.cpp @@ -102,10 +102,10 @@ QZXing::QZXing(QZXing::DecoderFormat decodeHints, QObject *parent) : QObject(par #if QT_VERSION >= 0x040700 void QZXing::registerQMLTypes() { - qmlRegisterType("QZXing", 3, 2, "QZXing"); + qmlRegisterType("QZXing", 3, 3, "QZXing"); #ifdef QZXING_MULTIMEDIA - qmlRegisterType("QZXing", 3, 2, "QZXingFilter"); + qmlRegisterType("QZXing", 3, 3, "QZXingFilter"); #endif //QZXING_MULTIMEDIA } @@ -423,8 +423,8 @@ QString QZXing::decodeImage(const QImage &image, int maxWidth, int maxHeight, bo if(image.isNull()) { - emit decodingFinished(false); processingTime = t.elapsed(); + emit decodingFinished(false); //qDebug() << "End decoding 1"; return ""; } @@ -555,15 +555,14 @@ QString QZXing::decodeImage(const QImage &image, int maxWidth, int maxHeight, bo emit tagFoundAdvanced(string, decodedFormat, charSet_, rect); }catch(zxing::Exception &/*e*/){} } + processingTime = t.elapsed(); emit decodingFinished(true); - //qDebug() << "End decoding 2"; return string; } + processingTime = t.elapsed(); emit error(errorMessage); emit decodingFinished(false); - processingTime = t.elapsed(); - //qDebug() << "End decoding 3"; return ""; }