Skip to content

Commit

Permalink
Merge pull request #7122 from nyalldawson/fix_19065
Browse files Browse the repository at this point in the history
Use a snapping indicator when picking feature to move with move tool
  • Loading branch information
m-kuhn committed May 31, 2018
2 parents 497abfe + de347f0 commit a26b9b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/qgisapp.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2811,6 +2811,9 @@ void QgisApp::createToolBars()
connect( tbAddRegularPolygon, &QToolButton::triggered, this, &QgisApp::toolButtonActionTriggered ); connect( tbAddRegularPolygon, &QToolButton::triggered, this, &QgisApp::toolButtonActionTriggered );
mShapeDigitizeToolBar->insertWidget( mActionVertexTool, tbAddRegularPolygon ); mShapeDigitizeToolBar->insertWidget( mActionVertexTool, tbAddRegularPolygon );


// Cad toolbar
mAdvancedDigitizeToolBar->insertAction( mActionRotateFeature, mAdvancedDigitizingDockWidget->enableAction() );

// move feature tool button // move feature tool button
QToolButton *moveFeatureButton = new QToolButton( mAdvancedDigitizeToolBar ); QToolButton *moveFeatureButton = new QToolButton( mAdvancedDigitizeToolBar );
moveFeatureButton->setPopupMode( QToolButton::MenuButtonPopup ); moveFeatureButton->setPopupMode( QToolButton::MenuButtonPopup );
Expand All @@ -2828,7 +2831,7 @@ void QgisApp::createToolBars()
}; };
moveFeatureButton->setDefaultAction( defAction ); moveFeatureButton->setDefaultAction( defAction );
connect( moveFeatureButton, &QToolButton::triggered, this, &QgisApp::toolButtonActionTriggered ); connect( moveFeatureButton, &QToolButton::triggered, this, &QgisApp::toolButtonActionTriggered );
mAdvancedDigitizeToolBar->insertWidget( mAdvancedDigitizingDockWidget->enableAction(), moveFeatureButton ); mAdvancedDigitizeToolBar->insertWidget( mActionRotateFeature, moveFeatureButton );


bt = new QToolButton(); bt = new QToolButton();
bt->setPopupMode( QToolButton::MenuButtonPopup ); bt->setPopupMode( QToolButton::MenuButtonPopup );
Expand All @@ -2850,8 +2853,6 @@ void QgisApp::createToolBars()
pointSymbolAction->setObjectName( QStringLiteral( "ActionPointSymbolTools" ) ); pointSymbolAction->setObjectName( QStringLiteral( "ActionPointSymbolTools" ) );
connect( bt, &QToolButton::triggered, this, &QgisApp::toolButtonActionTriggered ); connect( bt, &QToolButton::triggered, this, &QgisApp::toolButtonActionTriggered );


// Cad toolbar
mAdvancedDigitizeToolBar->insertAction( mActionRotateFeature, mAdvancedDigitizingDockWidget->enableAction() );
} }


void QgisApp::createStatusBar() void QgisApp::createStatusBar()
Expand Down
4 changes: 4 additions & 0 deletions src/app/qgsmaptoolmovefeature.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ void QgsMapToolMoveFeature::cadCanvasMoveEvent( QgsMapMouseEvent *e )
mRubberBand->update(); mRubberBand->update();
mSnapIndicator->setMatch( e->mapPointMatch() ); mSnapIndicator->setMatch( e->mapPointMatch() );
} }
else
{
mSnapIndicator->setMatch( e->mapPointMatch() );
}
} }


void QgsMapToolMoveFeature::cadCanvasReleaseEvent( QgsMapMouseEvent *e ) void QgsMapToolMoveFeature::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
Expand Down

0 comments on commit a26b9b1

Please sign in to comment.