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


C++ QPropertyAnimation类代码示例

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


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

示例1: sipConvertFromType

static PyObject *meth_QPropertyAnimation_targetObject(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        QPropertyAnimation *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QPropertyAnimation, &sipCpp))
        {
            QObject *sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->targetObject();
            Py_END_ALLOW_THREADS

            return sipConvertFromType(sipRes,sipType_QObject,NULL);
        }
    }
开发者ID:chintaro1981,项目名称:android-python27,代码行数:18,代码来源:sipQtCoreQPropertyAnimation.cpp

示例2: QPropertyAnimation

void MWindow::gameFinished()
{
    for(int i = 9; i < 13; i++){
        CardPile pile = piles[i];
        NodeT<CardLabel*> *node = pile.first();
        for(int j = 0; j < pile.getCount(); j++){
            if(node != 0){
                QPropertyAnimation *animation = new QPropertyAnimation(node->value, "pos");
                 animation->setDuration((13+13)*100 - i*100 - j*100);
                 animation->setStartValue(node->value->pos());
                 animation->setEndValue(QPoint(20, 480));

                 animation->start();
                 node = node->next;
            }
        }
    }
    QMessageBox::information(this, "Felicidades!", "Has completado el juego!! Wiii! ^_^", QMessageBox::Ok);
}
开发者ID:jcespinoza,项目名称:SolitarioTDA,代码行数:19,代码来源:mwindow.cpp

示例3: ZOrderObjectBasedOnPriority

 void EtherMenu::ZOrderObjectBasedOnPriority(int index, int priority, bool animated)
 {
     InfoCard* obj = objects_.at(index);
     if (animated)
     {
         QPropertyAnimation* anim = dynamic_cast<QPropertyAnimation*>(dynamic_cast<QParallelAnimationGroup*>(animations_->animationAt(index))->animationAt(3));
         if (anim)
         {
             anim->stop();
             anim->setStartValue(obj->scale());
             anim->setEndValue(max_visible_objects_- priority);
             anim->start();
         }
     }
     else
     {
         obj->setZValue(max_visible_objects_- priority);
     }
 }
开发者ID:Belsepubi,项目名称:naali,代码行数:19,代码来源:EtherMenu.cpp

示例4: QPointF

void PaneWidget::pressing(const QPointF & pos)
{
    if (width() < 2 || height() < 2)
        return;
    double px = m_range.left() + m_range.width() * pos.x() / (double)(width() - 1);
    double py = m_range.top() + m_range.height() * pos.y() / (double)(height() - 1);
    QPointF endValue = QPointF(qBound(m_range.left(), (qreal)px, m_range.right()), qBound(m_range.top(), (qreal)py, m_range.bottom()));
#if QT_VERSION >= 0x040600
    // animate the change
    QPropertyAnimation * ani = new QPropertyAnimation(this, "value");
    ani->setEasingCurve(QEasingCurve::OutCubic);
    ani->setDuration(500);
    ani->setEndValue(endValue);
    ani->start(QPropertyAnimation::DeleteWhenStopped);
#else
    // set the final value
    setValue(endValue);
#endif
}
开发者ID:AndySardina,项目名称:fotowall,代码行数:19,代码来源:PanePropertyEditor.cpp

示例5: 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

示例6: QDialog

SelectFile::SelectFile(QWidget *parent) :
    QDialog(parent),currentHeight(1),
    ui(new Ui::SelectFile)
{
    ui->setupUi(this);

    setWindowFlags(Qt::FramelessWindowHint);
    QPixmap mask(":/Images/images/ui_selectfile.png");//加载掩码图像
    setMask(QBitmap(mask.mask())); //设置窗体的掩码图像,抠除图像的白色区域实现不规则窗体
    QPalette p;//设置调色板
    p.setBrush(QPalette::Window, QBrush(mask));//将调色板的画刷设置为掩码位图,在不规则窗体上显示出掩码位图
    setPalette(p);

    //添加渐变动画
    QPropertyAnimation *animation = new QPropertyAnimation(this, "windowOpacity"); //动画对象类型:渐变
    animation->setDuration(1000); //维持1秒
    animation->setStartValue(0);  //起始α值
    animation->setEndValue(1);    //结束α值
    animation->start();           //动画开始

    ui->label_5->hide();
    loadMovie=new QMovie(":/Images/images/loading_2.gif");
    ui->label_5->setMovie(loadMovie);

    ui->pushButton_4->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_select_work_normal.png);}"
                                   "QPushButton:hover{border-image: url(:/Images/images/pb_select_work_hover.png);}"
                                     "QPushButton:pressed{border-image: url(:/Images/images/pb_select_work_press.png);}");
    ui->pushButton_5->setStyleSheet("QPushButton{border-image: url(:/Images/images/pb_mainui_close_normal.png);}"
                                    "QPushButton:hover{border-image: url(:/Images/images/pb_mainui_close_hover.png);}"
                                    "QPushButton:pressed{border-image: url(:/Images/images/pb_mainui_close_press.png);}");

    timer_Expand = new QTimer() ;
    timer_Expand->start(5);
    connect(timer_Expand,SIGNAL(timeout()),this,SLOT(showFlash()));

    m_fsw = new QFileSystemWatcher;
    connect(m_fsw, SIGNAL(directoryChanged(QString)), this,SLOT(copyFile(QString)));


    QDir dir;
    root_path = QDir::currentPath() + "//release"; ;
}
开发者ID:ice200117,项目名称:oceanrs,代码行数:42,代码来源:selectfile.cpp

