Hello there,

I would like to create a little widget that all of you should know from YouTube. Underneath the movie player you can see a progress bar that indicates how far the movies is loaded. At the same time you can also use this widget as a slider to navigate in the timeline of the movie. How can I accomplish this in Qt?

The one idea I have is to place a QSlider on top of a QProgressBar and make the background transparent. This could probably work, but I don't see how it's possible to configure this to my favorite look of this kind of widget: a pale red progress indicator in the background and a bright red "slider" in the foreground, that you can click and drag. At least so far I didn't find the right style sheet syntax to color the two halves of a QSlider in different ways.

Other than that, what's left? Starting from a QWidget and implementing all the drawing and mouse handling myself? There must be a better way.

It would be great to abuse a QProgessBar as a slider, but unfortunately it doesn't offer a nice interface to report clicks and value changes, like the QSlider does. Maybe I should subclass a QProgressBar and add the gore details for the mouse handling so that at least I can reuse the painting. Any thoughts?


Thanks
Cruz