aboutsummaryrefslogtreecommitdiffstats
path: root/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qtimeline.cpp
blob: 5f2e97853be45f89e3913536c5b4d3a1fea944c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! [0]
...
progressBar = QProgressBar(self)
progressBar.setRange(0, 100)

# Construct a 1-second timeline with a frame range of 0 - 100
timeLine = QTimeLine(1000, self)
timeLine.setFrameRange(0, 100)
QObject.connect(timeLine, SIGNAL("frameChanged(int)"), progressBar, SLOT("setValue(int)"))

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