Fix crash when closing and reopening plots

This commit is contained in:
Gaute Lindkvist
2019-11-22 15:42:40 +01:00
parent d079f233a4
commit d6ec710fd9
9 changed files with 21 additions and 23 deletions

View File

@@ -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 );
}
//--------------------------------------------------------------------------------------------------