Commit 244afdee authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

modules/gui/qt4: Display time in seek bar when mouse-over. (Patch by Antoine...

modules/gui/qt4: Display time in seek bar when mouse-over. (Patch by Antoine Lejeune. Reviewed by jb.)
parent 73830e3b
......@@ -34,6 +34,7 @@ InputSlider::InputSlider( Qt::Orientation q,QWidget *_parent ) :
{
mymove = false;
setMinimum( 0 );
setMouseTracking(true);
setMaximum( 1000 );
setSingleStep( 2 );
setPageStep( 10 );
......@@ -50,6 +51,7 @@ void InputSlider::setPosition( float pos, int a, int b )
mymove = true;
setValue( (int)(pos * 1000.0 ) );
mymove = false;
inputLength = b;
}
void InputSlider::userDrag( int new_value )
......@@ -60,3 +62,11 @@ void InputSlider::userDrag( int new_value )
emit sliderDragged( f_pos );
}
}
void InputSlider::mouseMoveEvent(QMouseEvent *event)
{
char psz_length[MSTRTIME_MAX_SIZE];
secstotimestr( psz_length, (int)((float)event->x()/size().width()*inputLength) );
setToolTip( psz_length );
}
......@@ -33,8 +33,11 @@ public:
InputSlider( QWidget *_parent );
InputSlider( Qt::Orientation q,QWidget *_parent );
virtual ~InputSlider() {};
protected:
void mouseMoveEvent(QMouseEvent *event);
private:
bool mymove;
int inputLength;
public slots:
void setPosition( float, int, int );
private slots:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment