Hi,
Hopefully we'll support the syntax you tried in the future, but for now you've
got to do it as a bit of a hack - you have to give the GradientStop's ids and
then modify them individually.
For example, this
Rectangle {
gradient: Gradient {
GradientStop { id: stop1; position: 0.0; color: 'blue' }
GradientStop { id: stop2; position: 1.0; color: 'lightblue' }
}
}
can then be modified by
PropertyChanges { target: stop1; color: 'gray' }
PropertyChanges { target: stop2; color: 'lightgray' }
Cheers,
Aaron
On 10/05/10 5:54 PM, "Kellomaki Pertti (Nokia-D/Tampere)"
<[email protected]> wrote:
Is it possible to change the gradient of an element in PropertyChanges?
I tried making a fancy button with in QML, but when I try to change the
gradient I get the error message
"PropertyChanges does not support creating state-specific objects."
Here's the relevant snippet:
State {
name: 'pressed'
PropertyChanges {
target: self
gradient: Gradient {
GradientStop { position: 0.0; color: 'gray' }
GradientStop { position: 1.0; color: 'lightgray' }
}
}
}
--
Pertti
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-qml
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-qml