本文整理汇总了C++中QTimeLine::setEasingCurve方法的典型用法代码示例。如果您正苦于以下问题:C++ QTimeLine::setEasingCurve方法的具体用法?C++ QTimeLine::setEasingCurve怎么用?C++ QTimeLine::setEasingCurve使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTimeLine
的用法示例。
在下文中一共展示了QTimeLine::setEasingCurve方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setTransformationAnchor
PhotoKitView::PhotoKitView(QWidget *parent) :
QGraphicsView(parent),mPressed(false),mMachine(0),mCanTransform(true),mZoomOnMove(false)
{
//setDragMode(QGraphicsView::NoDrag);
//setAlignment(Qt::AlignBottom);
//setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
setTransformationAnchor(QGraphicsView::AnchorViewCenter);
setResizeAnchor(QGraphicsView::AnchorUnderMouse);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); //TODO: always on when debug.
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
//setBackgroundBrush(QBrush(Qt::gray));
mScene = new PhotoKitScene(this);
setRenderingSystem();
mScene->setSceneRect(qApp->desktop()->rect());
setScene(mScene);
mMachine = new TransformMachine;//QGraphicsItemAnimation;
connect(mMachine, SIGNAL(transformChanged(QTransform)), SLOT(doTransform(QTransform)));
QTimeLine *timer = new QTimeLine(kAniDuration);
timer->setEasingCurve(QEasingCurve::OutQuad);
timer->setFrameRange(0, 100);
mMachine->setTimeLine(timer);
}
示例2: newAnim
QTimeLine* newAnim(Line* ball, int in, int to, QEasingCurve curve)
{
QTimeLine *NewTimer = new QTimeLine(speed);
NewTimer->setEasingCurve(curve);
QGraphicsItemAnimation* anim = new QGraphicsItemAnimation();
anim->setItem(ball);
anim->setTimeLine(NewTimer);
anim->setRotationAt(0, in);
anim->setRotationAt(1, to);
return NewTimer;
}
示例3: QTimeLine
ItemAnimation::ItemAnimation(QGraphicsItem *item, QObject *parent) :
QObject(parent),mHide(false),mFade(None)
{
mMachine = new TransformMachine;//QGraphicsItemAnimation;
QTimeLine *timer = new QTimeLine(1000);
timer->setEasingCurve(QEasingCurve::OutQuad);
timer->setFrameRange(0, 100);
mMachine->setTimeLine(timer);
connect(mMachine, SIGNAL(transformChanged(QTransform)), this, SLOT(setTransform(QTransform)));
connect(mMachine, SIGNAL(zValueChanged(qreal)), this, SLOT(setZValue(qreal)));
connect(mMachine, SIGNAL(posChanged(QPointF)), this, SLOT(setItemPos(QPointF)));
connect(mMachine->timeLine(), SIGNAL(finished()), this, SLOT(tryHide()));
connect(mMachine->timeLine(), SIGNAL(finished()), this, SIGNAL(finished()));
setItem(item);
}