#8792 Summary Multiple Axes : Remove axis after delete in project tree

This commit is contained in:
Kristian Bendiksen 2022-04-20 10:31:27 +02:00 committed by Magne Sjaastad
parent 87b822a80f
commit ed87c9028c

View File

@ -1288,6 +1288,18 @@ bool RiuQwtPlotWidget::isMultiAxisSupported() const
//--------------------------------------------------------------------------------------------------
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() );
}
//--------------------------------------------------------------------------------------------------