Nominate our 2022 Qt Champions!

Sequence of actions

  • Hello,

    I'm writing a simple game in C++ and Qt 5, I have some objects on a QGraphicsScene that I would like to move into a specific sequence. Like a script of actions. The idea is to write something like this:

    • move(x, y, delay)
    • rotate(angle, delay)
    • wait(some time)
    • move(x, y, delay)

    And obviously all of these call are sequential and nonblocking. I'm thinking of using QPropertyAnimation and QSequentialAnimationGroup but I'm not sure if I'll be able to do everything I need by just manipulating properties.

    Do you have some non blocking patterns to advice in such a case? Perhaps mixing this with states.

Log in to reply