fix polyline curve tablewidget edition: avoid deselection and table hide at each modification, fix order by colummns

This commit is contained in:
Paul RASCLE 2020-11-30 11:39:35 +01:00 committed by YOANN AUDOUIN
parent 951250adc1
commit 1f28437543
3 changed files with 9 additions and 8 deletions

View File

@ -219,7 +219,7 @@ void CurveCreator_TableView::OnHeaderClick( int theLogicalId )
int point = item( r, 1 )->data( Qt::UserRole ).toInt(); int point = item( r, 1 )->data( Qt::UserRole ).toInt();
selected.push_back( CurveCreator_ICurve::SectionToPoint( section, point ) ); selected.push_back( CurveCreator_ICurve::SectionToPoint( section, point ) );
} }
myWidget->setSelectedPoints( selected ); //myWidget->setSelectedPoints( selected ); // seems unneeded and breaks the sorting
myCurrentSortId = theLogicalId; myCurrentSortId = theLogicalId;
} }

View File

@ -1526,17 +1526,18 @@ void CurveCreator_Widget::moveSelectedPoints( const int theXPosition,
finishCurveModification( myDragPoints ); finishCurveModification( myDragPoints );
} }
void CurveCreator_Widget::updateLocalPointView() void CurveCreator_Widget::updateLocalPointView(bool isGetSelected)
{ {
if ( myDragStarted ) if ( myDragStarted )
return; return;
Handle(AIS_InteractiveContext) aContext = getAISContext(); Handle(AIS_InteractiveContext) aContext = getAISContext();
if ( aContext.IsNull() ) if ( aContext.IsNull() )
return; return;
if (isGetSelected)
CurveCreator_Utils::getSelectedPoints( aContext, myCurve, myLocalPoints ); {
CurveCreator_Utils::getSelectedPoints( aContext, myCurve, myLocalPoints );
}
int aNbPoints = myLocalPoints.size(); int aNbPoints = myLocalPoints.size();
//bool isRowLimit = aNbPoints > myLocalPointRowLimit; //bool isRowLimit = aNbPoints > myLocalPointRowLimit;
myLocalPointView->setVisible( getActionMode() == ModificationMode/* && !isRowLimit */); myLocalPointView->setVisible( getActionMode() == ModificationMode/* && !isRowLimit */);
@ -1606,8 +1607,8 @@ void CurveCreator_Widget::setSelectedPoints( const CurveCreator_ICurve::SectionT
return; return;
CurveCreator_Utils::setSelectedPoints( aContext, myCurve, thePoints ); CurveCreator_Utils::setSelectedPoints( aContext, myCurve, thePoints );
bool keepSelected = (thePoints.size() != 0) && (getActionMode() == ModificationMode);
updateLocalPointView(); updateLocalPointView(!keepSelected);
} }
void CurveCreator_Widget::stopActionMode() void CurveCreator_Widget::stopActionMode()

View File

@ -98,7 +98,7 @@ public:
void setSelectedPoints( const CurveCreator_ICurve::SectionToPointList& = void setSelectedPoints( const CurveCreator_ICurve::SectionToPointList& =
CurveCreator_ICurve::SectionToPointList() ); CurveCreator_ICurve::SectionToPointList() );
void updateLocalPointView(); void updateLocalPointView(bool isGetSelected = true);
void setLocalPointContext( const bool theOpen, const bool isUpdateTable = false ); void setLocalPointContext( const bool theOpen, const bool isUpdateTable = false );
signals: signals: