mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5026 Fix summary plot closing crash
This commit is contained in:
parent
f8468dc7a6
commit
aa40816f49
@ -604,18 +604,6 @@ bool RimGridPlotWindow::applyFontSize( RiaDefines::FontSettingType fontSettingTy
|
||||
return somethingChanged;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridPlotWindow::detachAllCurves()
|
||||
{
|
||||
auto plotVector = plots();
|
||||
for ( size_t tIdx = 0; tIdx < plotVector.size(); ++tIdx )
|
||||
{
|
||||
plotVector[tIdx]->detachAllCurves();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
|
||||
public:
|
||||
RimGridPlotWindow();
|
||||
~RimGridPlotWindow();
|
||||
~RimGridPlotWindow() override;
|
||||
|
||||
RimGridPlotWindow& operator=( RimGridPlotWindow&& rhs );
|
||||
|
||||
@ -116,8 +116,6 @@ protected:
|
||||
bool forceChange = false ) override;
|
||||
|
||||
private:
|
||||
void detachAllCurves() override;
|
||||
|
||||
void cleanupBeforeClose();
|
||||
|
||||
static RimPlotInterface* toPlotInterfaceAsserted( caf::PdmObject* pdmObject );
|
||||
|
@ -32,7 +32,7 @@ class RimPlotWindow : public RimViewWindow
|
||||
|
||||
public:
|
||||
RimPlotWindow();
|
||||
~RimPlotWindow();
|
||||
~RimPlotWindow() override;
|
||||
|
||||
RimPlotWindow& operator=( RimPlotWindow&& rhs );
|
||||
|
||||
@ -49,7 +49,6 @@ public:
|
||||
int legendFontSize() const;
|
||||
void setLegendFontSize( int fontSize );
|
||||
|
||||
virtual void detachAllCurves() = 0;
|
||||
virtual void handleKeyPressEvent( QKeyEvent* keyEvent ) {}
|
||||
virtual void updateLayout() = 0;
|
||||
|
||||
|
@ -1513,22 +1513,7 @@ std::set<RimPlotAxisPropertiesInterface*> RimSummaryPlot::allPlotAxes() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryPlot::cleanupBeforeClose()
|
||||
{
|
||||
if ( m_summaryCurveCollection )
|
||||
{
|
||||
m_summaryCurveCollection->detachQwtCurves();
|
||||
}
|
||||
|
||||
m_ensembleCurveSetCollection->detachQwtCurves();
|
||||
|
||||
for ( RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves )
|
||||
{
|
||||
curve->detachQwtCurve();
|
||||
}
|
||||
|
||||
for ( RimAsciiDataCurve* curve : m_asciiDataCurves )
|
||||
{
|
||||
curve->detachQwtCurve();
|
||||
}
|
||||
detachAllCurves();
|
||||
|
||||
if ( m_plotWidget )
|
||||
{
|
||||
|
@ -109,17 +109,6 @@ RiuGridPlotWindow::RiuGridPlotWindow( RimGridPlotWindow* plotDefinition, QWidget
|
||||
this->setObjectName( QString( "%1" ).arg( reinterpret_cast<uint64_t>( this ) ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuGridPlotWindow::~RiuGridPlotWindow()
|
||||
{
|
||||
if ( m_plotDefinition )
|
||||
{
|
||||
m_plotDefinition->detachAllCurves();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -55,8 +55,6 @@ class RiuGridPlotWindow : public QWidget, public RiuInterfaceToViewWindow, publi
|
||||
public:
|
||||
RiuGridPlotWindow( RimGridPlotWindow* plotDefinition, QWidget* parent = nullptr );
|
||||
|
||||
~RiuGridPlotWindow() override;
|
||||
|
||||
RimGridPlotWindow* ownerPlotDefinition();
|
||||
RimViewWindow* ownerViewWindow() const override;
|
||||
|
||||
|
@ -76,7 +76,13 @@ RiuQwtPlotWidget::RiuQwtPlotWidget( RimPlotInterface* plotTrackDefinition, QWidg
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuQwtPlotWidget::~RiuQwtPlotWidget() {}
|
||||
RiuQwtPlotWidget::~RiuQwtPlotWidget()
|
||||
{
|
||||
if ( plotDefinition() )
|
||||
{
|
||||
plotDefinition()->detachAllCurves();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user