mirror of
https://github.com/status-im/qzxing.git
synced 2025-01-27 03:04:47 +00:00
applied patch from Alexxey593 from here: https://sourceforge.net/p/qzxing/discussion/general/thread/770fb0a5/#1d98
This commit is contained in:
parent
baf6d989ab
commit
a176fd841b
@ -11,6 +11,12 @@
|
||||
#include <QtQml/qqml.h>
|
||||
#endif
|
||||
|
||||
// forward declaration
|
||||
namespace zxing {
|
||||
class MultiFormatReader;
|
||||
}
|
||||
class ImageHandler;
|
||||
|
||||
/**
|
||||
* A class containing a very very small subset of the ZXing library.
|
||||
* Created for ease of use.
|
||||
@ -143,9 +149,9 @@ signals:
|
||||
void enabledFormatsChanged();
|
||||
|
||||
private:
|
||||
void* decoder;
|
||||
zxing::MultiFormatReader* decoder;
|
||||
DecoderFormatType enabledDecoders;
|
||||
QObject* imageHandler;
|
||||
ImageHandler* imageHandler;
|
||||
int processingTime;
|
||||
|
||||
/**
|
||||
|
@ -135,7 +135,7 @@ QString QZXing::decodeImage(QImage &image, int maxWidth, int maxHeight, bool smo
|
||||
|
||||
Ref<BinaryBitmap> ref(bb);
|
||||
|
||||
res = ((MultiFormatReader*)decoder)->decode(ref, DecodeHints((int)enabledDecoders));
|
||||
res = decoder->decode(ref, DecodeHints((int)enabledDecoders));
|
||||
|
||||
QString string = QString(res->getText()->getText().c_str());
|
||||
processingTime = t.elapsed();
|
||||
@ -177,7 +177,7 @@ QString QZXing::decodeSubImageQML(QObject* item,
|
||||
return "";
|
||||
}
|
||||
|
||||
QImage img = ((ImageHandler*)imageHandler)->extractQImage(item, offsetX, offsetY, width, height);
|
||||
QImage img = imageHandler->extractQImage(item, offsetX, offsetY, width, height);
|
||||
|
||||
return decodeImage(img);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user