[Solved] TextInput: font color change when text changes
-
Hello.
There is nothing like
onChange
for theTextInput
but onlyonDisplayDataChanged
what didn't work for me.TextInput { id: text_input1 width: 80 height: 20 text: qsTr("234234") font.pixelSize: 12 inputMethodHints: Qt.ImhFormattedNumbersOnly on???: { text_input1.color = "#333333" }}
And how can I set the same effect for different events, I want to call the same function when on?1 or on?2 or on?3 is called.
something like on?1,on?2,...,.., : { text_input1.color = "#333333" }
but didnt work
Thank you ;)
-
For every property in QML there is signal
on<PropertyName>Changed
. So you needonTextChanged
.For your second question: No. You should write signal handling one by one.
-
Ok, thank you ;)
-
Hi, how did you solve this issue?
-
@task_struct said in [Solved] TextInput: font color change when text changes:
So you need onTextChanged. -
@VRonin I am using TextEdit
TableViewColumn { role: "default" title: qsTr("Default Value") width: 150 delegate: TextEdit { id:defaultValue text: styleData.value } }
When I edit the text, it isn't getting saved. Any idea what i should do?