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


C++ QParallelAnimationGroup::start方法代码示例

本文整理汇总了C++中QParallelAnimationGroup::start方法的典型用法代码示例。如果您正苦于以下问题:C++ QParallelAnimationGroup::start方法的具体用法?C++ QParallelAnimationGroup::start怎么用?C++ QParallelAnimationGroup::start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QParallelAnimationGroup的用法示例。


在下文中一共展示了QParallelAnimationGroup::start方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: animShowLyricWidget

void MainWidget::animShowLyricWidget() {
    if (isLyricWidgetShowing() || isAnimationStarted()) return;
    this->animStart();
    this->setMaximumHeight(this->height() + ui->lyricWidget->height());
    QParallelAnimationGroup *animgroup = new QParallelAnimationGroup(this);
    QPoint lyric_cur = ui->lyricWidget->pos();
    QRect self_cur = this->geometry();

    QPropertyAnimation *lyric_anim = new QPropertyAnimation(ui->lyricWidget, "pos");
    lyric_anim->setDuration(400);
    lyric_anim->setStartValue(lyric_cur);
    lyric_cur.setY(ui->controlWidget->height());
    lyric_anim->setEndValue(lyric_cur);
    lyric_anim->setEasingCurve(QEasingCurve::OutCubic);
    animgroup->addAnimation(lyric_anim);

    QPropertyAnimation *self_anim = new QPropertyAnimation(this, "geometry");
    self_anim->setDuration(400);
    self_anim->setStartValue(self_cur);
    self_cur.setHeight(ui->controlWidget->height() + ui->lyricWidget->height());
    self_anim->setEndValue(self_cur);
    self_anim->setEasingCurve(QEasingCurve::OutCubic);
    animgroup->addAnimation(self_anim);

    connect(animgroup, &QAnimationGroup::finished, [=] () {
        _isLyricWidgetShowing = true;
        animFinish();
        ui->pauseWidget->setGeometry(0, 0, ui->pauseWidget->geometry().width(), this->geometry().height());
        this->setMinimumHeight(this->height());
        ui->lyricWidget->setShowing(true);
    });

    animgroup->start(QAbstractAnimation::DeleteWhenStopped);
}
开发者ID:Argun,项目名称:doubanfm-qt,代码行数:34,代码来源:mainwidget.cpp

示例2: animHideChannelWidget

void mainwidget::animHideChannelWidget(bool immediately) {
    if (!_isChannelWidgetShowing && !immediately) return;

    QParallelAnimationGroup *animgroup = new QParallelAnimationGroup(this);
    QPropertyAnimation *control_anim = new QPropertyAnimation(ui->controlWidget, "pos");
    control_anim->setDuration(400);
    control_anim->setStartValue(ui->controlWidget->pos());
    QPoint endpos = ui->controlWidget->pos();
    endpos.setY(0);
    control_anim->setEndValue(endpos);
    control_anim->setEasingCurve(QEasingCurve::OutCubic);

    animgroup->addAnimation(control_anim);

    QPropertyAnimation *main_anim = new QPropertyAnimation(this, "geometry");
    main_anim->setDuration(400);
    main_anim->setStartValue(this->geometry());
    QRect endval2 = this->geometry();
    endval2.setHeight(ui->controlWidget->geometry().height());
    main_anim->setEndValue(endval2);
    main_anim->setEasingCurve(QEasingCurve::OutCubic);

    animgroup->addAnimation(main_anim);

    connect(animgroup, &QParallelAnimationGroup::finished, [this] () {
        _isChannelWidgetShowing = false;
        QRect pauseGeo = ui->pauseWidget->geometry();
        pauseGeo.setHeight(this->geometry().height());
        ui->pauseWidget->setGeometry(pauseGeo);
        this->setMaximumHeight(pauseGeo.height());
    });
    animgroup->start(QAbstractAnimation::DeleteWhenStopped);
}
开发者ID:lzhitian,项目名称:doubanfm-qt,代码行数:33,代码来源:mainwidget.cpp

示例3: animShowChannelWidget

