当前位置: 首页>>代码示例>>C++>>正文


C++ QSequentialAnimationGroup类代码示例

本文整理汇总了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");
    });
}
开发者ID:kajak4u,项目名称:Pandemic,代码行数:30,代码来源:CMainWindow.cpp

示例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();
}
开发者ID:hanjiabao,项目名称:research,代码行数:32,代码来源:discountpage.cpp

示例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);
		}
	}
开发者ID:westpro4321,项目名称:qt-west-charts,代码行数:29,代码来源:qoc_view_widget.cpp

示例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();
}
开发者ID:ctbrowser,项目名称:luna-sysmgr,代码行数:55,代码来源:DockModeWindow.cpp

示例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);
    }
}
开发者ID:holdzhu,项目名称:AVL-Tree-Visualize,代码行数:13,代码来源:avltree.cpp

示例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);
    }
}
开发者ID:holdzhu,项目名称:AVL-Tree-Visualize,代码行数:15,代码来源:avltree.cpp

示例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()));
}
开发者ID:arcean,项目名称:libmeegotouch-framework,代码行数:15,代码来源:mwidgetslideanimation.cpp

示例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);
}
开发者ID:nicolas-blanc,项目名称:CastleRush,代码行数:48,代码来源:Unite.cpp

示例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);
}
开发者ID:holdzhu,项目名称:AVL-Tree-Visualize,代码行数:16,代码来源:avltree.cpp

示例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()));
开发者ID:buptUnixGuys,项目名称:QSanguosha,代码行数:43,代码来源:sprite.cpp

示例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);
}
开发者ID:Holdlen2DH,项目名称:QSanguosha,代码行数:20,代码来源:indicatoritem.cpp

示例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()));
   }
开发者ID:DimanNe,项目名称:eventmanager,代码行数:20,代码来源:TFutureProgress.cpp

示例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);
}
开发者ID:Distrotech,项目名称:qt3d,代码行数:29,代码来源:tank.cpp

示例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();
}
开发者ID:alexey-zayats,项目名称:athletic,代码行数:24,代码来源:futureprogress.cpp

示例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();
    }
}
开发者ID:SUNJIAWEI,项目名称:torsion,代码行数:24,代码来源:ContactsViewDelegate.cpp


注:本文中的QSequentialAnimationGroup类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。