mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8792 Summary Multiple Axes : Remove axis after delete in project tree
This commit is contained in:
parent
87b822a80f
commit
ed87c9028c
@ -1288,6 +1288,18 @@ bool RiuQwtPlotWidget::isMultiAxisSupported() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuQwtPlotWidget::pruneAxes( const std::set<RiuPlotAxis>& usedAxes )
|
void RiuQwtPlotWidget::pruneAxes( const std::set<RiuPlotAxis>& usedAxes )
|
||||||
{
|
{
|
||||||
|
// Make a list of axes to remove since moving the axis invalidates the m_axisMapping iterator
|
||||||
|
std::vector<RiuPlotAxis> axesToRemove;
|
||||||
|
for ( auto [plotAxis, qwtMapping] : m_axisMapping )
|
||||||
|
{
|
||||||
|
if ( usedAxes.count( plotAxis ) == 0 )
|
||||||
|
{
|
||||||
|
axesToRemove.push_back( plotAxis );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( auto plotAxis : axesToRemove )
|
||||||
|
moveAxis( plotAxis, RiuPlotAxis::defaultLeft() );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user