Commit 3f626d9e authored by Ludovic Fauvet's avatar Ludovic Fauvet

Timeline: moving the cursor directly from the ruler works

parent 97bd4ad5
......@@ -152,6 +152,24 @@ void TracksRuler::paintEvent( QPaintEvent* e )
painter.drawPolygon( cursor );
}
void TracksRuler::mousePressEvent( QMouseEvent* event )
{
if ( event->buttons() == Qt::LeftButton &&
event->modifiers() == Qt::NoModifier )
{
m_tracksView->setCursorPos( ( event->x() + offset() ) / m_factor );
}
}
void TracksRuler::mouseMoveEvent( QMouseEvent* event )
{
if ( event->buttons() == Qt::LeftButton &&
event->modifiers() == Qt::NoModifier )
{
m_tracksView->setCursorPos( ( event->x() + offset() ) / m_factor );
}
}
void TracksRuler::moveRuler( int pos )
{
m_offset = pos;
......
......@@ -60,6 +60,8 @@ public slots:
protected:
virtual void paintEvent( QPaintEvent* e );
virtual void mousePressEvent( QMouseEvent* event );
virtual void mouseMoveEvent( QMouseEvent* event );
private:
QString getTimeCode( int frames ) const;
......
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