Browse Source
unfortunately, using standard QtQuick Image.asynchronous=true leads to a deadlock at app exit so we can't use it a.t.m.master
3 changed files with 54 additions and 16 deletions
@ -1,25 +1,40 @@ |
|||||||
import QtQuick 2.6 |
import QtQuick 2.6 |
||||||
|
|
||||||
Image { |
Item { |
||||||
|
id: root |
||||||
property string qrdata |
property string qrdata |
||||||
|
property bool render: true // init to false, then set true if render needs delay |
||||||
|
property var qrprops: QRIP.getDimensions(qrdata) |
||||||
|
|
||||||
source: qrdata ? 'image://qrgen/' + qrdata : '' |
width: r.width |
||||||
|
height: r.height |
||||||
|
|
||||||
Rectangle { |
Rectangle { |
||||||
property var qrprops: QRIP.getDimensions(qrdata) |
id: r |
||||||
|
width: qrprops.modules * qrprops.box_size |
||||||
|
height: width |
||||||
color: 'white' |
color: 'white' |
||||||
x: (parent.width - width) / 2 |
} |
||||||
y: (parent.height - height) / 2 |
|
||||||
width: qrprops.icon_modules * qrprops.box_size |
Image { |
||||||
height: qrprops.icon_modules * qrprops.box_size |
source: qrdata && render ? 'image://qrgen/' + qrdata : '' |
||||||
|
|
||||||
|
Rectangle { |
||||||
|
visible: root.render |
||||||
|
color: 'white' |
||||||
|
x: (parent.width - width) / 2 |
||||||
|
y: (parent.height - height) / 2 |
||||||
|
width: qrprops.icon_modules * qrprops.box_size |
||||||
|
height: qrprops.icon_modules * qrprops.box_size |
||||||
|
|
||||||
Image { |
Image { |
||||||
source: '../../../icons/electrum.png' |
source: '../../../icons/electrum.png' |
||||||
x: 1 |
x: 1 |
||||||
y: 1 |
y: 1 |
||||||
width: parent.width - 2 |
width: parent.width - 2 |
||||||
height: parent.height - 2 |
height: parent.height - 2 |
||||||
scale: 0.9 |
scale: 0.9 |
||||||
|
} |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
|
|||||||
Loading…
Reference in new issue