Slider position update
-
Hi. I'm gonna to create a mp3 player with Qt library, I already familiar with object-oriented language and the Qt library, but I have a question: in my player I created a slider to see the progress of the songs. Is there a way to update the slider while playing the audio file?
-
welcome to the forum. You can use the sliders setValue function to update the slider position and use positionChanged Signal ?
-
@dheerendra Very well. Last question: is there a way to fast forward or rewind a song by clicking on the slider? Beacause now, when I click on the slider the thumbtrack takes only small steps, he does not position where I click.
-
Can you try using the setPosition in MediaPlayer with Slider sliderReleased signal and value() methods ?
-
[SOLVED]
To make thumb slider jump directly at mouse click, use this subclass:
header file: https://nopaste.me/view/c38f6570
source file: https://nopaste.me/view/ee7b9450EDIT: line 4 in .cpp file is useless, you can delete this