Skip to content

Commit

Permalink
Use local cursor for TrackContentObjectView (#4918)
Browse files Browse the repository at this point in the history
Fixes crash on cloning patterns on Qt >= 5.12.
  • Loading branch information
https://gitlab.com/users/CYBERDEViLNL authored and PhysSong committed Apr 15, 2019
1 parent 5a56969 commit 5784dd6
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions src/core/Track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,9 @@ void TrackContentObjectView::dropEvent( QDropEvent * de )
*/
void TrackContentObjectView::leaveEvent( QEvent * e )
{
while( QApplication::overrideCursor() != NULL )
if( cursor().shape() != Qt::BitmapCursor )
{
QApplication::restoreOverrideCursor();
setCursor( QCursor( embed::getIconPixmap( "hand" ), 3, 3 ) );
}
if( e != NULL )
{
Expand Down Expand Up @@ -707,8 +707,7 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * me )
if( me->x() < width() - RESIZE_GRIP_WIDTH )
{
m_action = Move;
QCursor c( Qt::SizeAllCursor );
QApplication::setOverrideCursor( c );
setCursor( Qt::SizeAllCursor );
delete m_hint;
m_hint = TextFloat::displayMessage( tr( "Hint" ),
tr( "Press <%1> and drag to make "
Expand All @@ -729,8 +728,7 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * me )
else if( !m_tco->getAutoResize() )
{
m_action = Resize;
QCursor c( Qt::SizeHorCursor );
QApplication::setOverrideCursor( c );
setCursor( Qt::SizeHorCursor );
delete m_hint;
m_hint = TextFloat::displayMessage( tr( "Hint" ),
tr( "Press <%1> for free "
Expand Down Expand Up @@ -932,17 +930,7 @@ void TrackContentObjectView::mouseMoveEvent( QMouseEvent * me )
{
if( me->x() > width() - RESIZE_GRIP_WIDTH && !me->buttons() && !m_tco->getAutoResize() )
{
if( QApplication::overrideCursor() != NULL &&
QApplication::overrideCursor()->shape() !=
Qt::SizeHorCursor )
{
while( QApplication::overrideCursor() != NULL )
{
QApplication::restoreOverrideCursor();
}
}
QCursor c( Qt::SizeHorCursor );
QApplication::setOverrideCursor( c );
setCursor( Qt::SizeHorCursor );
}
else
{
Expand Down

0 comments on commit 5784dd6

Please sign in to comment.