本文整理汇总了C++中QSequentialAnimationGroup类的典型用法代码示例。如果您正苦于以下问题:C++ QSequentialAnimationGroup类的具体用法?C++ QSequentialAnimationGroup怎么用?C++ QSequentialAnimationGroup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QSequentialAnimationGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setWindowFlags
void CMainWindow::startingAnimation()
{
setWindowFlags(Qt::Window | Qt::FramelessWindowHint); //FramelessWindowHint wymagane do przezroczystego t³a
setAttribute(Qt::WA_TranslucentBackground, true);
QRect screenRect = QApplication::desktop()->screenGeometry();
QSequentialAnimationGroup *group = new QSequentialAnimationGroup(this);
QPropertyAnimation* fadeIn = new QPropertyAnimation(this, "windowOpacity", this);
fadeIn->setDuration(2000);
fadeIn->setStartValue(0.0);
fadeIn->setEndValue(1.0);
group->addAnimation(fadeIn);
QParallelAnimationGroup *moveGroup = new QParallelAnimationGroup(this);
QPropertyAnimation* imageRight = new QPropertyAnimation(pandemicImage, "geometry", this);
imageRight->setStartValue(pandemicImage->geometry());
imageRight->setEndValue(pandemicImage->geometry().translated(screenRect.width() - pandemicImage->geometry().right(), 0));
imageRight->setDuration(1000);
imageRight->setEasingCurve(QEasingCurve::InOutCubic);
moveGroup->addAnimation(imageRight);
QPropertyAnimation* menuLeft = new QPropertyAnimation(menu, "geometry", this);
menuLeft->setStartValue(menu->geometry());
menuLeft->setEndValue(QRect(0,0, screenRect.width()-pandemicImage->width()+1, menu->height()));
menuLeft->setDuration(1000);
menuLeft->setEasingCurve(QEasingCurve::InOutCubic);
moveGroup->addAnimation(menuLeft);
group->addAnimation(moveGroup);
group->start();
connect(group, &QSequentialAnimationGroup::finished, [this]() {
content->setObjectName("body");
});
}
示例2: QState
void DiscountPage::setupItemAnimations()
{
QState *smallState = new QState();
QState *bigState = new QState();
for (int i = 0; i < this->m_itemList.size(); i++) {
smallState->assignProperty(this->m_itemList[i],"scale", 0);
bigState->assignProperty(this->m_itemList[i],"scale",1);
}
QSequentialAnimationGroup *showItemGroup = new QSequentialAnimationGroup(this);
for (int i = 0; i < this->m_itemList.size(); i++) {
QPropertyAnimation *anim = new QPropertyAnimation(this->m_itemList[i], "scale", this);
anim->setDuration(300);
anim->setEasingCurve(QEasingCurve::OutBack);
showItemGroup->addAnimation(anim);
}
QSignalTransition *trans = smallState->addTransition(this, SIGNAL(start()), bigState);
trans->addAnimation(showItemGroup);
connect(showItemGroup,SIGNAL(finished()),this,SLOT(startSelect()));
trans = bigState->addTransition(this,SIGNAL(quitPage()),smallState);
connect(smallState,SIGNAL(entered()),this,SLOT(closeSelect()));
QStateMachine *states = new QStateMachine(this);
states->addState(smallState);
states->addState(bigState);
states->setInitialState(smallState);
states->start();
}
示例3: QSequentialAnimationGroup
void QocViewWidget::rebuildChart()
{
QPushButton *pb = qobject_cast<QPushButton *>(sender());
// QParallelAnimationGroup *group = new QParallelAnimationGroup();
QSequentialAnimationGroup *group = new QSequentialAnimationGroup();
if (pb)
{
pb->setEnabled(false);
connect(group, SIGNAL(finished()), this, SLOT(animationFinished()));
connect(this, SIGNAL(animationEnded(bool)), pb, SLOT(setEnabled(bool)));
}
QList<QocAbstractChartItem *> items = m_chart->items(QocAbstractChart::ChartLayer);
foreach(QocAbstractChartItem *item, items)
{
QocAbstractValueItem *i = qobject_cast<QocAbstractValueItem *>(item);
if ( i )
{
QPropertyAnimation *anim = new QPropertyAnimation(i, "value", group);
anim->setStartValue(0);
anim->setEndValue(i->value());
anim->setDuration(2000/items.size());
group->addAnimation(anim);
// i->blockSignals(true);
i->setValue(0);
// i->blockSignals(false);
}
}
示例4: path
void DockModeWindow::setPrepareAddedToWindowManager() {
m_prepareAddedToWm = true;
if (G_LIKELY(s_dockGlow == 0)) {
QString path(Settings::LunaSettings()->lunaSystemResourcesPath.c_str());
path.append("/dockmode/dock-loading-glow.png");
s_dockGlow = new QPixmap(path);
if(s_dockGlow)
s_dockGlowRefCount++;
if (!s_dockGlow || s_dockGlow->isNull()) {
g_critical("%s: Failed to load image '%s'", __PRETTY_FUNCTION__, qPrintable(path));
}
} else {
s_dockGlowRefCount++;
}
ApplicationDescription* appDesc = static_cast<Window*>(this)->appDescription();
int size = Settings::LunaSettings()->splashIconSize;
m_icon.load(appDesc->splashIconName().c_str());
if (!m_icon.isNull()) {
// scale splash icon to fit the devices screen dimensions
m_icon = m_icon.scaled(size, size, Qt::KeepAspectRatio, Qt::SmoothTransformation);
}
else {
// just use the launcher icon
m_icon = appDesc->getDefaultLaunchPoint()->icon();
int newWidth = qMin((int)(m_icon.width()*1.5), size);
int newHeight = qMin((int)(m_icon.height()*1.5), size);
m_icon = m_icon.scaled(newWidth, newHeight, Qt::KeepAspectRatio, Qt::SmoothTransformation);
}
// set up the pulsing animation
QPropertyAnimation* pulseIn = new QPropertyAnimation(this, "pulseOpacity");
pulseIn->setDuration(AS(cardLoadingPulseDuration));
pulseIn->setEasingCurve(AS_CURVE(cardLoadingPulseCurve));
pulseIn->setEndValue(1.0);
QPropertyAnimation* pulseOut = new QPropertyAnimation(this, "pulseOpacity");
pulseOut->setDuration(AS(cardLoadingPulseDuration));
pulseOut->setEasingCurve(AS_CURVE(cardLoadingPulseCurve));
pulseOut->setEndValue(0.0);
QSequentialAnimationGroup* pulseGroup = new QSequentialAnimationGroup;
pulseGroup->addAnimation(pulseIn);
pulseGroup->addAnimation(pulseOut);
pulseGroup->setLoopCount(-1);
m_pulseAnimation.addPause(AS(cardLoadingTimeBeforeShowingPulsing));
m_pulseAnimation.addAnimation(pulseGroup);
m_loadingOverlayEnabled = true;
m_pulseAnimation.start();
update();
}
示例5: Find
void AVLTree::Find(int x, bool showProgress)
{
if (showProgress)
{
QSequentialAnimationGroup *group = new QSequentialAnimationGroup;
Find(root, x, group);
group->start(QAbstractAnimation::DeleteWhenStopped);
}
else
{
Find(root, x, NULL);
}
}
示例6: Delete
void AVLTree::Delete(int x, bool showProgress)
{
if (showProgress)
{
QSequentialAnimationGroup *group = new QSequentialAnimationGroup;
Delete(root, x, group);
group->start(QAbstractAnimation::DeleteWhenStopped);
}
else
{
Delete(root, x, NULL);
getPosAnim()->start(QAbstractAnimation::DeleteWhenStopped);
getEdgeAnim()->start(QAbstractAnimation::DeleteWhenStopped);
}
}
示例7: Q_Q
void MWidgetSlideAnimationPrivate::init()
{
Q_Q(MWidgetSlideAnimation);
direction = MWidgetSlideAnimation::In;
QSequentialAnimationGroup *delayedAnimation = new QSequentialAnimationGroup;
delay = new QPauseAnimation;
positionAnimation = new QPropertyAnimation;
positionAnimation->setPropertyName("pos");
delayedAnimation->addAnimation(delay);
delayedAnimation->addAnimation(positionAnimation);
q->addAnimation(delayedAnimation);
q->connect(delay, SIGNAL(finished()), SLOT(_q_onDelayFinished()));
}
示例8: QSequentialAnimationGroup
void Unite::animationDeplacement(vector<Case *> chemin ) {
this->setSelected(false);
float decalageX,decalageY;
Case* caseActu=chemin[0];
QSequentialAnimationGroup *group = new QSequentialAnimationGroup();
QSequentialAnimationGroup *animPm = new QSequentialAnimationGroup();
QParallelAnimationGroup *groupPara = new QParallelAnimationGroup();
QPointF OS = offset();
int anim;
int j=1;
for (unsigned int i=1;i<chemin.size(); i++) {
QPropertyAnimation *animation = new QPropertyAnimation(this, "offset");
animation->setDuration(200);
decalageX = (chemin[i]->getX()-caseActu->getX())*SIZE;
decalageY = (chemin[i]->getY()-caseActu->getY())*SIZE;
if (decalageX>0)
anim=30;
else if (decalageX<0)
anim=20;
else if (decalageY<0)
anim=10;
else if (decalageY>0)
anim=0;
QPropertyAnimation *animPix = new QPropertyAnimation(this, "pixmap");
animPix->setDuration(200);
animPix->setStartValue(anim);
animPix->setEndValue(anim+7);
animPm->addAnimation(animPix);
animation->setStartValue(OS);
OS=QPointF(OS.x()+decalageX,OS.y()+decalageY);
animation->setEndValue(OS);
group->addAnimation(animation);
j++;
caseActu=chemin[i];
}
groupPara->addAnimation(group);
groupPara->addAnimation(animPm);
groupPara->start();
this->setSelected(true);
}
示例9: LevelOrder
void AVLTree::LevelOrder()
{
QSequentialAnimationGroup *group = new QSequentialAnimationGroup;
QQueue<TreeNode*> q;
q.push_back(root);
while (!q.empty())
{
TreeNode *node = q.front();
q.pop_front();
if (node == NULL) continue;
group->addAnimation(node->getPopAnim());
q.push_back(node->Lson);
q.push_back(node->Rson);
}
group->start(QAbstractAnimation::DeleteWhenStopped);
}
示例10: i
void Sprite::start(int loops)
{
if(loops<0)loops=0;
QMapIterator<QString, AnimationLine*> i(lines);
QParallelAnimationGroup *pgroup = new QParallelAnimationGroup;
while (i.hasNext()) {
i.next();
AnimationLine * line = i.value();
const QByteArray &name = i.key().toLocal8Bit();
QSequentialAnimationGroup *sgroup = new QSequentialAnimationGroup;
QMapIterator<int,qreal> j(line->frames);
while(j.hasNext())
{
j.next();
QPropertyAnimation *trans = new QPropertyAnimation(this,name);
trans->setStartValue(j.value());
trans->setEasingCurve(line->easings[j.key()]);
if(j.hasNext())
{
trans->setEndValue(j.peekNext().value());
trans->setDuration(j.peekNext().key()-j.key());
}
else
{
trans->setEndValue(j.value());
trans->setDuration(total_time - j.key());
}
sgroup->addAnimation(trans);
}
QPropertyAnimation *trans = new QPropertyAnimation(this,name);
trans->setEndValue(line->frames[0]);
trans->setDuration(resetTime);
sgroup->addAnimation(trans);
pgroup->addAnimation(sgroup);
}
if(--loops)connect(pgroup,SIGNAL(finished()),this,SLOT(start(int)));
else connect(pgroup,SIGNAL(finished()),this,SLOT(deleteLater()));
示例11: QSequentialAnimationGroup
void IndicatorItem::doAnimation() {
QSequentialAnimationGroup *group = new QSequentialAnimationGroup(this);
QPropertyAnimation *animation = new QPropertyAnimation(this, "finish");
animation->setEndValue(real_finish);
animation->setEasingCurve(QEasingCurve::OutCubic);
animation->setDuration(500);
QPropertyAnimation *pause = new QPropertyAnimation(this, "opacity");
pause->setEndValue(0);
pause->setEasingCurve(QEasingCurve::InQuart);
pause->setDuration(600);
group->addAnimation(animation);
group->addAnimation(pause);
group->start(QAbstractAnimation::DeleteWhenStopped);
connect(group, &QSequentialAnimationGroup::finished, this, &IndicatorItem::deleteLater);
}
示例12: Q_Q
void TFutureProgressPrivate::_q_FadeAway()
{
Q_Q(TFutureProgress);
FaderWidget->raise();
QSequentialAnimationGroup *Group = new QSequentialAnimationGroup(q);
QPropertyAnimation *Animation = new QPropertyAnimation(FaderWidget, "Opacity");
Animation->setDuration(600);
Animation->setEndValue(1.0);
Group->addAnimation(Animation);
Animation = new QPropertyAnimation(q, "maximumHeight");
Animation->setDuration(120);
Animation->setEasingCurve(QEasingCurve::InCurve);
Animation->setStartValue(q->sizeHint().height());
Animation->setEndValue(0.0);
Group->addAnimation(Animation);
Group->start(QAbstractAnimation::DeleteWhenStopped);
QObject::connect(Group, SIGNAL(finished()), q, SIGNAL(RemoveMe()));
}
示例13: QGLSceneNode
Tank::Tank(QObject *parent)
: QGLSceneNode(parent)
, m_texture(0)
{
QSequentialAnimationGroup *seq = new QSequentialAnimationGroup(this);
QGraphicsScale3D *scale = new QGraphicsScale3D(this);
addTransform(scale);
QPropertyAnimation *anim = new QPropertyAnimation(scale, "scale");
anim->setDuration(10000);
anim->setStartValue(QVector3D(1.0f, 0.1f, 1.0f));
anim->setEndValue(QVector3D(1.0f, 1.2f, 1.0f));
anim->setEasingCurve(QEasingCurve(QEasingCurve::InOutQuad));
seq->addAnimation(anim);
seq->addPause(2000);
anim = new QPropertyAnimation(scale, "scale");
anim->setDuration(10000);
anim->setStartValue(QVector3D(1.0f, 1.2f, 1.0f));
anim->setEndValue(QVector3D(1.0f, 0.1f, 1.0f));
anim->setEasingCurve(QEasingCurve(QEasingCurve::InOutQuad));
seq->addAnimation(anim);
seq->setLoopCount(-1);
seq->start();
addNode(tankObject());
QGLMaterial *mat = qCreateFluid();
m_texture = mat->texture();
setMaterial(mat);
}
示例14: QSequentialAnimationGroup
void FutureProgressPrivate::fadeAway()
{
m_isFading = true;
QGraphicsOpacityEffect *opacityEffect = new QGraphicsOpacityEffect;
opacityEffect->setOpacity(1.);
m_q->setGraphicsEffect(opacityEffect);
QSequentialAnimationGroup *group = new QSequentialAnimationGroup(this);
QPropertyAnimation *animation = new QPropertyAnimation(opacityEffect, "opacity");
animation->setDuration(StyleHelper::progressFadeAnimationDuration);
animation->setEndValue(0.);
group->addAnimation(animation);
animation = new QPropertyAnimation(m_q, "maximumHeight");
animation->setDuration(120);
animation->setEasingCurve(QEasingCurve::InCurve);
animation->setStartValue(m_q->sizeHint().height());
animation->setEndValue(0.0);
group->addAnimation(animation);
connect(group, &QAbstractAnimation::finished, m_q, &FutureProgress::removeMe);
group->start(QAbstractAnimation::DeleteWhenStopped);
emit m_q->fadeStarted();
}
示例15: QSequentialAnimationGroup
void ContactsViewDelegate::startAlertAnimation()
{
if (!m_alertAnimation)
{
QSequentialAnimationGroup *ag = new QSequentialAnimationGroup(this);
m_alertAnimation = ag;
QPropertyAnimation *aIn = new QPropertyAnimation(this, "alertOpacity");
aIn->setEndValue(qreal(1));
aIn->setEasingCurve(QEasingCurve::OutQuad);
aIn->setDuration(750);
QPropertyAnimation *aOut = new QPropertyAnimation(this, "alertOpacity");
aOut->setEndValue(qreal(0.2));
aOut->setEasingCurve(QEasingCurve::InQuad);
aOut->setDuration(750);
ag->addAnimation(aIn);
ag->addPause(150);
ag->addAnimation(aOut);
ag->setLoopCount(-1);
ag->start();
}
}