2015-07-16 18:09:44 +00:00
|
|
|
import QtQuick 2.0
|
2017-01-23 17:45:47 +00:00
|
|
|
import QtQuick.Controls 2.0
|
2015-07-16 18:09:44 +00:00
|
|
|
import QZXing 2.3
|
|
|
|
|
2017-01-23 17:45:47 +00:00
|
|
|
ApplicationWindow {
|
|
|
|
visible: true
|
|
|
|
width: 640
|
|
|
|
height: 480
|
2015-07-16 18:09:44 +00: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 17:45:47 +00:00
|
|
|
text: "encode"
|
2015-07-16 18:09:44 +00:00
|
|
|
anchors.margins: 10
|
2016-06-13 23:41:37 +00:00
|
|
|
onClicked: {
|
|
|
|
qzxing.encodeData(inputField.text)
|
|
|
|
inputField.text = '';
|
2016-07-01 22:06:55 +00:00
|
|
|
resultImage.source = "";
|
2016-06-15 22:16:35 +00:00
|
|
|
resultImage.source = "image://QZXing/latestEncoded";
|
2016-06-13 23:41:37 +00:00
|
|
|
}
|
2015-07-16 18:09:44 +00: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-01 22:06:55 +00:00
|
|
|
clip: true
|
2015-10-31 17:14:59 +00:00
|
|
|
|
|
|
|
Image{
|
|
|
|
id:resultImage
|
2016-06-15 22:20:15 +00:00
|
|
|
anchors.centerIn: parent
|
2016-07-01 22:06:55 +00:00
|
|
|
cache: false;
|
2015-10-31 17:14:59 +00:00
|
|
|
}
|
2015-07-16 18:09:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QZXing {
|
|
|
|
id: qzxing
|
|
|
|
}
|
|
|
|
}
|