void mainwidget::animShowChannelWidget() {
    if (_isChannelWidgetShowing) return;

    this->setMaximumHeight(this->controlPanel()->geometry().height()
                           + ui->channelWidget->geometry().height());

    QParallelAnimationGroup *animgroup = new QParallelAnimationGroup(this);
    QPropertyAnimation *control_anim = new QPropertyAnimation(ui->controlWidget, "pos");
    control_anim->setDuration(400);
    control_anim->setStartValue(ui->controlWidget->pos());
    QPoint endpos = ui->controlWidget->pos();
    endpos.setY(ui->channelWidget->geometry().height());
    control_anim->setEndValue(endpos);
    control_anim->setEasingCurve(QEasingCurve::OutCubic);

    animgroup->addAnimation(control_anim);

    QPropertyAnimation *main_anim = new QPropertyAnimation(this, "geometry");
    main_anim->setDuration(400);
    main_anim->setStartValue(this->geometry());
    QRect endval2 = this->geometry();
    endval2.setHeight(endval2.height() + ui->channelWidget->geometry().height());
    main_anim->setEndValue(endval2);
    main_anim->setEasingCurve(QEasingCurve::OutCubic);

    animgroup->addAnimation(main_anim);

    connect(animgroup, &QParallelAnimationGroup::finished, [this] () {
        _isChannelWidgetShowing = true;
        ui->pauseWidget->setGeometry(0, 0, ui->pauseWidget->geometry().width(), this->geometry().height());
    });
    animgroup->start(QAbstractAnimation::DeleteWhenStopped);
}
开发者ID:lzhitian,项目名称:doubanfm-qt,代码行数:33,代码来源:mainwidget.cpp

示例4: goBack

void CardItem::goBack(bool kieru){
    if(home_pos == pos()){
        if(kieru)
            setOpacity(0.0);
        return;
    }

    QPropertyAnimation *goback = new QPropertyAnimation(this, "pos");
    goback->setEndValue(home_pos);   
    goback->setEasingCurve(QEasingCurve::OutBounce);

    if(kieru){
        QParallelAnimationGroup *group = new QParallelAnimationGroup;

        QPropertyAnimation *disappear = new QPropertyAnimation(this, "opacity");
        disappear->setKeyValueAt(0.9, 1.0);
        disappear->setEndValue(0.0);

        goback->setDuration(1000);
        disappear->setDuration(1000);

        group->addAnimation(goback);
        group->addAnimation(disappear);

        group->start(QParallelAnimationGroup::DeleteWhenStopped);
    }else
        goback->start(QPropertyAnimation::DeleteWhenStopped);
}
开发者ID:unowoo,项目名称:QSanguosha,代码行数:28,代码来源:carditem.cpp

示例5: closeAnimation

void AbstractClipItem::closeAnimation()
{
#if QT_VERSION >= 0x040600
    if (!isEnabled()) return;
    setEnabled(false);
    setFlag(QGraphicsItem::ItemIsSelectable, false);
    if (!(KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects)) {
        // animation disabled
        deleteLater();
        return;
    }
    QPropertyAnimation *closeAnimation = new QPropertyAnimation(this, "rect");
    QPropertyAnimation *closeAnimation2 = new QPropertyAnimation(this, "opacity");
    closeAnimation->setDuration(200);
    closeAnimation2->setDuration(200);
    QRectF r = rect();
    QRectF r2 = r;
    r2.setLeft(r.left() + r.width() / 2);
    r2.setTop(r.top() + r.height() / 2);
    r2.setWidth(1);
    r2.setHeight(1);
    closeAnimation->setStartValue(r);
    closeAnimation->setEndValue(r2);
    closeAnimation->setEasingCurve(QEasingCurve::InQuad);
    closeAnimation2->setStartValue(1.0);
    closeAnimation2->setEndValue(0.0);
    QParallelAnimationGroup *group = new QParallelAnimationGroup;
    connect(group, SIGNAL(finished()), this, SLOT(deleteLater()));
    group->addAnimation(closeAnimation);
    group->addAnimation(closeAnimation2);
    group->start(QAbstractAnimation::DeleteWhenStopped);
#endif
}
开发者ID:eddrog,项目名称:kdenlive,代码行数:33,代码来源:abstractclipitem.cpp

