2015-07-16 21:09:44 +03:00
|
|
|
import QtQuick 2.0
|
2017-01-23 19:45:47 +02:00
|
|
|
import QtQuick.Controls 2.0
|
2015-07-16 21:09:44 +03:00
|
|
|
import QZXing 2.3
|
|
|
|
|
2017-01-23 19:45:47 +02:00
|
|
|
ApplicationWindow {
|
|
|
|
visible: true
|
|
|
|
width: 640
|
|
|
|
height: 480
|
2015-07-16 21:09:44 +03:00
|
|
|
|
|
|
|
TextField {
|
|
|
|
id: inputField
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: submit.left
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.margins: 10
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
id: submit
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.top: parent.top
|
2017-01-23 19:45:47 +02:00
|
|
|
text: "encode"
|
2015-07-16 21:09:44 +03:00
|
|
|
anchors.margins: 10
|
2016-06-14 02:41:37 +03:00
|
|
|
onClicked: {
|
|
|
|
qzxing.encodeData(inputField.text)
|
|
|
|
inputField.text = '';
|
2016-07-02 01:06:55 +03:00
|
|
|
resultImage.source = "";
|
2016-06-16 01:16:35 +03:00
|
|
|
resultImage.source = "image://QZXing/latestEncoded";
|
2016-06-14 02:41:37 +03:00
|
|
|
}
|
2015-07-16 21:09:44 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
GroupBox {
|
|
|
|
anchors.top: inputField.bottom
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.margins: 10
|
|
|
|
title: "Result barcode image"
|
2016-07-02 01:06:55 +03:00
|
|
|
clip: true
|
2015-10-31 19:14:59 +02:00
|
|
|
|
|
|
|
Image{
|
|
|
|
id:resultImage
|
2016-06-16 01:20:15 +03:00
|
|
|
anchors.centerIn: parent
|
2016-07-02 01:06:55 +03:00
|
|
|
cache: false;
|
2015-10-31 19:14:59 +02:00
|
|
|
}
|
2015-07-16 21:09:44 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
QZXing {
|
|
|
|
id: qzxing
|
|
|
|
}
|
|
|
|
}
|