From 88852f2f93eb6ea1257bb0eb139d6627ce2f0c40 Mon Sep 17 00:00:00 2001 From: Romulo Pinho Date: Wed, 28 Mar 2012 14:48:34 +0200 Subject: [PATCH] small bug with landmark indices after deletion --- vv/vvLandmarksPanel.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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(); } -- 2.47.1