mirror of
https://github.com/OPM/ResInsight.git
synced 2026-08-01 01:08:16 -05:00
#9293 MultiPlot: avoid removing non-legend overlays.
The plots can have other kinds of overlays that should not be removed. Fixes #9293.
This commit is contained in:
committed by
Magne Sjaastad
parent
53646865a6
commit
711a9b83e7
@@ -169,13 +169,18 @@ void RiuPlotWidget::removeOverlayFrame( RiuDraggableOverlayFrame* overlayFrame )
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Remove all overlay widgets.
|
||||
/// Remove overlay widgets matching a given criteria
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPlotWidget::clearOverlayFrames()
|
||||
void RiuPlotWidget::clearOverlayFrames( std::function<bool( RiuDraggableOverlayFrame* )> matcher )
|
||||
{
|
||||
for ( auto p : m_overlayFrames )
|
||||
p->deleteLater();
|
||||
m_overlayFrames.clear();
|
||||
{
|
||||
if ( matcher( p ) )
|
||||
{
|
||||
removeOverlayFrame( p );
|
||||
p->deleteLater();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user