added qr code scanner for ios

This commit is contained in:
vladimir.kuznetsov 2023-08-13 11:28:32 +05:00
parent c1c68cf72d
commit 14fa0b4fd3
19 changed files with 128 additions and 69 deletions

View file

@ -13,12 +13,10 @@ import "../Components"
PageType {
id: root
//todo move to main?
Connections {
target: InstallController
function onUpdateContainerFinished() {
//todo change to notification
PageController.showNotificationMessage(qsTr("Settings updated successfully"))
}
}

View file

@ -19,7 +19,6 @@ PageType {
target: InstallController
function onUpdateContainerFinished() {
//todo change to notification
PageController.showNotificationMessage(qsTr("Settings updated successfully"))
}
}

View file

@ -13,12 +13,10 @@ import "../Components"
PageType {
id: root
//todo move to main?
Connections {
target: InstallController
function onUpdateContainerFinished() {
//todo change to notification
PageController.showNotificationMessage(qsTr("Settings updated successfully"))
}
}

View file

@ -15,12 +15,10 @@ import "../Components"
PageType {
id: root
//todo move to main?
Connections {
target: InstallController
function onUpdateContainerFinished() {
//todo change to notification
PageController.showNotificationMessage(qsTr("Settings updated successfully"))
}
}

View file

@ -16,12 +16,10 @@ import "../Components"
PageType {
id: root
//todo move to main?
Connections {
target: InstallController
function onUpdateContainerFinished() {
//todo change to notification
PageController.showNotificationMessage(qsTr("Settings updated successfully"))
}
}

View file

@ -55,16 +55,15 @@ PageType {
anchors.topMargin: 32
ListView {
// todo change id naming
id: container
id: protocols
width: parent.width
height: container.contentItem.height
height: protocols.contentItem.height
clip: true
interactive: false
model: ProtocolsModel
delegate: Item {
implicitWidth: container.width
implicitWidth: protocols.width
implicitHeight: delegateContent.implicitHeight
ColumnLayout {

View file

@ -17,6 +17,7 @@ PageType {
target: ImportController
function onQrDecodingFinished() {
closePage()
goToPage(PageEnum.PageSetupWizardViewConfig)
}
}
@ -86,7 +87,7 @@ It's okay if a friend passed the code.")
clickedFunction: function() {
ImportController.startDecodingQr()
// goToPage(PageEnum.PageSetupWizardQrReader)
goToPage(PageEnum.PageSetupWizardQrReader)
}
}

View file

@ -68,7 +68,6 @@ PageType {
}
FlickableType {
id: fl
anchors.fill: parent
contentHeight: content.height
@ -82,7 +81,6 @@ PageType {
spacing: 16
ListView {
// todo change id naming
id: container
width: parent.width
height: container.contentItem.height

View file

@ -233,7 +233,6 @@ PageType {
}
Component.onCompleted: {
//todo move to protocols model?
var defaultContainerProto = ContainerProps.defaultProtocol(dockerContainer)
if (ProtocolProps.defaultPort(defaultContainerProto) < 0) {

View file

@ -14,39 +14,76 @@ import "../Config"
PageType {
id: root
ColumnLayout {
anchors.fill: parent
BackButtonType {
id: backButton
anchors.left: parent.left
anchors.top: parent.top
spacing: 0
anchors.topMargin: 20
}
BackButtonType {
Layout.topMargin: 20
}
ParagraphTextType {
id: header
ParagraphTextType {
Layout.fillWidth: true
property string progressString
text: qsTr("Point the camera at the QR code and hold for a couple of seconds.")
}
anchors.left: parent.left
anchors.top: backButton.bottom
anchors.right: parent.right
ProgressBarType {
anchors.leftMargin: 16
anchors.rightMargin: 16
}
text: qsTr("Point the camera at the QR code and hold for a couple of seconds. ") + progressString
}
Item {
Layout.fillHeight: true
Layout.fillWidth: true
ProgressBarType {
id: progressBar
QRCodeReader {
id: qrCodeReader
Component.onCompleted: {
qrCodeReader.setCameraSize(Qt.rect(parent.x,
parent.y,
parent.width,
parent.height))
qrCodeReader.startReading()
}
}
anchors.left: parent.left
anchors.top: header.bottom
anchors.right: parent.right
anchors.leftMargin: 16
anchors.rightMargin: 16
}
Rectangle {
id: qrCodeRectange
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.top: progressBar.bottom
anchors.topMargin: 34
anchors.leftMargin: 16
anchors.rightMargin: 16
anchors.bottomMargin: 34
color: "transparent"
//radius: 16
QRCodeReader {
id: qrCodeReader
onCodeReaded: function(code) {
ImportController.parseQrCodeChunk(code)
progressBar.value = ImportController.getQrCodeScanProgressBarValue()
header.progressString = ImportController.getQrCodeScanProgressString()
}
Component.onCompleted: {
console.log(qrCodeRectange.x)
console.log(qrCodeRectange.y)
console.log(qrCodeRectange.width)
qrCodeReader.setCameraSize(Qt.rect(qrCodeRectange.x,
qrCodeRectange.y,
qrCodeRectange.width,
qrCodeRectange.height))
qrCodeReader.startReading()
}
Component.onDestruction: qrCodeReader.stopReading()
}
}
}