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


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

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


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

示例1: QGLView

CubeView::CubeView(QWidget *parent)
    : QGLView(parent)
    , fbo(0)
    , tangle(0.0f)
    , cangle(0.0f)
    , oangle(0.0f)
    , needsUpdate(true)
{
    innerCamera = new QGLCamera(this);

    QPropertyAnimation *animation;

    animation = new QPropertyAnimation(this, "teapotAngle", this);
    animation->setStartValue(0.0f);
    animation->setEndValue(360.0f);
    animation->setDuration(1000);
    animation->setLoopCount(-1);
    animation->start();

    animation = new QPropertyAnimation(this, "cubeAngle", this);
    animation->setStartValue(0.0f);
    animation->setEndValue(360.0f);
    animation->setDuration(5000);
    animation->setLoopCount(-1);
    animation->start();

    animation = new QPropertyAnimation(this, "orbitAngle", this);
    animation->setStartValue(0.0f);
    animation->setEndValue(360.0f);
    animation->setDuration(5000);
    animation->setLoopCount(-1);
    animation->start();
}
开发者ID:slavablind91,项目名称:code,代码行数:33,代码来源:cubeview.cpp

示例2: showActiveWithAnimation

void ActiveLabel::showActiveWithAnimation()
{
    if (m_loopCount != 0)
        return;
    m_loopCount = 0;
    setFixedSize(28, 13);
    emit sizeChange();
    setVisible(true);
    m_iconPath = m_openingIndicatorIcon;
    QPropertyAnimation *animation = new QPropertyAnimation(this, "opacity");
    animation->setDuration(500);
    animation->setStartValue(0);
    animation->setEndValue(1);
    animation->start();
    connect(animation, &QPropertyAnimation::finished, [=]{
        ++ m_loopCount;
        if (m_loopCount == 4){
            m_loopCount = 0;
            emit showAnimationFinish();
        }
        else{
            if (m_loopCount % 2 == 0){
                animation->setStartValue(0);
                animation->setEndValue(1);
                animation->start();
            }
            else{
                animation->setStartValue(1);
                animation->setEndValue(0);
                animation->start();
            }
        }
    });

}
开发者ID:tsuibin,项目名称:dde-dock,代码行数:35,代码来源:appbackground.cpp

示例3: showBlock

void HideBlock::showBlock()
{
    if(block->isVisible())
    {
        btnTitle->setIcon(QIcon(":/img/down.png"));

        QPropertyAnimation *animation = new QPropertyAnimation(block,"maximumHeight");
        animation->setDuration(350);
        animation->setEasingCurve(QEasingCurve::OutCirc);
        animation->setStartValue(blockHeight);
        animation->setEndValue(0);
        animation->start();

        connect(animation,SIGNAL(finished()),block,SLOT(hide()));
    }
    else
    {
        block->show();
        btnTitle->setIcon(QIcon(":/img/up.png"));

        QPropertyAnimation *animation = new QPropertyAnimation(block,"maximumHeight");
        animation->setDuration(500);
        animation->setEasingCurve(QEasingCurve::InCirc);
        animation->setStartValue(0);
        animation->setEndValue(blockHeight+10000);
        animation->start();
    }
}
开发者ID:gustawho,项目名称:dooscape,代码行数:28,代码来源:scapeui.cpp

示例4: QPropertyAnimation

void
StatsGauge::setValue( int v )
{
    if ( maximum() == 0 || v == 0 )
        return;
    if ( v == m_targetValue )
        return;

    m_targetValue = v;
    {
        QPropertyAnimation* a = new QPropertyAnimation( (QProgressBar*)this, "value" );
        a->setEasingCurve( QEasingCurve( QEasingCurve::OutQuad ) );
        a->setStartValue( value() > 0 ? value() : 1 );
        a->setEndValue( v );
        a->setDuration( 2000 );

        connect( a, SIGNAL( finished() ), a, SLOT( deleteLater() ) );
        a->start();
    }
    {
        QPropertyAnimation* a = new QPropertyAnimation( (QProgressBar*)this, "percentage" );
        a->setEasingCurve( QEasingCurve( QEasingCurve::OutQuad ) );
        a->setStartValue( (float)0 );
        a->setEndValue( (float)v / (float)maximum() );
        a->setDuration( 2000 );

        connect( a, SIGNAL( finished() ), a, SLOT( deleteLater() ) );
        a->start();
    }
}
开发者ID:AltarBeastiful,项目名称:tomahawk,代码行数:30,代码来源:StatsGauge.cpp

示例5: articleClicked

