mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #5083 from OPM/fix-plot-crash-release-2019.11
Fix crash when closing and reopening plots
This commit is contained in:
@@ -549,6 +549,10 @@ bool RiuQwtPlotWidget::eventFilter( QObject* watched, QEvent* event )
|
||||
void RiuQwtPlotWidget::hideEvent( QHideEvent* event )
|
||||
{
|
||||
resetCurveHighlighting();
|
||||
if ( plotDefinition() )
|
||||
{
|
||||
plotDefinition()->detachAllCurves();
|
||||
}
|
||||
QwtPlot::hideEvent( event );
|
||||
}
|
||||
|
||||
@@ -563,19 +567,11 @@ void RiuQwtPlotWidget::showEvent( QShowEvent* event )
|
||||
m_canvasStyleSheet = createCanvasStyleSheet();
|
||||
m_canvasStyleSheet.applyToWidget( canvas() );
|
||||
|
||||
QwtPlot::showEvent( event );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuQwtPlotWidget::closeEvent( QCloseEvent* event )
|
||||
{
|
||||
if ( plotDefinition() )
|
||||
{
|
||||
plotDefinition()->detachAllCurves();
|
||||
plotDefinition()->reattachAllCurves();
|
||||
}
|
||||
QwtPlot::closeEvent( event );
|
||||
QwtPlot::showEvent( event );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -109,7 +109,6 @@ protected:
|
||||
bool eventFilter( QObject* watched, QEvent* event ) override;
|
||||
void hideEvent( QHideEvent* event ) override;
|
||||
void showEvent( QShowEvent* event ) override;
|
||||
void closeEvent( QCloseEvent* event ) override;
|
||||
|
||||
void applyAxisTitleToQwt( QwtPlot::Axis axis );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user