From: Romulo Pinho Date: Wed, 28 Mar 2012 12:48:34 +0000 (+0200) Subject: small bug with landmark indices after deletion X-Git-Tag: v1.3.0~63 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=88852f2f93eb6ea1257bb0eb139d6627ce2f0c40;p=clitk.git small bug with landmark indices after deletion --- diff --git a/vv/vvLandmarksPanel.cxx b/vv/vvLandmarksPanel.cxx index 9e891cd..7fb8027 100644 --- a/vv/vvLandmarksPanel.cxx +++ b/vv/vvLandmarksPanel.cxx @@ -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(); }