]> Creatis software - clitk.git/commitdiff
small bug with landmark indices after deletion
authorRomulo Pinho <romulo.pinho@lyon.unicancer.fr>
Wed, 28 Mar 2012 12:48:34 +0000 (14:48 +0200)
committerRomulo Pinho <romulo.pinho@lyon.unicancer.fr>
Wed, 28 Mar 2012 12:48:34 +0000 (14:48 +0200)
vv/vvLandmarksPanel.cxx

index 9e891cda5071cc3fd3d7419a5b51cc6a0dd2b6c1..7fb80276ad5c8f6bbfb6642b76cdc45f9cc46680 100644 (file)
@@ -76,8 +76,15 @@ void vvLandmarksPanel::RemoveSelectedPoints()
     }
     else {
       // we're using single-selection mode
-      mCurrentLandmarks->RemoveLandmark(items[0]->row());
-      tableWidget->removeRow(items[0]->row());
+      int row = items[0]->row();
+      mCurrentLandmarks->RemoveLandmark(row);
+      tableWidget->removeRow(row);
+      
+      for (int i = row; i < tableWidget->rowCount(); i++) {
+        QTableWidgetItem* iItem = tableWidget->item(i, 0);
+        iItem->setText(QString::number(i));
+      }
+        
     }
     emit UpdateRenderWindows();
   }