X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROCurveCreator%2FCurveCreator_TreeView.cxx;h=36d1dfcfb5dfc3c85f68468445cfdf826ae61514;hb=09d10e66ba0fac5353c8d1f138055fc6fe86fb65;hp=ce580d5357ee720a045f3b2ceed086832bba7add;hpb=a8fc21e48db08ba3de63519dcae1a8e3fe560ee4;p=modules%2Fhydro.git diff --git a/src/HYDROCurveCreator/CurveCreator_TreeView.cxx b/src/HYDROCurveCreator/CurveCreator_TreeView.cxx index ce580d53..36d1dfcf 100755 --- a/src/HYDROCurveCreator/CurveCreator_TreeView.cxx +++ b/src/HYDROCurveCreator/CurveCreator_TreeView.cxx @@ -252,6 +252,39 @@ QList CurveCreator_TreeView::getSelectedSections() const return aSect; } +void CurveCreator_TreeView::pointsAdded( int theSection, int thePoint, int thePointsCnt ) +{ + CurveCreator_TreeViewModel* aModel = dynamic_cast(model()); + if( aModel ){ + QModelIndex aSectIndx = aModel->sectionIndex( theSection ); + rowsInserted(aSectIndx, thePoint, thePoint + thePointsCnt - 1 ); +// expand( aSectIndx ); + update( aModel->nbPointsIndex( theSection ) ); + } +} + +void CurveCreator_TreeView::pointDataChanged( int theSection, int thePoint ) +{ + CurveCreator_TreeViewModel* aModel = dynamic_cast(model()); + if( aModel ){ + QModelIndex aPointIndx = aModel->pointIndex( theSection, thePoint ); + dataChanged( aPointIndx, aPointIndx ); + } +} + +void CurveCreator_TreeView::pointsRemoved( int theSection, int thePoint, int thePointsCnt ) +{ + CurveCreator_TreeViewModel* aModel = dynamic_cast(model()); + if( aModel ){ + for( int i = 0 ; i < thePointsCnt ; i++ ){ + QModelIndex aSectIndx = aModel->pointIndex(theSection, thePoint + i); + selectionModel()->select(aSectIndx,QItemSelectionModel::Deselect); + } + QModelIndex aSectIndx = aModel->sectionIndex( theSection ); + rowsRemoved(aSectIndx, thePoint, thePoint + thePointsCnt - 1 ); + } +} + void CurveCreator_TreeView::sectionAdded( int theSection ) { CurveCreator_TreeViewModel* aModel = dynamic_cast(model());