fix hanging mouse in piano roll (#4822) (#4960)

* fix hanging mouse in piano roll (#4822)

* fix hanging mouse in automation & pianoroll (#4822);

* fix hanging mouse in automation & pianoroll (#4822)

removed TODO comment that I forgot in the code
This commit is contained in:
Ron U
2019-05-06 12:00:37 +03:00
committed by Steffen Baranowsky
parent 9ff882d09d
commit 3dcffbf96f
3 changed files with 12 additions and 6 deletions

View File

@@ -88,6 +88,7 @@ TimeLineWidget::TimeLineWidget( const int xoff, const int yoff, const float ppt,
m_xOffset -= s_posMarkerPixmap->width() / 2;
setMouseTracking(true);
m_pos.m_timeLine = this;
QTimer * updateTimer = new QTimer( this );
@@ -365,6 +366,7 @@ void TimeLineWidget::mousePressEvent( QMouseEvent* event )
void TimeLineWidget::mouseMoveEvent( QMouseEvent* event )
{
parentWidget()->update(); // essential for widgets that this timeline had taken their mouse move event from.
const MidiTime t = m_begin + static_cast<int>( qMax( event->x() - m_xOffset - m_moveXOff, 0 ) * MidiTime::ticksPerTact() / m_ppt );
switch( m_action )

View File

@@ -430,8 +430,8 @@ void AutomationEditor::leaveEvent(QEvent * e )
{
QApplication::restoreOverrideCursor();
}
QWidget::leaveEvent( e );
update();
}
@@ -1510,8 +1510,11 @@ void AutomationEditor::paintEvent(QPaintEvent * pe )
case SELECT: cursor = s_toolSelect; break;
case MOVE: cursor = s_toolMove; break;
}
p.drawPixmap( mapFromGlobal( QCursor::pos() ) + QPoint( 8, 8 ),
*cursor );
QPoint mousePosition = mapFromGlobal( QCursor::pos() );
if( cursor != NULL && mousePosition.y() > TOP_MARGIN + SCROLLBAR_SIZE)
{
p.drawPixmap( mousePosition + QPoint( 8, 8 ), *cursor );
}
}

View File

@@ -1297,6 +1297,7 @@ void PianoRoll::leaveEvent(QEvent * e )
QWidget::leaveEvent( e );
s_textFloat->hide();
update(); // cleaning inner mouse-related graphics
}
@@ -3167,10 +3168,10 @@ void PianoRoll::paintEvent(QPaintEvent * pe )
case ModeSelect: cursor = s_toolSelect; break;
case ModeEditDetuning: cursor = s_toolOpen; break;
}
if( cursor != NULL )
QPoint mousePosition = mapFromGlobal( QCursor::pos() );
if( cursor != NULL && mousePosition.y() > keyAreaTop() && mousePosition.x() > noteEditLeft())
{
p.drawPixmap( mapFromGlobal( QCursor::pos() ) + QPoint( 8, 8 ),
*cursor );
p.drawPixmap( mousePosition + QPoint( 8, 8 ), *cursor );
}
}