示例7: QPropertyAnimation

//打开主界面
void MinMusicWidget::slot_OpenMainWidget()
{
    if (m_parent->isHidden())
    {
        QPropertyAnimation *mainWidgetAnimation = new QPropertyAnimation(m_parent, "windowOpacity");
        mainWidgetAnimation->setDuration(500);
        mainWidgetAnimation->setStartValue(0);
        mainWidgetAnimation->setEndValue(1);
        mainWidgetAnimation->start();
        m_parent->show();
        emit sig_ShowMusicPanel();

        QPropertyAnimation *minWidgetAnimation = new QPropertyAnimation(this, "windowOpacity");
        minWidgetAnimation->setDuration(500);
        minWidgetAnimation->setStartValue(1);
        minWidgetAnimation->setEndValue(0);
        minWidgetAnimation->start();
        connect(minWidgetAnimation, SIGNAL(finished()), this, SLOT(slot_HideMinWidget()));
    }
}
开发者ID:keygen8-git,项目名称:CZPlayer2.0,代码行数:21,代码来源:minmusicwidget.cpp

示例8: setFlags

void AbstractContent::dispose()
{
    // stick this item
    setFlags((GraphicsItemFlags)0x00);

    // fade out mirror too
    setMirrorEnabled(false);

    // little rotate animation
#if QT_VERSION >= 0x040600
    QPropertyAnimation * ani = new QPropertyAnimation(this, "rotation");
    ani->setEasingCurve(QEasingCurve::InQuad);
    ani->setDuration(300);
    ani->setEndValue(-30.0);
    ani->start(QPropertyAnimation::DeleteWhenStopped);
#endif

    // standard disposition
    AbstractDisposeable::dispose();
}
开发者ID:madjar,项目名称:fotowall,代码行数:20,代码来源:AbstractContent.cpp

示例9: QPropertyAnimation

void IconButton::animateShow(bool visible) {
    if (visible) {
        QPropertyAnimation *animation = new QPropertyAnimation(this, "iconOpacity");
        animation->setDuration(FADE_TIME);
        animation->setEndValue(1.0);
        animation->start(QAbstractAnimation::DeleteWhenStopped);
    } else {
        QPropertyAnimation *animation = new QPropertyAnimation(this, "iconOpacity");
        animation->setDuration(FADE_TIME);
        animation->setEndValue(0.0);
        animation->start(QAbstractAnimation::DeleteWhenStopped);
    }
}
开发者ID:AlexLevkovich,项目名称:FileFinder,代码行数:13,代码来源:fancylineedit.cpp

示例10: it

void KItemListViewAnimation::slotFinished()
{
    QPropertyAnimation* finishedAnim = qobject_cast<QPropertyAnimation*>(sender());
    for (int type = 0; type < AnimationTypeCount; ++type) {
        QMutableHashIterator<QGraphicsWidget*, QPropertyAnimation*> it(m_animation[type]);
        while (it.hasNext()) {
            it.next();
            QPropertyAnimation* propertyAnim = it.value();
            if (propertyAnim == finishedAnim) {
                QGraphicsWidget* widget = it.key();
                it.remove();
                finishedAnim->deleteLater();

                emit finished(widget, static_cast<AnimationType>(type));
                return;
            }
        }
    }
    Q_ASSERT(false);
}
开发者ID:stream009,项目名称:dolphin,代码行数:20,代码来源:kitemlistviewanimation.cpp

示例11: kDebug