示例6: startZoomOutAnimation

    void startZoomOutAnimation()
    {
        if (zoomedIndex < 0)
            return;

        int lm, tm, rm, bm;
        m_public->getContentsMargins(&lm, &tm, &rm, &bm);
        QRect adjustedGeo = m_public->geometry().adjusted(lm, tm, -rm, -bm);
        int spacing = m_public->spacing();

        QSize cellSize = calculateCellSize(adjustedGeo,spacing);
        QParallelAnimationGroup * animGroup = new QParallelAnimationGroup;
        for (int i = 0; i < list.size(); ++i) {
            Wrapper * wr = list.at(i);
            wr->item->widget()->show();
            QPropertyAnimation * anim = new QPropertyAnimation(wr->item->widget(), "geometry");
            anim->setEndValue(
                        calculateCellGeometry(
                            adjustedGeo, cellSize, spacing,
                            wr->row, wr->col, wr->rowSpan,wr->colSpan));
            anim->setDuration(duration);
            anim->setEasingCurve(easing);
            animGroup->addAnimation(anim);
        }
        qApp->connect(animGroup, SIGNAL(finished()), m_public, SIGNAL(animationFinished()));
        animationRunning = true;
        animGroup->start(QAbstractAnimation::DeleteWhenStopped);
        zoomedIndex = -1;
    }
开发者ID:huseyinkozan,项目名称:QAnimatedGridLayout,代码行数:29,代码来源:qanimatedgridlayout.cpp

示例7: _showBarraBusqueda

void MayaModule::_showBarraBusqueda(BarraBusqueda *b)
{
    if(!_b_reducida)
        return;
    b->setGeometry(0,40,0,this->height()-60);
    b->show();
    QPropertyAnimation* animation0 = new QPropertyAnimation(b, "size",this);
    connect(animation0,SIGNAL(finished()),animation0,SLOT(deleteLater()));
    animation0->setDuration(1000);
    animation0->setEasingCurve(QEasingCurve::OutElastic);

    animation0->setStartValue(QSize(0,b->height()));
    animation0->setEndValue(QSize(250,b->height()));

    QPropertyAnimation* animation = new QPropertyAnimation(b, "pos",this);
    animation->setDuration(1000);
    animation->setEasingCurve(QEasingCurve::OutElastic);
    animation->setStartValue(QPoint(this->width(),b->pos().y()));
    animation->setEndValue(QPoint(this->width()-250,b->pos().y()));

    QParallelAnimationGroup *group = new QParallelAnimationGroup(this);
    group->addAnimation(animation);
    group->addAnimation(animation0);

    connect(group,SIGNAL(finished()),group,SLOT(deleteLater()));
    group->start();
     _b_reducida = false;
     b->setShow(true);

}
开发者ID:Ladis72,项目名称:RedFoX,代码行数:30,代码来源:mayamodule.cpp

示例8: _hideBarraBusqueda

void MayaModule::_hideBarraBusqueda(BarraBusqueda *b)
{
    if(_b_reducida)
        return;
    QPropertyAnimation* animation0 = new QPropertyAnimation(b, "size",this);
    connect(animation0,SIGNAL(finished()),animation0,SLOT(deleteLater()));
    animation0->setDuration(300);
    animation0->setEasingCurve(QEasingCurve::Linear);

    animation0->setStartValue(QSize(250,b->height()));
    animation0->setEndValue(QSize(20,b->height()));

    QPropertyAnimation* animation = new QPropertyAnimation(b, "pos",this);
    animation->setDuration(200);
    animation->setEasingCurve(QEasingCurve::Linear);
    animation->setStartValue(QPoint(this->width()-250,b->pos().y()));
    animation->setEndValue(QPoint(this->width()-20,b->pos().y()));

    QParallelAnimationGroup *group = new QParallelAnimationGroup(this);
    group->addAnimation(animation);
    group->addAnimation(animation0);

    connect(group,SIGNAL(finished()),group,SLOT(deleteLater()));
    group->start();
    _b_reducida = true;
    b->setShow(false);
}
开发者ID:Ladis72,项目名称:RedFoX,代码行数:27,代码来源:mayamodule.cpp

