0
QGraphicsBubbleItem::QGraphicsBubbleItem(qreal x, qreal y, qreal width, qreal height, QGraphicsItem *parentItem)
: QGraphicsEllipseItem(x, y, width, height, parentItem)
{
timer = new QTimeLine(3000);
timer->setFrameRange(0, 100);
//timer->setLoopCount(3);
connect(timer, &QTimeLine::finished, timer, &QTimeLine::start);
animation = new QGraphicsItemAnimation;
animation->setItem(this);
animation->setTimeLine(timer);
animation->setTranslationAt(0, (width/2)*(-1), (height/2)*(-1));
animation->setRotationAt(0.5, 180);
animation->setRotationAt(1, 360);
timer->start();
}
Для анимации существует больше, но я упростил код до бит, который показывает проблему. Элемент рисуется и вращается как следует, но он останавливается на видимый момент после каждого цикла.QGraphicsItemAnimation приостанавливается после каждого цикла QTimeLine
спасибо, я не знаю, как я мог пропустить это в документах ... – smsware