mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix crash when closing and reopening plots
This commit is contained in:
parent
f130163ee8
commit
293290827b
@ -198,7 +198,7 @@ void RimGridCrossPlot::calculateZoomRangeAndUpdateQwt()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimGridCrossPlot::reattachCurvesToQwtAndReplot()
|
void RimGridCrossPlot::reattachAllCurves()
|
||||||
{
|
{
|
||||||
if ( m_plotWidget )
|
if ( m_plotWidget )
|
||||||
{
|
{
|
||||||
|
@ -70,15 +70,17 @@ public:
|
|||||||
QImage snapshotWindowContent() override;
|
QImage snapshotWindowContent() override;
|
||||||
void zoomAll() override;
|
void zoomAll() override;
|
||||||
void calculateZoomRangeAndUpdateQwt();
|
void calculateZoomRangeAndUpdateQwt();
|
||||||
void reattachCurvesToQwtAndReplot();
|
|
||||||
QString createAutoName() const override;
|
QString createAutoName() const override;
|
||||||
|
|
||||||
bool showInfoBox() const;
|
bool showInfoBox() const;
|
||||||
caf::PdmFieldHandle* userDescriptionField() override;
|
caf::PdmFieldHandle* userDescriptionField() override;
|
||||||
void detachAllCurves() override;
|
|
||||||
void performAutoNameUpdate() override;
|
void detachAllCurves() override;
|
||||||
void updateCurveNamesAndPlotTitle();
|
void reattachAllCurves() override;
|
||||||
void swapAxes();
|
|
||||||
|
void performAutoNameUpdate() override;
|
||||||
|
void updateCurveNamesAndPlotTitle();
|
||||||
|
void swapAxes();
|
||||||
|
|
||||||
QString asciiDataForPlotExport() const override;
|
QString asciiDataForPlotExport() const override;
|
||||||
QString asciiTitleForPlotExport( int dataSetIndex ) const;
|
QString asciiTitleForPlotExport( int dataSetIndex ) const;
|
||||||
|
@ -147,7 +147,7 @@ void RimGridCrossPlotCurve::updateLegendsInPlot()
|
|||||||
this->firstAncestorOrThisOfType( plot );
|
this->firstAncestorOrThisOfType( plot );
|
||||||
if ( plot )
|
if ( plot )
|
||||||
{
|
{
|
||||||
plot->reattachCurvesToQwtAndReplot();
|
plot->reattachAllCurves();
|
||||||
}
|
}
|
||||||
RimPlotCurve::updateLegendsInPlot();
|
RimPlotCurve::updateLegendsInPlot();
|
||||||
}
|
}
|
||||||
|
@ -1216,7 +1216,7 @@ void RimGridCrossPlotDataSet::triggerPlotNameUpdateAndReplot()
|
|||||||
if ( parent )
|
if ( parent )
|
||||||
{
|
{
|
||||||
parent->updateCurveNamesAndPlotTitle();
|
parent->updateCurveNamesAndPlotTitle();
|
||||||
parent->reattachCurvesToQwtAndReplot();
|
parent->reattachAllCurves();
|
||||||
parent->updateConnectedEditors();
|
parent->updateConnectedEditors();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,8 @@ public:
|
|||||||
|
|
||||||
virtual QString asciiDataForPlotExport() const = 0;
|
virtual QString asciiDataForPlotExport() const = 0;
|
||||||
|
|
||||||
virtual void detachAllCurves() = 0;
|
virtual void reattachAllCurves() = 0;
|
||||||
|
virtual void detachAllCurves() = 0;
|
||||||
|
|
||||||
virtual caf::PdmObject* findPdmObjectFromQwtCurve( const QwtPlotCurve* curve ) const = 0;
|
virtual caf::PdmObject* findPdmObjectFromQwtCurve( const QwtPlotCurve* curve ) const = 0;
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ public:
|
|||||||
TrajectoryType formationTrajectoryType() const;
|
TrajectoryType formationTrajectoryType() const;
|
||||||
|
|
||||||
void detachAllCurves() override;
|
void detachAllCurves() override;
|
||||||
void reattachAllCurves();
|
void reattachAllCurves() override;
|
||||||
|
|
||||||
void setAndUpdateWellPathFormationNamesData( RimCase* rimCase, RimWellPath* wellPath );
|
void setAndUpdateWellPathFormationNamesData( RimCase* rimCase, RimWellPath* wellPath );
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ public:
|
|||||||
size_t curveCount() const;
|
size_t curveCount() const;
|
||||||
|
|
||||||
void detachAllCurves() override;
|
void detachAllCurves() override;
|
||||||
void reattachAllCurves();
|
void reattachAllCurves() override;
|
||||||
void updateCaseNameHasChanged();
|
void updateCaseNameHasChanged();
|
||||||
|
|
||||||
void updateAxes() override;
|
void updateAxes() override;
|
||||||
|
@ -527,6 +527,10 @@ bool RiuQwtPlotWidget::eventFilter( QObject* watched, QEvent* event )
|
|||||||
void RiuQwtPlotWidget::hideEvent( QHideEvent* event )
|
void RiuQwtPlotWidget::hideEvent( QHideEvent* event )
|
||||||
{
|
{
|
||||||
resetCurveHighlighting();
|
resetCurveHighlighting();
|
||||||
|
if ( m_plotDefinition )
|
||||||
|
{
|
||||||
|
m_plotDefinition->detachAllCurves();
|
||||||
|
}
|
||||||
QwtPlot::hideEvent( event );
|
QwtPlot::hideEvent( event );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -541,19 +545,11 @@ void RiuQwtPlotWidget::showEvent( QShowEvent* event )
|
|||||||
m_canvasStyleSheet = createCanvasStyleSheet();
|
m_canvasStyleSheet = createCanvasStyleSheet();
|
||||||
m_canvasStyleSheet.applyToWidget( canvas() );
|
m_canvasStyleSheet.applyToWidget( canvas() );
|
||||||
|
|
||||||
QwtPlot::showEvent( event );
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RiuQwtPlotWidget::closeEvent( QCloseEvent* event )
|
|
||||||
{
|
|
||||||
if ( m_plotDefinition )
|
if ( m_plotDefinition )
|
||||||
{
|
{
|
||||||
m_plotDefinition->detachAllCurves();
|
m_plotDefinition->reattachAllCurves();
|
||||||
}
|
}
|
||||||
QwtPlot::closeEvent( event );
|
QwtPlot::showEvent( event );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -106,7 +106,6 @@ protected:
|
|||||||
bool eventFilter( QObject* watched, QEvent* event ) override;
|
bool eventFilter( QObject* watched, QEvent* event ) override;
|
||||||
void hideEvent( QHideEvent* event ) override;
|
void hideEvent( QHideEvent* event ) override;
|
||||||
void showEvent( QShowEvent* event ) override;
|
void showEvent( QShowEvent* event ) override;
|
||||||
void closeEvent( QCloseEvent* event ) override;
|
|
||||||
|
|
||||||
void applyAxisTitleToQwt( QwtPlot::Axis axis );
|
void applyAxisTitleToQwt( QwtPlot::Axis axis );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user