From: Paul RASCLE Date: Mon, 30 Nov 2020 10:39:35 +0000 (+0100) Subject: fix polyline curve tablewidget edition: avoid deselection and table hide at each... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1f28437543dbafd5dd63c6437ca57c6c282325d7;p=modules%2Fgeom.git fix polyline curve tablewidget edition: avoid deselection and table hide at each modification, fix order by colummns --- diff --git a/src/CurveCreator/CurveCreator_TableView.cxx b/src/CurveCreator/CurveCreator_TableView.cxx index 4251d425d..b72d1c19f 100644 --- a/src/CurveCreator/CurveCreator_TableView.cxx +++ b/src/CurveCreator/CurveCreator_TableView.cxx @@ -219,7 +219,7 @@ void CurveCreator_TableView::OnHeaderClick( int theLogicalId ) int point = item( r, 1 )->data( Qt::UserRole ).toInt(); selected.push_back( CurveCreator_ICurve::SectionToPoint( section, point ) ); } - myWidget->setSelectedPoints( selected ); + //myWidget->setSelectedPoints( selected ); // seems unneeded and breaks the sorting myCurrentSortId = theLogicalId; } diff --git a/src/CurveCreator/CurveCreator_Widget.cxx b/src/CurveCreator/CurveCreator_Widget.cxx index 09bc3d348..8740e1bac 100644 --- a/src/CurveCreator/CurveCreator_Widget.cxx +++ b/src/CurveCreator/CurveCreator_Widget.cxx @@ -1526,17 +1526,18 @@ void CurveCreator_Widget::moveSelectedPoints( const int theXPosition, finishCurveModification( myDragPoints ); } -void CurveCreator_Widget::updateLocalPointView() +void CurveCreator_Widget::updateLocalPointView(bool isGetSelected) { if ( myDragStarted ) return; Handle(AIS_InteractiveContext) aContext = getAISContext(); if ( aContext.IsNull() ) return; - - CurveCreator_Utils::getSelectedPoints( aContext, myCurve, myLocalPoints ); + if (isGetSelected) + { + CurveCreator_Utils::getSelectedPoints( aContext, myCurve, myLocalPoints ); + } int aNbPoints = myLocalPoints.size(); - //bool isRowLimit = aNbPoints > myLocalPointRowLimit; myLocalPointView->setVisible( getActionMode() == ModificationMode/* && !isRowLimit */); @@ -1606,8 +1607,8 @@ void CurveCreator_Widget::setSelectedPoints( const CurveCreator_ICurve::SectionT return; CurveCreator_Utils::setSelectedPoints( aContext, myCurve, thePoints ); - - updateLocalPointView(); + bool keepSelected = (thePoints.size() != 0) && (getActionMode() == ModificationMode); + updateLocalPointView(!keepSelected); } void CurveCreator_Widget::stopActionMode() diff --git a/src/CurveCreator/CurveCreator_Widget.h b/src/CurveCreator/CurveCreator_Widget.h index f66925eda..7f4d98a19 100644 --- a/src/CurveCreator/CurveCreator_Widget.h +++ b/src/CurveCreator/CurveCreator_Widget.h @@ -98,7 +98,7 @@ public: void setSelectedPoints( const CurveCreator_ICurve::SectionToPointList& = CurveCreator_ICurve::SectionToPointList() ); - void updateLocalPointView(); + void updateLocalPointView(bool isGetSelected = true); void setLocalPointContext( const bool theOpen, const bool isUpdateTable = false ); signals: