On 05/08/2010, at 10:02 AM, ext Alex wrote:

> C++ method:
> 
> void Sequencer::addItem(QDeclarativeItem *item)
> {
>    item->setOpacity(1);
> }
> 
> 
> Representative QML, not verbatim:
> 
>    Behavior on opacity {
>        NumberAnimation { to: 1; duration: 1000 }
>    }
> 
> This correctly changes the opacity but fails to run the NumberAnimation.

Behavior relies on being able to intercept changes to properties. Calling 
setOpacity directly in C++ bypasses the property system and thus Behaviors as 
well. If you changed the code to item->setProperty("opacity", 1); the Behavior 
should be correctly triggered.

Regards,
Michael
_______________________________________________
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to