示例9: closeAnimation

void AbstractClipItem::closeAnimation()
{
    if (!isEnabled()) return;
    setEnabled(false);
    setFlag(QGraphicsItem::ItemIsSelectable, false);
    if (QApplication::style()->styleHint(QStyle::SH_Widget_Animate, 0, QApplication::activeWindow())) {
        // animation disabled
        deleteLater();
        return;
    }
    QPropertyAnimation *closeAnimation = new QPropertyAnimation(this, "rect");
    QPropertyAnimation *closeAnimation2 = new QPropertyAnimation(this, "opacity");
    closeAnimation->setDuration(200);
    closeAnimation2->setDuration(200);
    QRectF r = rect();
    QRectF r2 = r;
    r2.setLeft(r.left() + r.width() / 2);
    r2.setTop(r.top() + r.height() / 2);
    r2.setWidth(1);
    r2.setHeight(1);
    closeAnimation->setStartValue(r);
    closeAnimation->setEndValue(r2);
    closeAnimation->setEasingCurve(QEasingCurve::InQuad);
    closeAnimation2->setStartValue(1.0);
    closeAnimation2->setEndValue(0.0);
    QParallelAnimationGroup *group = new QParallelAnimationGroup;
    connect(group, SIGNAL(finished()), this, SLOT(deleteLater()));
    group->addAnimation(closeAnimation);
    group->addAnimation(closeAnimation2);
    group->start(QAbstractAnimation::DeleteWhenStopped);
}
开发者ID:jessezwd,项目名称:kdenlive,代码行数:31,代码来源:abstractclipitem.cpp

示例10: QParallelAnimationGroup

void QtMaemo6MenuProxy::hideWindow() {
    const MWidgetFadeAnimationStyle *fadeOutStyle =
        static_cast<const MWidgetFadeAnimationStyle *>(QtMaemo6StylePrivate::mStyle(QStyle::State_Active,
                "MWidgetFadeAnimationStyle", "Out"));

    QRect startGeometry = m_menu->geometry();
    QRect finalGeometry = startGeometry;
    finalGeometry.moveTo(finalGeometry.x(), finalGeometry.y() - finalGeometry.height());

    QParallelAnimationGroup* animationGroup = new QParallelAnimationGroup();
    QPropertyAnimation *widgetFadeOut = new QPropertyAnimation(animationGroup);
    widgetFadeOut->setTargetObject(m_menu);
    widgetFadeOut->setPropertyName("geometry");
    widgetFadeOut->setDuration(fadeOutStyle->duration());
    widgetFadeOut->setEasingCurve(fadeOutStyle->easingCurve());
    widgetFadeOut->setStartValue(startGeometry);
    widgetFadeOut->setEndValue(finalGeometry);

    QPalette startPalette = m_appArea->palette();
    QPalette finalPalette = startPalette;
    startPalette.setBrush(QPalette::Window, QBrush(QColor(0, 0, 0, 0)));

    QPropertyAnimation *backgroundFadeOut = new QPropertyAnimation(animationGroup);
    backgroundFadeOut->setTargetObject(m_appArea);
    backgroundFadeOut->setPropertyName("palette");
    backgroundFadeOut->setDuration(fadeOutStyle->duration());
    backgroundFadeOut->setEasingCurve(fadeOutStyle->easingCurve());
    backgroundFadeOut->setStartValue(startPalette);
    backgroundFadeOut->setEndValue(finalPalette);

    connect(animationGroup, SIGNAL(finished()), this, SLOT(close()));
    animationGroup->start(QAbstractAnimation::DeleteWhenStopped);
}
开发者ID:dudochkin-victor,项目名称:touch-qt-style,代码行数:33,代码来源:qtmaemo6menuproxy.cpp

示例11: animateNextEpisode

