mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #8765 from OPM/summarymultiplot_performance2
Summary Multiplot performance improvements and fixes
This commit is contained in:
@@ -183,6 +183,15 @@ void RiuMultiPlotBook::insertPlot( RiuPlotWidget* plotWidget, size_t index )
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMultiPlotBook::removePlot( RiuPlotWidget* plotWidget )
|
||||
{
|
||||
removePlotNoUpdate( plotWidget );
|
||||
scheduleUpdate();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMultiPlotBook::removePlotNoUpdate( RiuPlotWidget* plotWidget )
|
||||
{
|
||||
if ( !plotWidget ) return;
|
||||
|
||||
@@ -190,8 +199,6 @@ void RiuMultiPlotBook::removePlot( RiuPlotWidget* plotWidget )
|
||||
CVF_ASSERT( plotWidgetIdx >= 0 );
|
||||
|
||||
m_plotWidgets.removeAt( plotWidgetIdx );
|
||||
|
||||
scheduleUpdate();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -383,7 +390,8 @@ void RiuMultiPlotBook::showEvent( QShowEvent* event )
|
||||
{
|
||||
m_goToPageAfterUpdate = true;
|
||||
QWidget::showEvent( event );
|
||||
performUpdate();
|
||||
const bool regeneratePages = false;
|
||||
performUpdate( regeneratePages );
|
||||
if ( m_previewMode )
|
||||
{
|
||||
applyPagePreviewBookSize( width() );
|
||||
@@ -473,16 +481,19 @@ bool RiuMultiPlotBook::showYAxis( int row, int column ) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMultiPlotBook::performUpdate()
|
||||
void RiuMultiPlotBook::performUpdate( bool regeneratePages )
|
||||
{
|
||||
applyLook();
|
||||
deleteAllPages();
|
||||
createPages();
|
||||
if ( regeneratePages || m_pages.size() == 0 )
|
||||
{
|
||||
deleteAllPages();
|
||||
createPages();
|
||||
}
|
||||
updateGeometry();
|
||||
// use a timer to trigger a viewer page change, if needed
|
||||
if ( m_goToPageAfterUpdate )
|
||||
{
|
||||
m_pageTimerId = startTimer( 100 );
|
||||
m_pageTimerId = startTimer( 50 );
|
||||
m_goToPageAfterUpdate = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user