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 }
}
]
↧