M4rtinK / qqr.js

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

How to get QrCode to redraw image? #3

Open stefanlenoach opened 6 years ago

stefanlenoach commented 6 years ago

Hello, I'd like the QrCode to hold some variable value. I've tried executing some code like this:

    QRCode {
        id:qrcode
        width:100
        height:100
        value: 'init value'
        onVisibleChanged: {
            console.log(qrcode.value)  // value still equals 'init value'
            qrcode.value = 'new value'
            console.log(qrcode.value) //new value equals 'new value'
            qrcode.requestPaint()
            qrcode.update()
          }
    }

The javascript code is executing as expected, only the new value is never reflected in what is actually drawn. What am I doing wrong?