Complex animation using QPropertyAnimation in QT 4.7.1

I'm implementing an algorithm that calculates a path for disk robots in the plane and want to visualize the movement of the robots along this path.

A path is a vector of subpaths , where each subpath is a list of pair<QPointF,QPointF> elements. The first QPointF represents the current position of A, and the second of B. The two robots move simultaneously from one pair to the other.

I was able to successfully visualize the movement of the robots within the subpath using QPropertyAnimation for each robot and QtParallelAnimationGroup for the two QPropertyAnimation objects.

The problem is that for every subpath I have to display a certain graph (a set of lines/edges and points) on the screen that stays static throughout the animation of the subpath and changes only when the robots move to the next subpath.

I tried to add the graph to the display every time the QPropertyAnimation finishes the current animation of the subpath but it seems that the animation runs on the same thread as the code so I can't use while (propAnim->state() != QAbstractAnimation::Stopped){} .

Does anyone has suggestions how to overcome this problem?


OK, I figured how to solve it.

For every QtParallelAnimationGroup , responsible for the animation of the subpath, I connected its finish() signal to a method that displays the next graph on the screen.

链接地址: http://www.djcxy.com/p/95566.html

上一篇: 运算符>>在Visual C ++ 2010中工作,但在Linux上不是G ++

下一篇: 在QT 4.7.1中使用QPropertyAnimation的复杂动画