Cannot assign to non-existent property "states" (solved)
-
Trying to use state in QML.
getting error: cannot assign to non-existent property "states".
Please help@
import QtQuick 2.2
import QtQuick.window 2.1
window {id: myRect visible:true width:350 height:350 color:"red" MouseArea{ anchors.fill:parent onClicked:myRect.state="moved" } states:[ State { name: "moved" PropertyChanges { target:myRect; x:50 y:50 } } ]
@
-
what is "window"?
maybe you should use "Window" ?
QML is case sencetive... -
@maxim.prishchepa Sorry to resurrect this thread after so long, but I believe this should not work even if the Window is spelled correctly. The thing is that I believe you cannot use states with Window object at all (although it is not mentioned anywhere in the documentation, which really drives me nuts, cause I just wasted a lot of time trying to find out). How come the thread is marked as solved even though it has no final answer?