M4rtinK / qqr.js

QML bindings for qr.js
Other
38 stars 15 forks source link

QR code sometimes does not render fully (only mask appears) #1

Open Acce0ss opened 9 years ago

Acce0ss commented 9 years ago

I have installed the library under /usr/lib/qt5/qml/com/example/QQCode to use it from multiple apps without copying it everytime. In the other app, the QR-codes are generated correctly, but when opening second app, only the mask is rendered (like in linked picture).

printing the value to log shows that it is properly set. Calling "requestPaint()" again or changing the value does not help, although the width / height of the code can change.

Any ideas what might be going wrong?

incomplete QR code

M4rtinK commented 9 years ago

That's pretty weird!

By second app you mean a second copy of the same app or a different application or even using the QRCode element twice in a single application ? Also does the same thing happen if you open the applications in a different order (the second one first and then the first one)?

BTW I think I can see a possible issue with using the element more than once - the .pragma library I've added to the qqr.js file might be at fault. So maybe try to comment it out to see if it helps:

diff --git a/qqr.js b/qqr.js
index 8fe3a62..eda2543 100644
--- a/qqr.js
+++ b/qqr.js
@@ -7,7 +7,7 @@
 // For all details and documentation:  
 // <http://neocotic.com/qr.js>

-.pragma library
+//.pragma library

 var _qr_instance

But for the record I'm not able to reproduce the issue after installing the element like you describe - with the pragma commented out or not, I can still run two of the examples with qmlscene or a modified example with two QRCode elements just fine.

Acce0ss commented 9 years ago

I'm making a share plugin using it, for vcards / urls: https://github.com/Acce0ss/harbour-qr-share-plugin So it is called from different apps by the same .qml file. I have tested it with People and Browser, but it only works in Browser (currently, before it worked only in People and occasionally browser).

I tried removing .pragma library already, since I remembered from somewhere it would make it a stateless library, unfortunately then it prints only mask in both cases.