setFrameRange メソッド (QTimeLine クラスの一部) の使用は何ですか? 私はこの例を見つけました:
QGraphicsItem *ball = new QGraphicsEllipseItem(0, 0, 20, 20);
QTimeLine *timer = new QTimeLine(5000);
timer->setFrameRange(0, 100);
QGraphicsItemAnimation *animation = new QGraphicsItemAnimation;
animation->setItem(ball);
animation->setTimeLine(timer);
for (int i = 0; i < 200; ++i)
animation->setPosAt(i / 200.0, QPointF(i, i));
QGraphicsScene *scene = new QGraphicsScene();
scene->setSceneRect(0, 0, 250, 250);
scene->addItem(ball);
QGraphicsView *view = new QGraphicsView(scene);
view->show();
timer->start();
明らかにすべてがうまく機能しているように見えますが、このパラメーターを変更しても何も変わらないことに気付きました。私はこのようにsthを書こうとしました:
- timer->setFrameRange(100, 100)
- timer->setFrameRage(0,0)
しかし、私が何をしていても、結果は同じです。
すべてを要約すると、2 つの質問があります。このメソッドは何をしているのですか (そして、はい、私はドキュメントを読みました)、なぜ変更しても何も変わらないのですか?