Logo Search packages:      
Sourcecode: qt4-x11 version File versions

src_corelib_tools_qtimeline.cpp

//! [0]
...
progressBar = new QProgressBar(this);
progressBar->setRange(0, 100);

// Construct a 1-second timeline with a frame range of 0 - 100
QTimeLine *timeLine = new QTimeLine(1000, this);
timeLine->setFrameRange(0, 100);
connect(timeLine, SIGNAL(frameChanged(int)), progressBar, SLOT(setValue(int)));

// Clicking the push button will start the progress bar animation
pushButton = new QPushButton(tr("Start animation"), this);
connect(pushButton, SIGNAL(clicked()), timeLine, SLOT(start()));
...
//! [0]

Generated by  Doxygen 1.6.0   Back to index