void QgsLayoutView::setTool( QgsLayoutViewTool *tool ) { if ( !tool ) return; if ( mTool ) { mTool->deactivate(); disconnect( mTool, &QgsLayoutViewTool::itemFocused, this, &QgsLayoutView::itemFocused ); } mSnapMarker->hide(); if ( mHorizontalSnapLine ) mHorizontalSnapLine->hide(); if ( mVerticalSnapLine ) mVerticalSnapLine->hide(); // activate new tool before setting it - gives tools a chance // to respond to whatever the current tool is tool->activate(); mTool = tool; connect( mTool, &QgsLayoutViewTool::itemFocused, this, &QgsLayoutView::itemFocused ); emit toolSet( mTool ); }
void QgsLayoutView::unsetTool( QgsLayoutViewTool *tool ) { if ( mTool && mTool == tool ) { mTool->deactivate(); emit toolSet( nullptr ); setCursor( Qt::ArrowCursor ); } }
void QgsLayoutView::setTool( QgsLayoutViewTool *tool ) { if ( !tool ) return; if ( mTool ) { mTool->deactivate(); } // activate new tool before setting it - gives tools a chance // to respond to whatever the current tool is tool->activate(); mTool = tool; emit toolSet( mTool ); }