mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
qgsplotcanvas: Fix mousePressEvent when no tool is set
In that case, `mTool->flags()` cannot be checked. Fix the issue by also checking that `mTool` is set. Closes: https://github.com/qgis/QGIS/issues/62800
This commit is contained in:
parent
f0ae7ee526
commit
aa1d78cbea
@ -166,7 +166,7 @@ void QgsPlotCanvas::mousePressEvent( QMouseEvent *event )
|
||||
setTool( mMidMouseButtonPanTool );
|
||||
event->accept();
|
||||
}
|
||||
else if ( event->button() == Qt::RightButton && mTool->flags() & Qgis::PlotToolFlag::ShowContextMenu )
|
||||
else if ( event->button() == Qt::RightButton && mTool && mTool->flags() & Qgis::PlotToolFlag::ShowContextMenu )
|
||||
{
|
||||
auto me = std::make_unique<QgsPlotMouseEvent>( this, event );
|
||||
showContextMenu( me.get() );
|
||||
|
Loading…
x
Reference in New Issue
Block a user