I want to connect the QProgressBar to the QMediaPlayer for Song Progress in QT5. How can i do that? Any help will be appreciated. Thanks.
Asked
Active
Viewed 373 times
0
-
1What have you tried? Post your code. – Tomáš Hübelbauer Sep 28 '17 at 17:51
1 Answers
1
Connect the QProgressBar to QMediaPlayer like this:
connect(player, durationChanged(qint64), progressBar, setMaximum(int));
connect(player, positionChanged(qint64), progressBar, setValue(int));
You can also create a slot to normalize int64 to int.
See: http://doc.qt.io/qt-5/qtwinextras-musicplayer-example.html

rflobao
- 562
- 2
- 8