Попробуйте использовать QAbstractItemView :: SingleSelection.
ui.tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
ui.tableWidget->setSelectionMode(QAbstractItemView::SingleSelection);
ui.tableWidget->selectRow(2);
Вы также можете попробовать это:
ui.tableWidget->setCurrentIndex(ui.tableWidget->model()->index(2, 0));