~stefan-schwarzburg/qreator/qreator-qml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import QtQuick 2.0
import QtGraphicalEffects 1.0
import Ubuntu.Components 0.1
import QtQuick.LocalStorage 2.0

import "../js/qrcode.js" as QrCode
import "../js/qreator.js" as Qreator


Item {
    id: container
    height: parent.height
    width: parent.width
    
    property string text
    onTextChanged: qrcanvas.requestPaint()

    RectangularGlow {
        id: effect
        anchors.fill: qrcanvas
        glowRadius: 10
        spread: 0.2
        color: "#DD4814"
        cornerRadius: glowRadius
    }

    Canvas {
        id: qrcanvas
        width: container.width
        height: container.height
        antialiasing: true
        onPaint: Qreator.drawQrCode(container.text)        
        Component.onCompleted: {
            root.updateCanvas.connect(qrcanvas.requestPaint)
        }
    }
}