Skip to content

Commit

Permalink
center cell after Go To
Browse files Browse the repository at this point in the history
  • Loading branch information
kambala-decapitator committed Jan 12, 2020
1 parent 393a8e3 commit aeb9e18
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions qtbleditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,11 @@ void QTblEditor::findNextString(const QString &query, bool isCaseSensitive, bool
void QTblEditor::goTo()
{
GoToRowDialog dlg(this, _currentTableWidget->rowCount(), ui.actionStartNumberingFrom0->isChecked(), ui.actionShowHexInRow->isChecked());
if (dlg.exec())
_currentTableWidget->setCurrentCell(dlg.row() - 1, 1);
if (!dlg.exec())
return;
int row = dlg.row() - 1, col = 1;
_currentTableWidget->setCurrentCell(row, col);
_currentTableWidget->scrollTo(_currentTableWidget->model()->index(row, col), QAbstractItemView::PositionAtCenter);
}

void QTblEditor::editString(QTableWidgetItem *itemToEdit)
Expand Down

0 comments on commit aeb9e18

Please sign in to comment.