From: mpa Date: Tue, 21 Apr 2015 13:20:59 +0000 (+0300) Subject: 0052660: Plot2D Viewer: Plot2d_Curve can't be selected X-Git-Tag: V7_6_0rc1~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=259ecb356eb789678497db6b655cc3e377a67cce;p=modules%2Fgui.git 0052660: Plot2D Viewer: Plot2d_Curve can't be selected --- diff --git a/src/SPlot2d/SPlot2d_ViewModel.cxx b/src/SPlot2d/SPlot2d_ViewModel.cxx index 02b8e4009..896ad5aed 100644 --- a/src/SPlot2d/SPlot2d_ViewModel.cxx +++ b/src/SPlot2d/SPlot2d_ViewModel.cxx @@ -407,24 +407,31 @@ void SPlot2d_Viewer::onClicked( const QVariant& itemInfo, int index ) QwtPlotItem* plotItem = aViewFrame->getPlot()->infoToItem( itemInfo ); + bool isCurveSelected = false; CurveDict aCurves = aViewFrame->getCurves(); for( CurveDict::Iterator it = aCurves.begin(); it != aCurves.end(); ++it ) { - it.value()->setSelected( plotItem == it.key() ); - aViewFrame->updateCurve( it.value(), true ); + if(plotItem == it.key()) { + isCurveSelected = true; + it.value()->setSelected(true); + } else { + it.value()->setSelected(false); + } } - bool isAnalytical = false; AnalyticalCurveList curves = aViewFrame->getAnalyticalCurves(); foreach ( Plot2d_AnalyticalCurve* curve, curves ) { if(plotItem == curve->plotItem()) { - isAnalytical = true; + isCurveSelected = true; curve->setSelected(true); } else { curve->setSelected(false); } } - if(isAnalytical) { + if(isCurveSelected) { + for( CurveDict::Iterator it = aCurves.begin(); it != aCurves.end(); ++it ) + aViewFrame->updateCurve( it.value() ); + myDeselectAnalytical = false; emit clearSelected(); aViewFrame->updateAnalyticalCurves();