/* if the help string is empty, the help widget disappears. */
void TextSelection::showHelp( const QString& help )
{
  mHelpDisplay->setText( help );
  if( help.isEmpty() ) {
    mHelpDisplay->hide();
  } else {
    mHelpDisplay->show();
#if 0
    kDebug() << "Displaying help text: " << help;

    QPropertyAnimation *ani = new QPropertyAnimation( mHelpDisplay, "geometry" );
    QRect r2 = r1;
    r2.setHeight( 200 );
    ani->setDuration( 2000 );
    ani->setStartValue( r1 );
    ani->setEndValue( r2 );
    ani->start();
#endif
  }
}
开发者ID:KDE,项目名称:kraft,代码行数:21,代码来源:textselection.cpp

示例12: stop

void KItemListViewAnimation::stop(QGraphicsWidget* widget, AnimationType type)
{
    QPropertyAnimation* propertyAnim = m_animation[type].value(widget);
    if (propertyAnim) {
        propertyAnim->stop();

        switch (type) {
        case MovingAnimation: break;
        case CreateAnimation: widget->setOpacity(1.0); break;
        case DeleteAnimation: widget->setOpacity(0.0); break;
        case ResizeAnimation: break;
        default: break;
        }

        m_animation[type].remove(widget);
        delete propertyAnim;

        emit finished(widget, type);
    }
}
开发者ID:stream009,项目名称:dolphin,代码行数:20,代码来源:kitemlistviewanimation.cpp

示例13: QPropertyAnimation

QPropertyAnimation* LinearLayoutActor::createMoveToAnimation(const char* propertyName, qreal endProportion, qreal startProportion, int duration, int initialDelay)
{
	// Adjust animation time
	duration = VisualizationSpeed::getInstance().adjust(duration);
	int totalDuration = initialDelay + duration;

	// Create an animation and set its duration
	QPropertyAnimation* animation = new QPropertyAnimation(this, propertyName, this);
	animation->setDuration(totalDuration);

	// Stay at the current proportion at the beginning of the animation
	animation->setKeyValueAt(0.0, startProportion);

	// After the delay is finished, start from the current porportion
	if ( totalDuration > 0 )
		animation->setKeyValueAt(qreal(initialDelay) / totalDuration, startProportion);

	// At the end of the animation, reach the desired end proportion
	animation->setKeyValueAt(1.0, endProportion);
	return animation;
}
开发者ID:citic,项目名称:botNeumann,代码行数:21,代码来源:LinearLayoutActor.cpp

示例14: setVisible

void WSOverlayScreenShotAnimation::start()
{
	if (m_animation) {
		m_animation->stop();
		delete m_animation;
	}

	setVisible(true);	

	int duration = 900;

	QPropertyAnimation* opacityAnimation = new QPropertyAnimation(this, "opacity");
	opacityAnimation->setDuration(duration);
	opacityAnimation->setStartValue(1.0);
	opacityAnimation->setEndValue(0.0);

	m_animation = opacityAnimation;
	m_animation->start(QAbstractAnimation::DeleteWhenStopped);

	connect(m_animation, SIGNAL(finished()), SLOT(finished()));
}
开发者ID:22350,项目名称:luna-sysmgr,代码行数:21,代码来源:WSOverlayScreenShotAnimation.cpp

示例15: QStateMachine

void DockPanel::initShowHideAnimation()
{
    QStateMachine * machine = new QStateMachine(this);

    QState * showState = new QState(machine);
    showState->assignProperty(this,"y", 0);
    QState * hideState = new QState(machine);
    //y should change with DockMode changed
    connect(this, &DockPanel::startHide, [=]{
        hideState->assignProperty(this,"y", m_dockModeData->getDockHeight());
    });
    machine->setInitialState(showState);

    QPropertyAnimation *showAnimation = new QPropertyAnimation(this, "y");
    showAnimation->setDuration(SHOW_ANIMATION_DURATION);
    showAnimation->setEasingCurve(SHOW_EASINGCURVE);
    connect(showAnimation,&QPropertyAnimation::finished,this,&DockPanel::onShowPanelFinished);

    QPropertyAnimation *hideAnimation = new QPropertyAnimation(this, "y");
    hideAnimation->setDuration(HIDE_ANIMATION_DURATION);
    hideAnimation->setEasingCurve(HIDE_EASINGCURVE);
    connect(hideAnimation,&QPropertyAnimation::finished,this,&DockPanel::onHidePanelFinished);

    QSignalTransition *st = showState->addTransition(this,SIGNAL(startHide()), hideState);
    st->addAnimation(hideAnimation);
    QSignalTransition *ht = hideState->addTransition(this,SIGNAL(startShow()),showState);
    ht->addAnimation(showAnimation);

    machine->start();
}
开发者ID:tsuibin,项目名称:dde-dock,代码行数:30,代码来源:dockpanel.cpp


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