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();
}
アニメーションにはさらにありますが、問題を示すビットにコードを単純化しました。アイテムは描画され、必要に応じて回転しますが、ループごとに目に見える瞬間に停止します。 QTimeLineが使用するデフォルトではQGraphicsItemAnimationはすべてのQTimeLineループの後に一時停止します
おかげで、私はドキュメントでそれを逃したことができるかわかりません... – smsware