void View::articleClicked() {
    Button *btn = dynamic_cast<Button*>(sender());
    if (!btn)
        return;

    QPropertyAnimation *animation = new QPropertyAnimation(btn, "geometry");
    animation->setDuration(750);
    animation->setEasingCurve(QEasingCurve::OutExpo);
    if (btn->isFront()) {
        btn->setZValue(1);
        animation->setStartValue(btn->geometry());
        animation->setEndValue(btn->gridGeometry());
        connect(animation, SIGNAL(finished()), btn, SLOT(setBack()));
        animation->start();
		//_actButton = NULL;
    } else {
        if (_actButton != NULL && _actButton != btn) {
            delete animation;
            return;
        }
        btn->setFront();
        btn->setGridGeometry(btn->geometry());
        animation->setStartValue(btn->geometry());
        unsigned int w = size().width() / 17;
        unsigned int h = (size().height() - _topBar->size().height()) / 15;
        animation->setEndValue(QRectF(w, h + _topBar->size().height(), 15 * w, 13 * h));
        animation->start();
        _actButton = btn;
    }
	btn->setEnabled(false);
    connect(animation, SIGNAL(finished()), animation, SLOT(deleteLater()));
	connect(animation, SIGNAL(finished()), this, SLOT(animationFinished()));
}
开发者ID:Jissay,项目名称:DigitalNews,代码行数:33,代码来源:view.cpp

示例6: animateShow

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

示例7: start

void FadeManager::start(bool deleteWhenFinished)
{
    //TODO : Clean up ressources when finished and add similiar logic to groups
    QPropertyAnimation *anim;
    a_effectContainer = new QGraphicsOpacityEffect(this);
    anim = new QPropertyAnimation(a_effectContainer, "opacity", this);
    a_target->setGraphicsEffect(a_effectContainer);
    anim->setDuration(a_duration);
    setMode(anim, a_mode, a_effectContainer);
    if(deleteWhenFinished)
        anim->start(QAbstractAnimation::DeleteWhenStopped);
    else
        anim->start();
}
开发者ID:Iownnoname,项目名称:qt,代码行数:14,代码来源:fademanager.cpp

示例8: spinTo

void Canvas::spinTo(float new_yaw, float new_pitch)
{
    QPropertyAnimation* a = new QPropertyAnimation(this, "_yaw", this);
    a->setDuration(100);
    a->setStartValue(yaw);
    a->setEndValue(new_yaw);

    QPropertyAnimation* b = new QPropertyAnimation(this, "_pitch", this);
    b->setDuration(100);
    b->setStartValue(pitch);
    b->setEndValue(new_pitch);

    a->start(QPropertyAnimation::DeleteWhenStopped);
    b->start(QPropertyAnimation::DeleteWhenStopped);
}
开发者ID:denji,项目名称:antimony,代码行数:15,代码来源:canvas.cpp

示例9: Open

void RocketStorageInfoDialog::Open()
{
    if (isVisible())
        return;
        
    show();
    setFocus(Qt::ActiveWindowFocusReason);
    activateWindow();

    setWindowOpacity(0.0);

    QPropertyAnimation *showAnim = new QPropertyAnimation(this, "windowOpacity", this);
    showAnim->setStartValue(0.0);
    showAnim->setEndValue(1.0);
    showAnim->setDuration(300);
    showAnim->setEasingCurve(QEasingCurve(QEasingCurve::InOutQuad)); 
    showAnim->start();
    
    plugin_->Notifications()->CenterToMainWindow(this);
    plugin_->Notifications()->DimForeground();
    
    // If input mode is enabled, focus the input field and 
    // select the text so user can start writing.
    if (ui.lineEditInput->isVisible())
    {
        ui.lineEditInput->setFocus(Qt::MouseFocusReason);
        ui.lineEditInput->selectAll();
    }
}
开发者ID:Adminotech,项目名称:meshmoon-plugins,代码行数:29,代码来源:MeshmoonStorageDialogs.cpp

示例10: show

void ContextMenu::show() {

    if(!isHidden()) {
        hide();
        return;
    }
	//qDebug() << "[debug] parent: " << parentWidget()->size();
	//qDebug() << "[debug] pos: " << pos();

	//resize(QSize(parentWidget()->size().width(), 32));
	//move(0, parentWidget()->size().height()-32);

	QPropertyAnimation *animation = new QPropertyAnimation(this, "geometry");
	animation->setDuration(170);
	animation->setStartValue(QRect(0, parentWidget()->size().height(), parentWidget()->size().width(), 0));
	animation->setEndValue(QRect(0, parentWidget()->size().height()-42, parentWidget()->size().width(), 42));

	animation->start();

	QDialog::show();

	calendar->setFocus();
	calendar->setDefault(true);

}
开发者ID:Raven24,项目名称:FCalendar,代码行数:25,代码来源:contextmenu.cpp

