From 6f0b776ff5a406e961f781f6eef2ad53d8d93517 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 24 Jul 2015 13:11:03 +0300 Subject: [PATCH] Correct row number after move up and down. --HG-- branch : feature --- src/app/tape/tmainwindow.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index 46376feb8..764bc13d1 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -391,6 +391,15 @@ void TMainWindow::MoveUp() MeasurementsWasSaved(false); RefreshData(); + + ui->tableWidget->blockSignals(true); + ui->tableWidget->selectRow(row-1); + ui->tableWidget->resizeColumnsToContents(); + ui->tableWidget->resizeRowsToContents(); + ui->tableWidget->horizontalHeader()->setStretchLastSection(true); + ui->tableWidget->blockSignals(false); + + Controls(); // Buttons remove, up, down } //--------------------------------------------------------------------------------------------------------------------- @@ -409,6 +418,15 @@ void TMainWindow::MoveDown() MeasurementsWasSaved(false); RefreshData(); + + ui->tableWidget->blockSignals(true); + ui->tableWidget->selectRow(row+1); + ui->tableWidget->resizeColumnsToContents(); + ui->tableWidget->resizeRowsToContents(); + ui->tableWidget->horizontalHeader()->setStretchLastSection(true); + ui->tableWidget->blockSignals(false); + + Controls(); // Buttons remove, up, down } //---------------------------------------------------------------------------------------------------------------------