Skip to content
Permalink
Browse files

Show snapped cursor position in status bar

  • Loading branch information
nyalldawson committed Jul 25, 2017
1 parent 3dbc1a0 commit 3aa231e5475a38c593453ea14c228105032d6348
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/gui/layout/qgslayoutview.cpp
@@ -268,9 +268,7 @@ void QgsLayoutView::mouseMoveEvent( QMouseEvent *event )
{
mMouseCurrentXY = event->pos();

//update cursor position in status bar
emit cursorPosChanged( mapToScene( mMouseCurrentXY ) );

QPointF cursorPos = mapToScene( mMouseCurrentXY );
if ( mTool )
{
std::unique_ptr<QgsLayoutViewMouseEvent> me( new QgsLayoutViewMouseEvent( this, event, mTool->flags() & QgsLayoutViewTool::FlagSnaps ) );
@@ -279,6 +277,7 @@ void QgsLayoutView::mouseMoveEvent( QMouseEvent *event )
//draw snapping point indicator
if ( me->isSnapped() )
{
cursorPos = me->snappedPoint();
mSnapMarker->setPos( me->snappedPoint() );
mSnapMarker->setVisible( true );
}
@@ -289,6 +288,9 @@ void QgsLayoutView::mouseMoveEvent( QMouseEvent *event )
event->setAccepted( me->isAccepted() );
}

//update cursor position in status bar
emit cursorPosChanged( cursorPos );

if ( !mTool || !event->isAccepted() )
QGraphicsView::mouseMoveEvent( event );
}

0 comments on commit 3aa231e

Please sign in to comment.
You can’t perform that action at this time.