Hi,
         That was really good suggestion from Pertti , hopeful to see that 
syntax support in future. Thanks Aaron for the hack and for considering.

Please do consider the 'position' changes also.

cheers,
Rakesh

________________________________
From: [email protected] [mailto:[email protected]] On 
Behalf Of [email protected]
Sent: Monday, May 10, 2010 11:00 AM
To: [email protected]; [email protected]
Subject: Re: [Qt-qml] Changing gradient in PropertyChanges

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

Reply via email to