ftylitak / qzxing Goto Github PK
View Code? Open in Web Editor NEWQt/QML wrapper library for the ZXing library. 1D/2D barcode image processing library
License: Apache License 2.0
Qt/QML wrapper library for the ZXing library. 1D/2D barcode image processing library
License: Apache License 2.0
@ftylitak
Hi
i succesfully compile the code and i added qzxing folder inside my project but when i run the code QR code is not generated in qml side.
during runtime i get this error: module "QZXing" is not installed
can you please look at my code when i did mistake
more ever my contain of code is this
in my .pro file i added this
CONFIG += qzxing_qml
CONFIG += staticlib
include(QZXing/QZXing.pri)
HEADERS += \
\home\path\of\my\system\qmlqrcode\qzxing\src \
main.cpp file
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QZXing.h>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
QString data = "text to be encoded";
QImage barcode = QZXing::encodeData(data);
return app.exec();
}
main.qml file
import QtQuick 2.7
import QtQuick.Window 2.2
import QZXing 2.3
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
Text {
text: qsTr("Hello World")
anchors.centerIn: parent
}
Image{
source: "image://QZXing/encode/" + inputField.text;
cache: false;
}
}
Using QZXingLive on Android is impossible to decode QR CODE because the QImage passed to QZXing::decodeImage is mirrored.
To check I simply added:
image.save("/storage/emulated/0/bbbb.jpg", "JPG");
on the top of decodeImage then opened with a filemanager.
Code 39 is decoded without problem because the image is rotated while decoding but QR CODE has 2 dimensions so rating doesn't solve because of it's mirrored.
Hello there.
I think it would be very useful to provide qtquick2 example. Docs are lacking details. What below comment means?
I found Image provider but its not related to Camera Element in any way.
* The decoding function accessible from QML. (Suggested for Qt 5.x)
* Can be used to decode image from the Camera element preview by providing
* the following string: image://camera/preview_1
*/
QString decodeImageQML(const QUrl &imageUrl);
These packages I had to install in Ubuntu 16.04 compile QZXingLive:
Additionally, I had to yank the line #include <qzxing.h> from main.cpp.
@ftylitak My platform system is Android.please give me a hand
Result of
QImage QZXing::encodeData(const QString& data)
is incorrect QR Code. Even zxing site can't recognize it.
Please fix it as soon as possible...
Hi
I included QZXing to my project by adding "include(QZXing/QZXing.pri)" to my .pro file .
but when I want to build my project I get the following error:
/usr/local/include/zxing/MatSource.h:34: error: invalid covariant return type for 'virtual zxing::ArrayRef<char> MatSource::getMatrix() const' zxing::ArrayRef<char> getMatrix() const; ^
When compiling QZXing with Qt 5.9.2 and MSVC2017 64bit(Visual C++ Compiler 15.0) the following error is occuring in MaskUtil.cpp several times:
C2039: "max" is not an element of "std".
I could fix this by including <algorithm> in MaskUtil.cpp
The strange thing is, this error never occured before. This is just occuring after reinstalling by build environment and yet it seems to me like this is a real issue and not a environmental one.
I get "QtCore: No such file or directory" when I try building my project. If I remove "CONFIG += qzxing_qml" everything works fine but I want to use QML. My Qt version is 5.9 and I tried to build on Ubuntu GCC 64 bit
Here is my .pro file
QT += qml quick
CONFIG += qt c++11
SOURCES += main.cpp
RESOURCES += qml.qrc
QML_IMPORT_PATH =
QML_DESIGNER_IMPORT_PATH =
DEFINES += QT_DEPRECATED_WARNINGS
CONFIG += qzxing_qml
include(src/QZXing.pri)
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
@ftylitak
I have noticed error occurring so frequent, I started thinking if the library already includes the check digit calculation .. or is this done by the native ZXing source ? any idea ?
Hi
There are two major cavetas when we want to build QZXing:
CONFIG += qzxing_qml qzxing_multimedia
DEFINES += QZXING_QML QZXING_MULTIMEDIA
Other confusing thing is "official" release (currently from past year) - I don't found it very useful: no examples it also lack some files... So I decide to use master branch from github.
thanks and best regards
Jacek
When setting the QZXing pri to not add QML:
CONFIG -= qzxing_qml
In QZXing.cpp and ImageHandler.cpp there are QML related include files outside #ifdef QZXING_QML scope. This will cause errors if project does not include QML.
Hello,
I'm using a webcam for reading data matrix codes. The image size is 640x480. If the code is in the center of the image, the code will be decoded. But not if its at the corner or else.
After merging #13 decoding success rate dropped.
Attached are 2 log files, logs from the test cases before and after.
qzxing_decode_3_0_alpha_0_2_test_results.txt
qzxing_decode_3_0_alpha_0_3_test_results.txt
../../src/QZXing.h:84:19: error: 'QZXingFilter' was not declared in this scope
qmlRegisterType<QZXingFilter>("QZXing", 2, 3, "QZXingFilter");
It seems this is caused by 75eb47e
Hello,
the memory increase in Debug, but not in Release, when I'm using decodeImage(). In Release its alternating but not going up like in Debug.
Hello, thanks for providing this library. I'm using Data Matrix codes containing binary data. Is it somehow possible to get a QByteArray instead of a QString back from decodeImage?
Probably something I missed, but I keep getting this QML error (module "QZXing" is not installed) when attempting to run QMLBarcodeScanner example (on Mac). The example compiles and links without error, but I figure I am not picking up a library somewhere (for QML).
NOTE: I actually ported the example provided to use the latest "declarative-camera" QT 5.9.4 example as a base, as the older QZXing example code was using the obsolete declarative module.
Any help would be appreciated.
Thanks.
Thanks for awesome project!
Trying example on Qt5.9 ARM (Android) on test QrCode
decoder {
enabledDecoders: QZXing.DecoderFormat_QR_CODE |
QZXing.DecoderFormat_PDF_417 |
QZXing.DecoderFormat_DATA_MATRIX |
QZXing.DecoderFormat_Aztec
onTagFound: {
console.log(tag + " | " + decoder.foundedFormat() + " | " + decoder.charSet());
}
tryHarder: false
}
Shows
(onTagFound): qml: TestTag | | ISO8859-1
Where foundedFormat is empty, any help?
Hi!
I have alias to property for QZXingFilter.decoder.enabledDecoders. And when I write default value to this alias my app hangs! I am not sure whether is this qml bug or qzxing. So I ask you first before I report this to the Qt.
My alias is declared:
Base {
property alias codes: zxingFilter.codes
codes: QZXing.DecoderFormat_EAN_8 | QZXing.DecoderFormat_EAN_13 | QZXing.DecoderFormat_CODE_128 | QZXing.DecoderFormat_CODE_39 | QZXing.DecoderFormat_QR_CODE
QZXingFilter
{
,,,
decoder {
id: decoder1
....
}
}
Base is my page/window base class.
And when I write directly this default codecs - then it works!
decoder {
id: decoder1
enabledDecoders: QZXing.DecoderFormat_EAN_8 | QZXing.DecoderFormat_EAN_13 | QZXing.DecoderFormat_CODE_128 | QZXing.DecoderFormat_CODE_39 | QZXing.DecoderFormat_QR_CODE
But I don't want do it in that way - because I want to make generic interface to my qml class (window/page).
Currently when we want to encode a QRCode from QML we call qzxing.encode(data)
and access it with an image provider at source: "image://QZXing/latestEncoded"
.
This can be made more declarative by modifying the image provider to be able to do source: image://QZXing/data
, others parameter than the data could also be passed if needed in the future (format, error correction, ...).
This has 2 more advantages, when changing the encoded data you don't have to reset the source (emptying it and resetting to the same url) to update the image, and you can display 2 different encoded codes at the same time easily.
If you feel this is a good idea, I could contribute a PR (I already have a PoC working).
follow is my patch:
src/zxing/zxing/common/CharacterSetECI.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/zxing/zxing/common/CharacterSetECI.h b/src/zxing/zxing/common/CharacterSetECI.h
index 95ea86f..99c4883 100644
--- a/src/zxing/zxing/common/CharacterSetECI.h
+++ b/src/zxing/zxing/common/CharacterSetECI.h
@@ -20,6 +20,7 @@
*/
#include <map>
+#include <vector>
#include <zxing/DecodeHints.h>
namespace zxing {
@@ -29,8 +30,10 @@ class CharacterSetECI {
private:
static std::map<int, CharacterSetECI*> VALUE_TO_ECI;
static std::map<std::string, CharacterSetECI*> NAME_TO_ECI;
- static const bool inited;
+ static std::vector<CharacterSetECI*> ECItables;
+ static bool inited;
static bool init_tables();
+ static void removeAllCharacterSets();
int const* const values_;
char const* const* const names_;
src/zxing/zxing/common/CharacterSetECI.cpp | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/zxing/zxing/common/CharacterSetECI.cpp b/src/zxing/zxing/common/CharacterSetECI.cpp
index 8386208..675d462 100644
--- a/src/zxing/zxing/common/CharacterSetECI.cpp
+++ b/src/zxing/zxing/common/CharacterSetECI.cpp
@@ -27,7 +27,8 @@ using zxing::IllegalArgumentException;
std::map<int, CharacterSetECI*> CharacterSetECI::VALUE_TO_ECI;
std::map<std::string, CharacterSetECI*> CharacterSetECI::NAME_TO_ECI;
-const bool CharacterSetECI::inited = CharacterSetECI::init_tables();
+std::vector<CharacterSetECI*> CharacterSetECI::ECItables;
+bool CharacterSetECI::inited = CharacterSetECI::init_tables();
#define ADD_CHARACTER_SET(VALUES, STRINGS) \
{ static int values[] = {VALUES, -1}; \
@@ -64,6 +65,7 @@ bool CharacterSetECI::init_tables() {
ADD_CHARACTER_SET(28, "Big5");
ADD_CHARACTER_SET(29, "GB18030" XC "GB2312" XC "EUC_CN" XC "GBK");
ADD_CHARACTER_SET(30, "EUC_KR" XC "EUC-KR");
+ atexit(removeAllCharacterSets);
return true;
}
@@ -89,7 +91,21 @@ int CharacterSetECI::getValue() const {
}
void CharacterSetECI::addCharacterSet(int const* values, char const* const* names) {
- new CharacterSetECI(values, names);
+ ECItables.push_back(new CharacterSetECI(values, names));
+}
+
+void CharacterSetECI::removeAllCharacterSets()
+{
+ VALUE_TO_ECI.clear();
+ NAME_TO_ECI.clear();
+
+ for (std::vector<CharacterSetECI*>::iterator i=ECItables.begin();i!=ECItables.end();i++)
+ {
+ delete *i;;
+ }
+ ECItables.clear();
+
+ inited=false;
}
CharacterSetECI* CharacterSetECI::getCharacterSetECIByValue(int value) {
The camera here natively produces 'GBRG' only, according to v4l2-ctl --all
Yet, QZXingLive fails, because it is fed Format_YUV420P.
Can I instruct it to use a working format conversion?
Hi, when using qzxinglive on Android the camera preview is very slow (the video jerks).
On my Samsung S3 Neo is noteworthy, on a Nexus S5 is less evident but still perceivable. It seems like the process is taking a lot of CPU. Have you ever noticed this problem?
There is an issue in the creation of the image of RGB32.
The issue is already fixed, though i have not yet commited it. This issue is made for tracking reasons.
The issue is that when the image is of format RGB32, it is processed as if it was RGB24 which resulted in wrong image. Moreover, the data buffer provided by the filter as frame has 'y' inverted, resulting horizontally flipped image.
@ftylitak :
I want to limit the decoding time in 100ms.
If more than 100ms, stop decoding.
what should I do ?
thanks
Hello everyone,
I use the QZxing library with openCV in my application. It works fine on Linux, macOS and Android x86, but unfortunately not on Android ARMv7, it fails with the next error
F libc : Fatal signal 6 (SIGABRT), code -6 in tid 29269 (ThreadQrReader)
This crash happens when openCV has detected QR code and propagate it to the QZXing library. If QR, then QZXing library tries to decode QImage with QR and crashes (not always but in 80-90%).
I tried to narrow the problem context and started to use only decoder for QR - DecoderFormat_QR_CODE. So, it helped a bit but still I have some crashes on decoding.
Then I done another test and fully removed openCV library from my application. I use prepared images (with correct QR codes and some images without QR or corrupted QR) and pass the to a QZXing library. All works fine, when image doesn't contain QR or QR corrupted the QZXing library returns empty string - which is nice, otherwise it returns decoded text.
So, my assumption that openCV and QZXing library works unstable on Android ARMv7 and I don't know how to fix it.
I thought that the problem can be in emitting exceptions from QZXing lib, but I can't prove it and not sure why it works fine on Android x86.
Hi.
I've successfully compile the library on a raspberry pi and add it to my project, but when I try to include it QT won't recognize it.
Any idea here.
Best Regards,
Daniel Tavares
First of all this is great project!
I downloaded example and tried QZXingLive.
I was able to successfully decode bar code with no problem.
I did not modify any source code in example code.
I did add info.plist to enable camera.
I had no success so far on decoding QRCode.
I am using iphone 7+ as test device.
below is a snippet of qml debug print.
Please advise on what I might be missing.
J
160.37708830548917 419
qml: frame finished: false 120 160.28095238095227 420
qml: frame finished: false 120 160.1852731591448 421
qml: frame finished: false 902 161.9431279620852 422
Hi,
I have been playing around with QZXing to create a bar code scanner application. It works perfectly for the most part. But I have noticed an odd behavior with the library.
Whenever I try to decode a code which has a (
as the first character, the decoded text has a ]C
in the beginning.
INPUT: (01)95012345678903(3103)000123
OUTPUT ]C01950123456789033103000123
As you can see, there is no issue with a (
character that occurs in the middle of the code. I have enabled all DecoderFormats in my code.
Is this a known issue or am I doing something wrong?
The attached QR code can not be decoded by this library, however when I upload the same file to https://zxing.org/w/decode.jspx it works.
The text encoded is "Hallo Martin".
What I find strange is when I scan this picture with my Android mobile using "QR Droid" (which also uses ZXing) it can decode it. Then I let the decoded text now be encoded again with "QR Droid", but the resulting image is different (although both versions can be decoded by QR Droid).
Hello
I am just unable to run the QZXingLive Example.
I have been following up issues related to this example in this repository.
I am using Qt5.7 on Ubuntu with Latest Android Build Sdk : android-26.
Tried using gradle.. i get this error.
Warning: QML import could not be resolved in any of the import paths: QZXing
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Material.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Universal.implFAILURE: Build failed with an exception.
Where:
Build file '/home/kaushik/QtProjects/QZingLive-Android-Release/android-build/build.gradle' line: 17What went wrong:
A problem occurred evaluating root project 'android-build'.java.lang.UnsupportedClassVersionError: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0
- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.BUILD FAILED
Tried to build using ant but get this error.
BUILD FAILED
/home/kaushik/Android/android-sdk-linux/tools/ant/build.xml:649: The following error occurred while executing this line:
/home/kaushik/Android/android-sdk-linux/tools/ant/build.xml:694: null returned: 139
I just need to get this example working so that I can use this in my application.
Thanks for your time.
When compiling QZXing with Qt 5.9.2 and MSVC2017 64bit(Visual C++ Compiler 15.0) a bunch of errors are occuring in "ratio" and "chrono". One of them is:
"C2065: "INTMAX_MAX": undeclared identifier
QZXing ships with a version of stdint.h. In this, the define segment
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
starting at line 131 is grey. Therefore INTMAX_MAX is truely undefined.
By manually adding
#define __STDC_LIMIT_MACROS
in before of line 131, i could manage to get all ratio and chrono errors removed.
https://developer.android.com/training/permissions/requesting.html
Build QZXingLive on Android 6.0
Fix. Please :...
As this a wrapper of the c++ fork of the java-based zxing, but zxing-cpp is included as source code, I would like to ask about your plans to track improvements/bug fixes from the java implementation and the c++ port.
Thanks for your time and work!
As far as I understand now its only possible to decode image by image.
That forces user to interact with application in some way (by clicking decode/capture) I think library must provide way to scan images sequentially and emit signals on Tag found.
Or its possible already and I missed something..?
Again qtquick2 example would be perfect!
the qrcode data is:http://qstx.rxdouniu.cn/admin/scan_return?erweimaId=210099
but use the example of QZXingDragNDropTest, it not read qrcode data from the file.
thank you very much!
solved, caused by png transparency , please close the issue.
Hi,
I clone this library and it is working fine in QML on my qt creator. Now i am try to add this in my project but in that it is not always showing
QZXing.h no such file or directory !!
i already generate QR code in x86 QT
reference : module "QZXing" is not installed in qml at QT plateform
I can confirm that reported issue in this post:
http://git.net/ml/zxing/2013-03/msg00152.html
is current state. It is serious bug which does not allow to use this code in business applications.
I don't know - but it seems to be simple typo. So maybe you can fix this?
Hi
Some time ago I successfully compile and run QZXingLive example. But I cant remember what it is needed to be done in order to do this. First thing what I need to do is fix this line in Utilities.java:
ArrayList<String> permissionsToRequest = new ArrayList<>();
Correct is:
ArrayList<String> permissionsToRequest = new ArrayList<String>();
What is strange to me is the necessity some Java code (personally I hate this language!).
But it helps only a little. And more serious bug incoming:
[javac] C:\QTSRC\external\qzxing\examples\build-QZXingLive-Android_dla_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug\android-build\src\org\ftylitak\qzxing\Utilities.java:6: error: package android.support.v4.app does not exist
[javac] import android.support.v4.app.ActivityCompat;
[javac] ^
[javac] C:\QTSRC\external\qzxing\examples\build-QZXingLive-Android_dla_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug\android-build\src\org\ftylitak\qzxing\Utilities.java:7: error: package android.support.v4.content does not exist
[javac] import android.support.v4.content.ContextCompat;
[javac] ^
[javac] C:\QTSRC\external\qzxing\examples\build-QZXingLive-Android_dla_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug\android-build\src\org\ftylitak\qzxing\Utilities.java:24: error: cannot find symbol
[javac] if (ContextCompat.checkSelfPermission(activity, permissions[i])
[javac] ^
[javac] symbol: variable ContextCompat
[javac] location: class Utilities
[javac] C:\QTSRC\external\qzxing\examples\build-QZXingLive-Android_dla_armeabi_v7a_GCC_4_9_Qt_5_8_0-Debug\android-build\src\org\ftylitak\qzxing\Utilities.java:30: error: cannot find symbol
[javac] ActivityCompat.requestPermissions(activity,
[javac] ^
[javac] symbol: variable ActivityCompat
[javac] location: class Utilities
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 4 errors
Why I want again compile this example? Because I want to check whether it hangs when capture rectangle is bigger than 0,5width and 0,5height of the mobile screen. When I set it bigger (say full screen size or 0,8width and 0,8height then my app hangs when capture screen runs (it runs correctly when it had 0,5width and 0,5height).
I need bigger capture rectangle, because for our need is essential to capture QZXing.DecoderFormat_CODE_128 codes. And with capture rectangle in size 0,5width and 0,5height of the screen it does not capture at all. So I think that resolution is too low. But bigger capture rectangle hangs my app (as I mention above).
I try to run QZXingLive example on Android 4.4.2 (Api 19). Maybe do you use feature some newer Api in this example?
Hi,
I'm trying to deploy this application on an Android tablet. The compilation works and the application starts and the camera is available on the tablet but I have an error message in the application output:
W GLConsumer: [SurfaceTexture-0-15512-0] bindTextureImage: clearing GL error: 0x502
Also, I can't read any QR code.
Do you have any idea about what is wrong?
Thank you.
unable to decode on ubuntu16.04+Qt5.9
why?
I have an application written in c++ and not in qml. I am trying to use incorporate the QZingLive Example code or QZingFilter in this application...
I did not find a direct way to invoke the QZingFilter in c++. Hence I am trying to call the qml file from c++.
Functionality is...
When I press a button on my Qt Widget application screen, the camera is started to scan a barcode. if the barcode is scanned, then the data scanned is returned to the c++ window and displayed in a label.
Now I am able to accomplish that using the QZing without filter. However I need to have decoding on the live feed which is with the qzingfilter.
This is the code of the qml file which works but with qzing.
import QtQuick 2.5
import QtQuick.Controls 2.0
import QtQuick.Dialogs 1.2
import QtMultimedia 5.5
import QZXing 2.3
Rectangle {
id : cameraUI
width: parent.width
height: parent.height
color: "black"
state: "PhotoCapture"
focus: true
Camera
{
id:camera
captureMode: Camera.CaptureStillImage
imageProcessing.whiteBalanceMode: CameraImageProcessing.WhiteBalanceFlash
exposure {
exposureCompensation: -1.0
exposureMode: Camera.ExposurePortrait
}
flash.mode: Camera.FlashRedEyeReduction
focus {
focusMode: CameraFocus.FocusContinuous
focusPointMode: CameraFocus.FocusPointAuto
}
imageCapture {
onImageCaptured: {
imageToDecode.source = preview
decoder.decodeImageQML(imageToDecode)
}
}
digitalZoom: camera.maximumDigitalZoom
}
Image{
id: imageToDecode
visible: false
}
VideoOutput
{
id: videoOutput
source: camera
autoOrientation: true
height: parent.height
focus: true
MouseArea {
anchors.fill: parent
onClicked: {
camera.imageCapture.capture();
}
}
Rectangle {
id: captureZone
color: "red"
opacity: 0.2
width: parent.width / 2
height: parent.height / 2
anchors.centerIn: parent
}
}
ZoomControl {
id : myzcont
x : 0
y : 0
width : 100
height: parent.height
maximumZoom: Math.min(4.0, camera.maximumDigitalZoom)
currentZoom: camera.digitalZoom
onZoomTo: camera.setDigitalZoom(value)
onCurrentZoomChanged: camera.setDigitalZoom(value)
}
QZXing{
id: decoder
enabledDecoders: QZXing.DecoderFormat_QR_CODE | QZXing.DecoderFormat_DATA_MATRIX | QZXing.DecoderFormat_Aztec | QZXing.DecoderFormat_CODABAR | QZXing.DecoderFormat_CODE_128 | QZXing.DecoderFormat_CODE_39 | QZXing.DecoderFormat_CODE_93 | QZXing.DecoderFormat_EAN_13 | QZXing.DecoderFormat_EAN_8 | QZXing.DecoderFormat_ITF | QZXing.DecoderFormat_MAXICODE | QZXing.DecoderFormat_PDF_417 | QZXing.DecoderFormat_RSS_14 | QZXing.DecoderFormat_RSS_EXPANDED | QZXing.DecoderFormat_UPC_A | QZXing.DecoderFormat_UPC_E | QZXing.DecoderFormat_UPC_EAN_EXTENSION
onDecodingStarted: console.log("Decoding of image started...")
onTagFound: {
console.log("Barcode data: " + tag)
PrevWindow.barcodestr(tag)
}
onDecodingFinished: {
console.log("Decoding finished " + (succeeded==true ? "successfully" : "unsuccessfully") )
}
}
Keys.onReleased: {
if (event.key === Qt.Key_Back) {
console.log("Back button captured - wunderbar !")
event.accepted = true;
PrevWindow.barcodestr("")
}
}
}
Now if i substitute the QZing {} part with this... then I get an error : QZXingFilter is not a type on the word QZXingFilter when this qml file is being invoked on pressing of button.
QZXingFilter
{
id: decoder
decoder {
enabledDecoders: QZXing.DecoderFormat_EAN_13 | QZXing.DecoderFormat_CODE_39 | QZXing.DecoderFormat_QR_CODE
onTagFound: {
console.log("Barcode data: " + tag)
PrevWindow.barcodestr(tag)
}
Keys.onReleased: {
if (event.key === Qt.Key_Back) {
console.log("Back button captured - wunderbar !")
event.accepted = true;
PrevWindow.barcodestr("")
}
}
I am invoking this qml file with the following code from the Mainwindow.
QQuickWidget *m_quickWidget = new QQuickWidget();
m_quickWidget->setResizeMode(QQuickWidget::SizeRootObjectToView );
m_quickWidget->setSource(source2);
m_quickWidget->rootContext()->setContextProperty("PrevWindow",this);
setCentralWidget(m_quickWidget);
Is this the right way of using the QZxingfilter and how to use the QZingFilter with c++ application?
@ftylitak Could you please help.
Not sure why, but when decoding QrCodes sometimes the tag position returned is outside image limits.
Is any coordinate translation required?
Take a look at the return coordinates of the tag on each image:
matrixWidth = 2592
matrixHeight = 1944
QrCode = "DC00000000000TER1V6U2A4144"
Image OK
P[0].X = 582
P[0].Y = 604
P[1].X = 582
P[1].Y = 959
P[2].X = 272
P[2].Y = 959
P[3].X = 320
P[3].Y = 674
Image NOK
P[0].X = 602
P[0].Y = 2018
P[1].X = 956
P[1].Y = 2015
P[2].X = 959
P[2].Y = 2320
P[3].X = 675
P[3].Y = 2276
The last line (brackets aside that is) of that file reads
delete bytes;
while it should be
delete [] bytes;
as the bytes variable was allocated (a few lines higher up) with the new [] operator:
char* bytes = new char[count];
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.