Cannot assign to non-existent property "color"
-
Could anyone help me please? I'm trying to highlight input field when textinput is in focus.
@ Rectangle {
TextInput {
anchors.centerIn: parent
text:parent.color
parent.color: focus? "#fafafa" : "#eee"
}
}@
If i comment out parent.color it works and shows parent's color as text. However, when I'm trying to change parent's color I get following error message:
Cannot assign to non-existent property "color"
Is it a bug in qt? I'm using qt 5.3 with qtquick 2.2 -
Fixed it with a kind of a hack:
I inserted MouseArea inside TextInput and changed parent.parent.focus to true, than it worked. But I still don't understand why can't I assign color directly. -
Well, not really a fix, since I can't edit textinput this way. My reply was premature.
-
http://stackoverflow.com/questions/16518596/getting-focus-activefocus-status-from-qml-listview
used onActiveFocusChanged: { focusChanged(focus) }
as a workaround, now it works as I intended.