aboutsummaryrefslogtreecommitdiffstats
path: root/doc/codesnippets/doc/src/snippets/code/src_corelib_tools_qtimeline.cpp
blob: 5b0d16e2e3901816a54fce130a68042fa6cfa29a (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)
timeLine.frameChanged[int].connect(progressBar.setValue)

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