void UnseenEpisodeWidget::animateNextEpisode()
{
    _currentWidget->setEnabled(false);
    _nextWidget = _makeWidget();

    if (_nextWidget) {
        layout()->addWidget(_nextWidget);

        _currentWidget->setMinimumWidth(_currentWidget->width());
        _nextWidget->setMinimumWidth(_currentWidget->width());

        QPoint finalPos = _currentWidget->pos();
        int duration = 600;

        QPropertyAnimation *slideOut = new QPropertyAnimation(_currentWidget, "pos", this);
        slideOut->setDuration(duration);
        slideOut->setStartValue(finalPos);
        slideOut->setEndValue(QPoint(finalPos.x() - _currentWidget->width(), finalPos.y()));
        slideOut->setEasingCurve(QEasingCurve::OutQuart);

        QPropertyAnimation *slideIn = new QPropertyAnimation(_nextWidget, "pos", this);
        slideIn->setDuration(duration);
        slideIn->setStartValue(QPoint(finalPos.x() + _currentWidget->width(), finalPos.y()));
        slideIn->setEndValue(finalPos);
        slideIn->setEasingCurve(QEasingCurve::OutQuart);

        QParallelAnimationGroup *group = new QParallelAnimationGroup(_currentWidget);
        group->addAnimation(slideOut);
        group->addAnimation(slideIn);

        group->start(QAbstractAnimation::DeleteWhenStopped);
        group->connect(group, SIGNAL(finished()), this, SLOT(setupNewCurrent()));
    }
}
开发者ID:liomka,项目名称:Pulm,代码行数:34,代码来源:unseenepisodewidget.cpp

示例12: swap_values

void VisualTree::swap_values(VisualTreeElement *e1, VisualTreeElement *e2)
{
    QParallelAnimationGroup * pgr = new QParallelAnimationGroup;

    e1->setColor(Qt::cyan);
    e2->setColor(Qt::cyan);
    QPropertyAnimation *a1= new QPropertyAnimation(e1, "opacity");
    a1->setDuration(1000);
    a1->setStartValue(1);
    a1->setEndValue(0);
    QPropertyAnimation *a2= new QPropertyAnimation(e2, "opacity");
    a2->setDuration(1000);
    a2->setStartValue(1);
    a2->setEndValue(0);

    int tmp;
    tmp = e1->getValue();
    e1->setValue(e2->getValue());
    e2->setValue(tmp);

    pgr->addAnimation(a1);
    pgr->addAnimation(a2);
    pgr->start(QAbstractAnimation::DeleteWhenStopped);

    connect(pgr, SIGNAL(finished()), this, SLOT(animationFinished()));

}
开发者ID:zbetmen1,项目名称:Sipurina,代码行数:27,代码来源:visualtree.cpp

示例13: determined

void HitExplosion::determined(Ts::DetermineValue value)
{
    if (value == Ts::GOOD)
    {
        greatItem_->hide();
        goodItem_->show();
    }
    else if (value == Ts::GREAT)
    {
        goodItem_->hide();
        greatItem_->show();
    }
    else
    {
        return;
    }

    QParallelAnimationGroup *group = new QParallelAnimationGroup;
    QPropertyAnimation *animation = new QPropertyAnimation(this,"opacity");
    animation->setDuration(200);
    animation->setKeyValueAt(0.0,0.0);
    animation->setKeyValueAt(0.1,0.5);
    animation->setKeyValueAt(0.9,0.5);
    animation->setKeyValueAt(1.0,0.0);
    group->addAnimation(animation);

    show();
    group->start(QAbstractAnimation::DeleteWhenStopped);
}
开发者ID:wisaly,项目名称:taikosanro,代码行数:29,代码来源:hitexplosion.cpp

示例14: animateMoveToPos

int LinearLayoutActor::animateMoveToPos(qreal endMainProportion, qreal endCrossProportion, int duration, int initialDelay)
{
	QParallelAnimationGroup* groupAnimation = new QParallelAnimationGroup(this);
	groupAnimation->addAnimation( createMoveToAnimation("mainStart", endMainProportion, mainStart, duration, initialDelay) );
	groupAnimation->addAnimation( createMoveToAnimation("crossStart", endCrossProportion, crossStart, duration, initialDelay) );

	groupAnimation->start();
	return VisualizationSpeed::getInstance().adjust(duration);
}
开发者ID:citic,项目名称:botNeumann,代码行数:9,代码来源:LinearLayoutActor.cpp


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