#8715 Fix multi summary title and legend updates

This commit is contained in:
Magne Sjaastad
2022-03-23 13:35:47 +01:00
committed by GitHub
parent 2aec91e66d
commit f45637b7f0
4 changed files with 41 additions and 2 deletions

View File

@@ -101,6 +101,9 @@ void RimSummaryMultiPlot::addPlot( RimPlot* plot )
CVF_ASSERT( sumPlot != nullptr );
if ( sumPlot )
{
// Not required to connect signal here, as RimSummaryMultiPlot::insertPlot() will always be called from
// RimMultiPlot::addPlot()
RimMultiPlot::addPlot( plot );
}
}
@@ -114,6 +117,7 @@ void RimSummaryMultiPlot::insertPlot( RimPlot* plot, size_t index )
CVF_ASSERT( sumPlot != nullptr );
if ( sumPlot )
{
sumPlot->curvesChanged.connect( this, &RimSummaryMultiPlot::onSubPlotChanged );
RimMultiPlot::insertPlot( plot, index );
}
}
@@ -131,9 +135,9 @@ void RimSummaryMultiPlot::addPlot( const std::vector<caf::PdmObjectHandle*>& obj
RimSummaryPlot* plot = new RimSummaryPlot();
plot->enableAutoPlotTitle( true );
addPlot( plot );
plot->handleDroppedObjects( objects );
addPlot( plot );
}
}
@@ -508,6 +512,19 @@ bool RimSummaryMultiPlot::handleGlobalWheelEvent( QWheelEvent* wheelEvent )
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryMultiPlot::initAfterRead()
{
RimMultiPlot::initAfterRead();
for ( auto plot : summaryPlots() )
{
plot->curvesChanged.connect( this, &RimSummaryMultiPlot::onSubPlotChanged );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -560,3 +577,12 @@ void RimSummaryMultiPlot::duplicate()
{
duplicatePlot.send( this );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryMultiPlot::onSubPlotChanged( const caf::SignalEmitter* emitter )
{
updatePlotWindowTitle();
applyPlotWindowTitleToWidgets();
}