Hi everybody

I'm writing a video player right now and I need a slider like in media player classic. I've was frustrated when I found that Qt does not have a way to go to the certain value on click. So I've tried to do it by subclassing QSlider like this:
Qt Code:
  1. void QProgressSlider::mouseReleaseEvent(QMouseEvent* event)
  2. {
  3. event->ignore();
  4. double k = ((double)event->x())/((double)width());
  5. int a = k*(maximum());
  6. setValue(a);
  7. }
To copy to clipboard, switch view to plain text mode 
This is close but some times the handle misses the cursor. I've also tried to use
int QSliderPrivate:: pixelPosToRangeValue(int pos) function but the results are the same.

Any suggestions ?