2023-10-26 11:17:22 +02:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
|
2025-07-22 14:18:43 +02:00
|
|
|
import org.electrum
|
|
|
|
|
|
2023-10-26 11:17:22 +02:00
|
|
|
import "controls"
|
|
|
|
|
|
|
|
|
|
// currently not used on android, kept for future use when qt6 camera stops crashing
|
|
|
|
|
ElDialog {
|
|
|
|
|
id: scanDialog
|
|
|
|
|
|
|
|
|
|
property string error
|
|
|
|
|
property string hint
|
|
|
|
|
|
2025-07-22 14:18:43 +02:00
|
|
|
signal foundText(data: string)
|
|
|
|
|
signal foundBinary(data: Bytes)
|
2023-10-26 11:17:22 +02:00
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: parent.height
|
|
|
|
|
padding: 0
|
|
|
|
|
|
|
|
|
|
header: null
|
|
|
|
|
topPadding: 0 // dialog needs topPadding override
|
|
|
|
|
|
|
|
|
|
function doClose() {
|
|
|
|
|
qrscan.stop()
|
|
|
|
|
Qt.callLater(doReject)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
|
|
QRScan {
|
|
|
|
|
id: qrscan
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
hint: scanDialog.hint
|
2025-07-22 14:18:43 +02:00
|
|
|
onFoundText: (data) => {
|
|
|
|
|
scanDialog.foundText(data)
|
2023-10-26 11:17:22 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FlatButton {
|
|
|
|
|
id: button
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
text: qsTr('Cancel')
|
|
|
|
|
icon.source: '../../icons/closebutton.png'
|
|
|
|
|
onClicked: doReject()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|