Skip to content

Commit 67bae50

Browse files
committed
Fix review comments
1 parent 7fe8045 commit 67bae50

4 files changed

Lines changed: 6 additions & 29 deletions

File tree

examples/QmlBarcodeApp/qml/GeneratorPage.qml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ Item {
99
SBarcodeGenerator {
1010
id: barcodeGenerator
1111

12-
onForegroundColorChanged: {
13-
barcodeGenerator.generate(textField.text)
14-
}
15-
16-
onBackgroundColorChanged: {
17-
barcodeGenerator.generate(textField.text)
18-
}
19-
2012
onGenerationFinished: function (error) {
2113
resultStack.currentIndex = 1
2214
if (error === "") {
@@ -227,7 +219,8 @@ Item {
227219
onClicked: {
228220
if (barcodeGenerator.saveImage()) {
229221
messagePopup.showMessage(
230-
qsTr("File successfully saved"))
222+
qsTr("File successfully saved: "
223+
+ barcodeGenerator.filePath))
231224
} else {
232225
messagePopup.showMessage(
233226
qsTr("There was an error while saving file"))

examples/QmlBarcodeApp/qml/Qt5ScannerPage.qml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@ import com.somcosoftware.scodes 1.0
88
Item {
99
id: root
1010

11-
property bool enableCamera: false
12-
13-
onEnableCameraChanged: {
14-
if (enableCamera)
15-
camera.start()
16-
else
17-
camera.stop()
18-
}
19-
2011
Camera {
2112
id: camera
2213

@@ -99,6 +90,8 @@ Item {
9990
family: Theme.fontFamily
10091
pixelSize: 14
10192
}
93+
horizontalAlignment: Text.AlignHCenter
94+
verticalAlignment: Text.AlignVCenter
10295

10396
text: barcodeScanner.captured
10497
}

examples/QmlBarcodeApp/qml/Qt6ScannerPage.qml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ import com.somcosoftware.scodes 1.0
77
Item {
88
id: root
99

10-
property bool enableCamera: false
11-
12-
onEnableCameraChanged: {
13-
barcodeScanner.camera.active = enableCamera
14-
}
15-
1610
SBarcodeScanner {
1711
id: barcodeScanner
1812

@@ -74,6 +68,8 @@ Item {
7468
family: Theme.fontFamily
7569
pixelSize: 14
7670
}
71+
horizontalAlignment: Text.AlignHCenter
72+
verticalAlignment: Text.AlignVCenter
7773
}
7874

7975
CButton {

examples/QmlBarcodeApp/qml/main.qml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ ApplicationWindow {
8282

8383
Loader {
8484
source: VersionHelper.isQt6 ? "Qt6ScannerPage.qml" : "Qt5ScannerPage.qml"
85-
onLoaded: {
86-
item.enableCamera = Qt.binding(function () {
87-
return stackLayout.currentIndex == 0
88-
})
89-
}
9085
}
9186

9287
Loader {

0 commit comments

Comments
 (0)