#1912 Curve Creator : Avoid selection in main project tree when clicking on curve

This commit is contained in:
Magne Sjaastad
2017-09-27 08:12:01 +02:00
parent 184e00c5aa
commit 802a9154e4
4 changed files with 44 additions and 7 deletions

View File

@@ -21,6 +21,7 @@
#include "RiaApplication.h"
#include "RimContextCommandBuilder.h"
#include "RimProject.h"
#include "RimSummaryCurve.h"
#include "RimSummaryPlot.h"
@@ -316,8 +317,6 @@ bool RiuSummaryQwtPlot::eventFilter(QObject* watched, QEvent* event)
return QwtPlot::eventFilter(watched, event);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -345,7 +344,11 @@ void RiuSummaryQwtPlot::selectClosestCurve(const QPoint& pos)
if(closestCurve && distMin < 20)
{
caf::PdmObject* selectedCurve = m_plotDefinition->findRimCurveFromQwtCurve(closestCurve);
if(selectedCurve)
RimProject* proj = nullptr;
selectedCurve->firstAncestorOrThisOfType(proj);
if(proj && selectedCurve)
{
RiaApplication::instance()->getOrCreateAndShowMainPlotWindow()->selectAsCurrentItem(selectedCurve);
}