#2769 Ensemble curves. Fix crash when clicking on ensemble curve

This commit is contained in:
Bjørn Erik Jensen
2018-04-20 12:30:59 +02:00
parent b4fae86aea
commit 68b360a03f
5 changed files with 52 additions and 19 deletions

View File

@@ -409,15 +409,15 @@ void RiuSummaryQwtPlot::selectClosestCurve(const QPoint& pos)
if(closestCurve && distMin < 20)
{
caf::PdmObject* selectedCurve = m_plotDefinition->findRimCurveFromQwtCurve(closestCurve);
caf::PdmObject* selectedPlotObject = m_plotDefinition->findRimPlotObjectFromQwtCurve(closestCurve);
RimProject* proj = nullptr;
selectedCurve->firstAncestorOrThisOfType(proj);
selectedPlotObject->firstAncestorOrThisOfType(proj);
if(proj && selectedCurve)
if(proj && selectedPlotObject)
{
RiuPlotMainWindowTools::showPlotMainWindow();
RiuPlotMainWindowTools::selectAsCurrentItem(selectedCurve);
RiuPlotMainWindowTools::selectAsCurrentItem(selectedPlotObject);
}
}
}