File tree Expand file tree Collapse file tree
examples/QmlBarcodeApp/qml Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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" ))
Original file line number Diff line number Diff line change @@ -8,15 +8,6 @@ import com.somcosoftware.scodes 1.0
88Item {
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
9990 family: Theme .fontFamily
10091 pixelSize: 14
10192 }
93+ horizontalAlignment: Text .AlignHCenter
94+ verticalAlignment: Text .AlignVCenter
10295
10396 text: barcodeScanner .captured
10497 }
Original file line number Diff line number Diff line change @@ -7,12 +7,6 @@ import com.somcosoftware.scodes 1.0
77Item {
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
7468 family: Theme .fontFamily
7569 pixelSize: 14
7670 }
71+ horizontalAlignment: Text .AlignHCenter
72+ verticalAlignment: Text .AlignVCenter
7773 }
7874
7975 CButton {
Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments