I have the following TextInput
element:
TextInput {
id: textInput
text: m_init
anchors.centerIn: parent
font.family : "Helvetica"
font.pixelSize: 14
color: "black"
maximumLength: 2
smooth: true
inputMask: "HH"
states : [
State {
name: "EmptyInputLeft"
when: !text.length
PropertyChanges {
target: textInput
text : "00"
}
}
]
}
I would like to display 00
when everything has been removed from it by backspace. I've coded a State
for this purpose but it does not work as expected. What am I doing wrong?
Bind the signal length to the handler. Change the following code:
selectAll()
is required here in order to be able to clear the input field from"00"