brmbarv3 Receipt: Allow keyboard text entry

This commit is contained in:
Petr Baudis 2012-10-16 22:18:47 +02:00
parent ee90915300
commit c81189889e

View file

@ -7,13 +7,14 @@ Item {
anchors.fill: parent
property variant user
property variant description: ""
property variant amount: ""
property variant description: item_name_pad.enteredText
property variant amount: amount_pad.enteredText
state: "normal"
BarcodeInput {
color: "#00ff00" /* just for debugging */
focus: page.state == "normal"
onAccepted: {
var acct = shop.barcodeInput(text)
text = ""
@ -63,8 +64,9 @@ Item {
x: 65
y: 239
visible: page.state == "description_edit"
onLetterEntered: { page.description = page.description + letter; }
onLetterBackspace: { page.description = page.description.replace(/.$/, ''); }
focus: page.state == "description_edit"
Keys.onReturnPressed: { description_edit.buttonClick() }
Keys.onEscapePressed: { cancel.buttonClick() }
}
Item {
@ -117,8 +119,9 @@ Item {
x: 65
y: 239
visible: page.state == "amount_edit"
onLetterEntered: { amount = amount.toString() + letter }
onLetterBackspace: { amount = amount.toString().replace(/.$/, '') }
focus: page.state == "amount_edit"
Keys.onReturnPressed: { amount_edit.buttonClick() }
Keys.onEscapePressed: { cancel.buttonClick() }
}
BarTextHint {