Correct row number after move up and down.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2015-07-24 13:11:03 +03:00
parent 7e25a27a0c
commit 6f0b776ff5

View File

@ -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
}
//---------------------------------------------------------------------------------------------------------------------