How do I assign an TextInput
to an int, in qml?
int new_span_seconds
TextInput {
id: editor
width: 80
height: 17
color: "white"
font.bold: true; font.pixelSize: 14
text: "21"
horizontalAlignment: TextInput.AlignHCenter
}
Keys.forwardTo: [ (returnKey), (editor)]
Item {
id: returnKey
Keys.onReturnPressed: new_span_seconds = editor. <<< ? >>>
Keys.onEnterPressed: new_span_seconds = editor. <<< ? >>>
}
It's just a piece of Javascript
Keys.onReturnPressed: new_span_seconds = parseInt(editor.text)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With