Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › action after concurrent animations

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #18345

    Witold Walkiewicz

    Hi! I’m playing (in parallel) multiple animations (each in separated object inheriting EntityBase). I would like to perform some action after all that animations stops. Is there any clever way to do that? I can run a timer with estimated time of longest animation, but it looks like ugly hack to me.

    #18346

    Marcin

    Hi Witold,

    I don’t know any clever way when you can incorporate some Qt magic to do it, can propose something less sophisticated.
    I would suggest to have an object which holds state of every animation and listens to all animation stop signals, or each animation onStopped listener logic can inform that object instead.
    That object would have some bool properties, every time it receives an “info” from animation, that it stopped, it can check if all it’s bool properties are true.
    I assume properties can be like firstAnimatinoStopped: false; secondANimationStopped: false) etc.
    Once, at last, last animation in the order fires “stopped” signal, last object property goes to true what means all animations have stopped.

    There are variations how you can do it from technical point of view, which side sends custom signals or execute which function.
    If you have limited amount of animations just having bool property for each can be enough.
    If it’s more dynamic nature the listener object can have an array of animation states which can be dynamically changed(registered), etc.

    I am not sure how many objects/animations are involved etc so solution depends on your case.

    #18357

    Witold Walkiewicz

    Thanks, Marcin! That’s quite a good idea.

    I think that this way it will be easier just to use simple integer counter… if we know how to ensure atomic operations on it.

    W.

    #18358

    Marcin

    Yes, counter will work just fine as well.

Viewing 4 posts - 1 through 4 (of 4 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded