QStateMachine misses events while transitons are not complete
I am using a QStateMachine to animate things. I use my custom event and use QStateMachine::postEvent to switch between states. While switching the states there are animations which take a while. I post an event to switch to StateA. While the animations are taking place I post another event to switch to StateB. But the second event never gets processed. Whereas if I post the second event after the transitions are complete everything works fine.
How can I tell the QStateMachine to process events in its queue, after the transitions are complete so an event never gets missed?