From 55966ef6e8348114cf406b7aaecdd1f790482d0b Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 27 Jun 2022 15:16:31 +0200 Subject: [PATCH] RFT : Fix several update issues --- ApplicationLibCode/Application/RiaGuiApplication.cpp | 4 ++++ ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp | 2 -- .../WellLog/RimWellLogCurveCommonDataSource.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ApplicationLibCode/Application/RiaGuiApplication.cpp b/ApplicationLibCode/Application/RiaGuiApplication.cpp index eb66f11e7c..c492c4d4d3 100644 --- a/ApplicationLibCode/Application/RiaGuiApplication.cpp +++ b/ApplicationLibCode/Application/RiaGuiApplication.cpp @@ -100,6 +100,7 @@ #include "RiuMdiMaximizeWindowGuard.h" #include "RiuMessagePanel.h" #include "RiuPlotMainWindow.h" +#include "RiuPlotMainWindowTools.h" #include "RiuProcessMonitor.h" #include "RiuRecentFileActionProvider.h" #include "RiuViewer.h" @@ -1277,6 +1278,9 @@ void RiaGuiApplication::onProjectOpened() m_maximizeWindowGuard.reset(); processEvents(); + + // Make sure to process events before this function to avoid strange Qt crash + RiuPlotMainWindowTools::refreshToolbars(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp index c3ac4a6de9..eab9ecba4b 100644 --- a/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimPlotCurve.cpp @@ -1020,8 +1020,6 @@ void RimPlotCurve::setParentPlotAndReplot( RiuPlotWidget* plotWidget ) { CAF_ASSERT( plotWidget ); - if ( m_parentPlot == plotWidget ) return; - setParentPlotNoReplot( plotWidget ); plotWidget->replot(); } diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurveCommonDataSource.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurveCommonDataSource.cpp index c5ea2f459b..ae5efde4fd 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurveCommonDataSource.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogCurveCommonDataSource.cpp @@ -601,7 +601,6 @@ void RimWellLogCurveCommonDataSource::applyDataSourceChanges( const std::vector< RimWellLogPlot* parentPlot = nullptr; extractionCurve->firstAncestorOrThisOfTypeAsserted( parentPlot ); plots.insert( parentPlot ); - curve->updateConnectedEditors(); } } else if ( measurementCurve ) @@ -621,6 +620,8 @@ void RimWellLogCurveCommonDataSource::applyDataSourceChanges( const std::vector< rftCurve->firstAncestorOrThisOfTypeAsserted( parentPlot ); plots.insert( parentPlot ); } + + curve->updateConnectedEditors(); } for ( RimWellLogTrack* track : tracks )