Detaching all curves before the plot is deleted. Qwt needed it.

This commit is contained in:
Jacob Støren
2015-09-03 15:10:02 +02:00
parent f149cfff6d
commit 11e57b663c
6 changed files with 41 additions and 4 deletions

View File

@@ -64,6 +64,7 @@ RimWellLogPlot::RimWellLogPlot()
RimWellLogPlot::~RimWellLogPlot()
{
RiuMainWindow::instance()->removeViewer(m_viewer);
detachAllCurves();
delete m_viewer;
}
@@ -92,6 +93,7 @@ void RimWellLogPlot::updateViewerWidget()
windowGeometry = RiuMainWindow::instance()->windowGeometryForViewer(m_viewer);
RiuMainWindow::instance()->removeViewer(m_viewer);
detachAllCurves();
delete m_viewer;
m_viewer = NULL;
@@ -285,3 +287,14 @@ void RimWellLogPlot::recreateTracePlots()
m_viewer->insertTracePlot(traces[tIdx]->viewer());
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlot::detachAllCurves()
{
for (size_t tIdx = 0; tIdx < traces.size(); ++tIdx)
{
traces[tIdx]->detachAllCurves();
}
}