Skip to content

Commit

Permalink
Prevent unwanted mouse cursor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 6, 2017
1 parent 6ab9c22 commit 8517cfe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/gui/layout/qgslayoutmousehandles.cpp
Expand Up @@ -23,6 +23,7 @@
#include "qgslayoutitem.h"
#include "qgslayoututils.h"
#include "qgslayoutview.h"
#include "qgslayoutviewtoolselect.h"
#include <QGraphicsView>
#include <QGraphicsSceneHoverEvent>
#include <QPainter>
Expand Down Expand Up @@ -532,7 +533,7 @@ void QgsLayoutMouseHandles::setViewportCursor( Qt::CursorShape cursor )
//workaround qt bug #3732 by setting cursor for QGraphicsView viewport,
//rather then setting it directly here

if ( true /* TODO !mLayout->preventCursorChange() */ )
if ( dynamic_cast< QgsLayoutViewToolSelect *>( mView->tool() ) )
{
mView->viewport()->setCursor( cursor );
}
Expand Down Expand Up @@ -780,6 +781,11 @@ QSizeF QgsLayoutMouseHandles::calcCursorEdgeOffset( QPointF cursorPos )

case QgsLayoutMouseHandles::ResizeLeftDown:
return QSizeF( sceneMousePos.x(), sceneMousePos.y() - rect().height() );

case MoveItem:
case SelectItem:
case NoAction:
return QSizeF();
}

return QSizeF();
Expand Down

0 comments on commit 8517cfe

Please sign in to comment.