mirror of
https://github.com/OPM/ResInsight.git
synced 2024-12-29 10:21:54 -06:00
#10349 Avoid calling performUpdate() in showEvent()
When a dock widget in a dock widget tab group is activated, a show event is triggered in IumMultiPlotBook::showEvent. This causes a crash if performUpdate is called in showEvent. Make sure the performUpdate is called from RimMultiPlot::onLoadDataAndUpdate()
This commit is contained in:
parent
3c526d888e
commit
14311dec3b
@ -805,6 +805,8 @@ void RimMultiPlot::onLoadDataAndUpdate()
|
||||
RiuPlotMainWindowTools::refreshToolbars();
|
||||
|
||||
m_showPlotLegends = originalShowState;
|
||||
|
||||
if ( m_viewer ) m_viewer->forcePerformUpdate();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -399,7 +399,6 @@ void RiuMultiPlotBook::showEvent( QShowEvent* event )
|
||||
m_goToPageAfterUpdate = true;
|
||||
QWidget::showEvent( event );
|
||||
|
||||
performUpdate( RiaDefines::MultiPlotPageUpdateType::ALL );
|
||||
if ( m_previewMode )
|
||||
{
|
||||
applyPagePreviewBookSize( width() );
|
||||
@ -538,6 +537,14 @@ void RiuMultiPlotBook::updatePageTitles()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMultiPlotBook::forcePerformUpdate()
|
||||
{
|
||||
performUpdate( RiaDefines::MultiPlotPageUpdateType::ALL );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -93,6 +93,11 @@ public:
|
||||
|
||||
void keepCurrentPageAfterUpdate();
|
||||
|
||||
// https://github.com/OPM/ResInsight/issues/10349
|
||||
// This function is used to force an update of the plot book. It is intended to be used from RimMultiPlot::onLoadDataAndUpdate()
|
||||
// The code used to be called from RiuMultiPlotBook::showEvent(), but this caused a crash when a dock widget was hidden and shown again.
|
||||
void forcePerformUpdate();
|
||||
|
||||
protected:
|
||||
void contextMenuEvent( QContextMenuEvent* ) override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user