本文整理汇总了C++中QGraphicsItemAnimation::translationList方法的典型用法代码示例。如果您正苦于以下问题:C++ QGraphicsItemAnimation::translationList方法的具体用法?C++ QGraphicsItemAnimation::translationList怎么用?C++ QGraphicsItemAnimation::translationList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QGraphicsItemAnimation
的用法示例。
在下文中一共展示了QGraphicsItemAnimation::translationList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkReturnedLists
void tst_QGraphicsItemAnimation::checkReturnedLists()
{
QGraphicsItemAnimation animation;
animation.setPosAt(1.0, QPointF(10, -10));
animation.setPosAt(0.5, QPointF(5, -5));
animation.setRotationAt(0.3, 2.3);
animation.setTranslationAt(0.3, 15, 15);
animation.setScaleAt(0.3, 2.5, 1.8);
animation.setShearAt(0.3, 5, 5);
QCOMPARE(animation.posList().at(0), (QPair<qreal, QPointF>(0.5, QPointF(5, -5))));
QCOMPARE(animation.posList().at(1), (QPair<qreal, QPointF>(1.0, QPointF(10, -10))));
QCOMPARE(animation.rotationList().at(0), (QPair<qreal, qreal>(0.3, 2.3)));
QCOMPARE(animation.translationList().at(0), (QPair<qreal, QPointF>(0.3, QPointF(15, 15))));
QCOMPARE(animation.scaleList().at(0), (QPair<qreal, QPointF>(0.3, QPointF(2.5, 1.8))));
QCOMPARE(animation.shearList().at(0), (QPair<qreal, QPointF>(0.3, QPointF(5, 5))));
QCOMPARE(animation.posList().size(), 2);
QCOMPARE(animation.rotationList().size(), 1);
QCOMPARE(animation.translationList().size(), 1);
QCOMPARE(animation.scaleList().size(), 1);
QCOMPARE(animation.shearList().size(), 1);
}
示例2: overwriteValueForStep
void tst_QGraphicsItemAnimation::overwriteValueForStep()
{
QGraphicsItemAnimation animation;
for (int i=0; i<3; i++){
animation.setPosAt(0.3, QPointF(3, -3.1));
animation.setRotationAt(0.3, 2.3);
animation.setTranslationAt(0.3, 15, 15);
animation.setScaleAt(0.3, 2.5, 1.8);
animation.setShearAt(0.3, 5, 5);
QCOMPARE(animation.posList().size(), 1);
QCOMPARE(animation.rotationList().size(), 1);
QCOMPARE(animation.translationList().size(), 1);
QCOMPARE(animation.scaleList().size(), 1);
QCOMPARE(animation.shearList().size(), 1);
}
}