2015-02-26 16:02:22 +00:00
|
|
|
#include "SeekSlider.h"
|
|
|
|
|
2017-05-31 19:35:10 +00:00
|
|
|
void
|
|
|
|
SeekSlider::mousePressEvent (QMouseEvent *event)
|
2015-02-26 16:02:22 +00:00
|
|
|
{
|
2017-05-31 19:35:10 +00:00
|
|
|
if (event->button () == Qt::LeftButton) {
|
|
|
|
if (orientation () == Qt::Vertical)
|
|
|
|
setValue (minimum ()
|
|
|
|
+ ((maximum () - minimum ()) * (height () - event->y ())) / height ());
|
|
|
|
else
|
|
|
|
setValue (minimum ()
|
|
|
|
+ ((maximum () - minimum ()) * event->x ()) / width ());
|
2015-02-26 16:02:22 +00:00
|
|
|
|
2017-05-31 19:35:10 +00:00
|
|
|
event->accept ();
|
|
|
|
}
|
2015-02-26 16:02:22 +00:00
|
|
|
|
2017-05-31 19:35:10 +00:00
|
|
|
QSlider::mousePressEvent (event);
|
|
|
|
}
|
|
|
|
;
|