[Interest] Custom QtQuick Animator API?

Gunnar Sletta gunnar at sletta.org
Mon Jan 26 15:39:34 CET 2015


> On 26 Jan 2015, at 10:04, Ola Røer Thorsen <ola at silentwings.no> wrote:
> 
> Hi Gunnar, thanks for the reply.
> 
> 
> 2015-01-25 16:42 GMT+01:00 Gunnar Sletta <gunnar at sletta.org <mailto:gunnar at sletta.org>>:
> 
> 
> No such plan, no :)
> 
> Doing custom animations on your nodes is easy using the QSGNode API though. For instance, like it is done in the “threadedanimation” example: https://qt.gitorious.org/qt/qtdeclarative/source/817cd03a5f437c9e8862646cca5ea016b1223bc7:examples/quick/scenegraph/threadedanimation <https://qt.gitorious.org/qt/qtdeclarative/source/817cd03a5f437c9e8862646cca5ea016b1223bc7:examples/quick/scenegraph/threadedanimation>
> 
> 
> I use the QSGNode API already. But this only works for nodes I instantiate myself, right?

This is correct, you are limited to animation inside the subtree you returned from updatePaintNode().

cheers,
Gunnar

> 
> I'm looking for a way to manipulate a transform node so that any child item instantiated in QML will be affected.
> 
> MyAnimatedNode {
>    Text {
>       ...
>    }
>    Image {
>       ...
>    }
> }
> 
> If MyAnimatedNode was a spinner like in the "threadedanimation" example, the text and image would not spin along.
> 
> I did find a way though, but it does abuse the API. I can use QSGNode::parent to find the parent transform node (the "itemNode"?) of a dummy node I create. I can then manipulate the itemNode's transform similar to what the animator classes do. Not that I'll ship anything actually doing that.
> 
> Cheers,
> Ola
> 
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150126/72f0d6fc/attachment.html>


More information about the Interest mailing list