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


C++ QTimeLine::setCurveShape方法代码示例

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


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

示例1: MarblePhysicsPrivate

 MarblePhysicsPrivate( MarbleAbstractPresenter *presenter )
     : m_presenter( presenter ),
       m_mode( Instant ),
       m_planetRadius( EARTH_RADIUS )
 {
     m_timeline.setDuration(2000);
     m_timeline.setCurveShape( QTimeLine::EaseInOutCurve );
 }
开发者ID:calincru,项目名称:marble,代码行数:8,代码来源:MarblePhysics.cpp

示例2: slotAddAnimationItem

void MainWindow::slotAddAnimationItem() //在场景中加入一个动画星星
{
    StartItem *item = new StartItem;
    QGraphicsItemAnimation *anim = new QGraphicsItemAnimation;
    anim->setItem(item);
    QTimeLine *timeLine = new QTimeLine(4000);
    timeLine->setCurveShape(QTimeLine::SineCurve);
    timeLine->setLoopCount(0);

    anim->setTimeLine(timeLine);

    int y =(qrand()%400)-200;
    for(int i=0; i<400; i++)
    {
        anim->setPosAt(i/400.0,QPointF(i-200,y));
    }
    timeLine->start();
    scene->addItem(item);
}
开发者ID:Pengfei-Gao,项目名称:develop-reference-data,代码行数:19,代码来源:mainwindow.cpp

示例3: init

void PinDialog::init( PinFlags flags, const QString &title, TokenData::TokenFlags token )
{
	setMinimumWidth( 350 );
	setWindowModality( Qt::ApplicationModal );

	QLabel *label = new QLabel( this );
	QVBoxLayout *l = new QVBoxLayout( this );
	l->addWidget( label );

	QString _title = title;
	QString text;

	if( token & TokenData::PinFinalTry )
		text += "<font color='red'><b>" + tr("PIN will be locked next failed attempt") + "</b></font><br />";
	else if( token & TokenData::PinCountLow )
		text += "<font color='red'><b>" + tr("PIN has been entered incorrectly one time") + "</b></font><br />";

	text += QString( "<b>%1</b><br />" ).arg( title );
	if( flags & Pin2Type )
	{
		_title = tr("Signing") + " - " + title;
		text += tr("Selected action requires sign certificate.") + "<br />" +
			(flags & PinpadFlag ?
				tr("For using sign certificate enter PIN2 with pinpad") :
				tr("For using sign certificate enter PIN2") );
		regexp.setPattern( "\\d{5,12}" );
	}
	else
	{
		_title = tr("Authendicating") + " - " + title;
		text += tr("Selected action requires auth certificate.") + "<br />" +
			(flags & PinpadFlag ?
				tr("For using auth certificate enter PIN1 with pinpad") :
				tr("For using auth certificate enter PIN1") );
		regexp.setPattern( "\\d{4,12}" );
	}
	setWindowTitle( _title );
	label->setText( text );

	if( flags & PinpadFlag )
	{
		setWindowFlags( (windowFlags() | Qt::CustomizeWindowHint) & ~Qt::WindowCloseButtonHint );
		QProgressBar *progress = new QProgressBar( this );
		progress->setRange( 0, 30 );
		progress->setValue( progress->maximum() );
		progress->setTextVisible( false );
		l->addWidget( progress );
		QTimeLine *statusTimer = new QTimeLine( progress->maximum() * 1000, this );
		statusTimer->setCurveShape( QTimeLine::LinearCurve );
		statusTimer->setFrameRange( progress->maximum(), progress->minimum() );
		connect( statusTimer, SIGNAL(frameChanged(int)), progress, SLOT(setValue(int)) );
		connect( this, SIGNAL(startTimer()), statusTimer, SLOT(start()) );
	}
	else
	{
		m_text = new QLineEdit( this );
		m_text->setEchoMode( QLineEdit::Password );
		m_text->setFocus();
		m_text->setValidator( new QRegExpValidator( regexp, m_text ) );
		connect( m_text, SIGNAL(textEdited(QString)), SLOT(textEdited(QString)) );
		l->addWidget( m_text );

		QDialogButtonBox *buttons = new QDialogButtonBox(
			QDialogButtonBox::Ok|QDialogButtonBox::Cancel, Qt::Horizontal, this );
		ok = buttons->button( QDialogButtonBox::Ok );
		ok->setAutoDefault( true );
		connect( buttons, SIGNAL(accepted()), SLOT(accept()) );
		connect( buttons, SIGNAL(rejected()), SLOT(reject()) );
		l->addWidget( buttons );

		textEdited( QString() );
	}
}
开发者ID:Krabi,项目名称:idkaart_public,代码行数:73,代码来源:PinDialog.cpp

示例4: setup

void KPrPageEffect::setup( const Data &data, QTimeLine &timeLine )
{
    timeLine.setDuration( m_duration );
    m_strategy->setup( data, timeLine );
    timeLine.setCurveShape( QTimeLine::LinearCurve );
}
开发者ID:KDE,项目名称:calligra-history,代码行数:6,代码来源:KPrPageEffect.cpp


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