Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def setPos(self, pos):
- print('from %s to %s' % (self.scenePos(), pos))
- timer = QTimeLine(5000)
- timer.setFrameRange(0, 100)
- animation = QGraphicsItemAnimation()
- animation.setItem(self)
- animation.setTimeLine(timer)
- x_step = (pos - self.scenePos()).x() / 200
- y_step = (pos - self.scenePos()).y() / 200
- for i in range(200):
- animation.setPosAt(i/200, self.scenePos() + QPointF(i * x_step, i * y_step))
- timer.start()
- QPropertyAnimation * animationPos = new QPropertyAnimation(Object, propertyName);
- animationPos->setDuration(miliseconds);
- animationPos->setStarValue(startValueForProperty);
- animationsPos->setEndValue(endValueForProperty);
Add Comment
Please, Sign In to add comment