Only properties in the root item of a component are accessible, so you need to 
expose mainAnimation via an alias, for example:

Rectangle {
    id: redRect
    property alias animation: mainAnimation
SequentialAnimation {
       id: mainAnimation
}
}

Martin.
________________________________________
From: [email protected] [[email protected]] On Behalf Of 
ext Jason H [[email protected]]
Sent: Saturday, 25 September 2010 12:01 PM
To: Jason H; Brasser Michael (Nokia-MS-Qt/Brisbane)
Cc: [email protected]
Subject: Re: [Qt-qml] Animation events

I still can't solve this. There seems to be no AnimationFinished event? Or
AnimationCompleted. I could do this with a ScriptAction at the end of a serial,
but there is no way to emit events!

What can I do?



----- Original Message ----
From: Jason H <[email protected]>
To: [email protected]
Cc: [email protected]
Sent: Fri, September 24, 2010 8:13:58 AM
Subject: Re: [Qt-qml] Animation events

Thanks Michael.

I can't seem to find my animation.

the A.qml is:
Rectangle {
    id: redRect
SequentialAnimation {
       id: mainAnimation
}
}


When I specify the target, I get
"Unable to assign [undefined] to QObject*
target" and
"QML Connections: Cannot assign to non-existent property
"onAnimationFinished"

I've tried various targets.

----- Original Message ----
From: "[email protected]" <[email protected]>
To: [email protected]
Cc: [email protected]
Sent: Fri, September 24, 2010 1:56:10 AM
Subject: Re: [Qt-qml] Animation events

On 24/09/2010, at 11:47 AM, ext Jason H wrote:
> I know I've asked something like this before, but I've never gotten anything 
> to
>
>
>
>
> work like I wanted. Plus it's mutated over time.
> I have a collection of components. I will start an animation in the first
> component. When the animation completes, I want it to consult an external
>source
>
>
> (database, web URL, etc) to decide what component to run next, then run its
> animation. And so on.
>
> But I don't want one component calling the next because the call stack would
> just keep increasing, I want a root element doing it
>
> all.
> //main.qml
> Rectangle{
>    id: root
>    width: 860
>    height: 540
>    Loader { source: "A.qml" }
>    Loader { source: "B.qml" }
>    function pickNext()
>    {
>        // pick nect
>    }
> }
> but the animation finishes and has no way (that I found) for the
> animation in A.qml to inform the root element that it is time to pick the
> next one.
> the Loader does not set the parent property of the loaded qml item.
>
> If this were C++ I'd have the A.qml emit a signal, which would be caught by
> root.

Hi,

You should be able to use the Connections element to respond to signals emitted
by a Loader's item:

//main.qml
Rectangle{
   id: root
   width: 860
   height: 540
   Loader { id: loader1; source: "A.qml" }
   Loader { id: loader2; source: "B.qml" }
   Connections {
      target: loader1.item
      onAnimationFinished: pickNext()
   }
   function pickNext()
   {
       // pick nect
   }
}

Regards,
Michael



_______________________________________________
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

_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to