Fix curves not showing up after moving plots to multi plot

This commit is contained in:
Gaute Lindkvist
2019-11-20 13:39:09 +01:00
parent bf6da1c6c4
commit 8f6e875ea4
2 changed files with 16 additions and 4 deletions

View File

@@ -76,10 +76,9 @@ RiuQwtPlotWidget::RiuQwtPlotWidget( RimPlot* plot, QWidget* parent )
//--------------------------------------------------------------------------------------------------
RiuQwtPlotWidget::~RiuQwtPlotWidget()
{
if ( m_plotDefinition )
{
m_plotDefinition->detachAllCurves();
}
// The destructor may be called later when deleting with QWidget::deleteLater()
// If you are recreating the widget, then calling something that detaches QwtCurves
// here may cause them to detach from the new widget rather than the old.
}
//--------------------------------------------------------------------------------------------------
@@ -545,6 +544,18 @@ void RiuQwtPlotWidget::showEvent( QShowEvent* event )
QwtPlot::showEvent( event );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuQwtPlotWidget::closeEvent( QCloseEvent* event )
{
if ( m_plotDefinition )
{
m_plotDefinition->detachAllCurves();
}
RiuQwtPlotWidget::closeEvent( event );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -106,6 +106,7 @@ 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 );