I am trying to dynamically change a Rectangle gradient, but I’m not sure the syntax. This does not work:
Rectangle{
id:tt
width: height
height: parent.height*1.5
color: "black"
anchors.centerIn: parent
gradient: Gradient {
GradientStop { position: 0.0; color: "lightsteelblue" }
GradientStop {position: 1.0; color: "blue" }
}
MouseArea{
onEntered: {
tt.gradient=Gradient{
GradientStop { position: 0.0; color: "red" }
GradientStop {position: 1.0; color: "yellow" }
}
}
}
This won’t even compile, the onEntered contents are not proper syntax, but I’m not sure how to manipulate the gradient in there.
Any ideas?
↧