X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROCurveCreator%2FCurveCreator_TreeView.cxx;h=36d1dfcfb5dfc3c85f68468445cfdf826ae61514;hb=4e1b53167581be7e084a3d71c075507bc6699c06;hp=9280713ac5b334ebba24ae907f16e99d036a89c1;hpb=3a18ec73b8f92e150d5f4c772bf122ed2ca1ecef;p=modules%2Fhydro.git diff --git a/src/HYDROCurveCreator/CurveCreator_TreeView.cxx b/src/HYDROCurveCreator/CurveCreator_TreeView.cxx index 9280713a..36d1dfcf 100755 --- a/src/HYDROCurveCreator/CurveCreator_TreeView.cxx +++ b/src/HYDROCurveCreator/CurveCreator_TreeView.cxx @@ -249,10 +249,42 @@ QList CurveCreator_TreeView::getSelectedSections() const aSect << aModel->getSection( anIndxs[i] ); } } - qSort(aSect.begin(), aSect.end()); 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());