示例11: fadeTo

void FadingWidget::fadeTo(qreal value)
{
    QPropertyAnimation *animation = new QPropertyAnimation(m_opacityEffect, "opacity");
    animation->setDuration(200);
    animation->setEndValue(value);
    animation->start(QAbstractAnimation::DeleteWhenStopped);
}
开发者ID:AtlantisCD9,项目名称:Qt,代码行数:7,代码来源:buildstepspage.cpp

示例12: hide

	void hide(QObject *obj)
	{
		QPropertyAnimation *animation = new QPropertyAnimation(obj, "opacity");
		animation->setStartValue(1);
		animation->setEndValue(0);
		animation->start(QAbstractAnimation::DeleteWhenStopped);
	}
开发者ID:codigoda,项目名称:subsurface,代码行数:7,代码来源:animationfunctions.cpp

示例13: on_showHidePushButton_clicked

/**
 * @brief Shows or hides the right menu with an animation
 * according to the value of \ref _rightMenuHidden attribute.
 */
void MainWindow::on_showHidePushButton_clicked()
{
    QPropertyAnimation * animation = new QPropertyAnimation(ui->rightMenuWidget, "maximumWidth");

    animation->setDuration(1000);
    animation->setStartValue(ui->rightMenuWidget->maximumWidth());

    if(!_rightMenuHidden) {
        ui->showHidePushButton->setIcon(QIcon(":/icons/2left"));
        animation->setEndValue(0);
        animation->setEasingCurve(QEasingCurve::InBack);

        _rightMenuHidden = true;
    }
    else {
        animation->setEndValue(314);
        animation->setEasingCurve(QEasingCurve::OutBack);

        ui->showHidePushButton->setIcon(QIcon(":/icons/2right"));

        _rightMenuHidden = false;
    }

    animation->start(QPropertyAnimation::DeleteWhenStopped);
}
开发者ID:bmael,项目名称:DameGame,代码行数:29,代码来源:mainwindow.cpp

示例14: setEmotion

void Photo::setEmotion(const QString &emotion, bool permanent) {
    if (emotion == ".") {
        hideEmotion();
        return;
    }

    QString path = QString("image/system/emotion/%1.png").arg(emotion);
    if (QFile::exists(path)) {
        QPixmap pixmap = QPixmap(path);
        emotion_item->setPixmap(pixmap);
        emotion_item->setPos((G_PHOTO_LAYOUT.m_normalWidth - pixmap.width()) / 2,
                             (G_PHOTO_LAYOUT.m_normalHeight - pixmap.height()) / 2);
        _layBetween(emotion_item, _m_chainIcon, _m_roleComboBox);

        QPropertyAnimation *appear = new QPropertyAnimation(emotion_item, "opacity");
        appear->setStartValue(0.0);
        if (permanent) {
            appear->setEndValue(1.0);
            appear->setDuration(500);
        } else {
            appear->setKeyValueAt(0.25, 1.0);
            appear->setKeyValueAt(0.75, 1.0);
            appear->setEndValue(0.0);
            appear->setDuration(2000);
        }
        appear->start(QAbstractAnimation::DeleteWhenStopped);
    } else {
        PixmapAnimation::GetPixmapAnimation(this, emotion);
    }
}
开发者ID:ArshartCloud,项目名称:QSanguosha-Para,代码行数:30,代码来源:photo.cpp

示例15: QFrame

SelectContacts::SelectContacts(QWidget *parent, QListWidget *list) :
  QFrame(parent),
  ui(new Ui::SelectContacts)
{
  ui->setupUi(this);

  //To hide the edges of the form and standard buttons.
  this->setWindowFlags(Qt::Popup | Qt::Window);
  setWindowOpacity(0);
  show();

  // Setting animation when opening window
  QPropertyAnimation* animation = new QPropertyAnimation(this, "windowOpacity");
  animation->setDuration(500);
  animation->setStartValue(0);
  animation->setEndValue(1);
  animation->start();

  ui->userList->setItemDelegate(new UserListDelegate(ui->userList));

  for (int i = 0; i < list->count(); i++)
    {
      QListWidgetItem *item = new QListWidgetItem();
      item->setData(Qt::DisplayRole, list->item(i)->data(Qt::DisplayRole).toString());
      item->setData(Qt::ToolTipRole, list->item(i)->data(Qt::ToolTipRole).toString());
      item->setData(Qt::UserRole + 1, list->item(i)->data(Qt::UserRole + 1).toString());
      item->setData(Qt::DecorationRole, list->item(i)->data(Qt::DecorationRole));
      ui->userList->addItem(item);
    }
}
开发者ID:MarioCode,项目名称:Chat,代码行数:30,代码来源:selectcontacts.cpp


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