1
0

qml: add hack to delay rendering of QR until dialog is shown.

unfortunately, using standard QtQuick Image.asynchronous=true leads
to a deadlock at app exit so we can't use it a.t.m.
This commit is contained in:
Sander van Grieken
2022-08-31 13:33:58 +02:00
parent 179666612e
commit 40e8ff6ce2
3 changed files with 54 additions and 16 deletions

View File

@@ -58,6 +58,8 @@ ElDialog {
QRImage {
id: qr
render: dialog.enter ? false : true
qrdata: dialog.text_qr ? dialog.text_qr : dialog.text
Layout.alignment: Qt.AlignHCenter
Layout.topMargin: constants.paddingSmall
Layout.bottomMargin: constants.paddingSmall
@@ -108,7 +110,13 @@ ElDialog {
}
}
Component.onCompleted: {
qr.qrdata = dialog.text_qr ? dialog.text_qr : dialog.text
Connections {
target: dialog.enter
function onRunningChanged() {
console.log('dialog open animation running changed: ' + dialog.enter.running)
if (!dialog.enter.running) {
qr.render = true
}
}
}
}