How to select Row in QTableView?

Use

table->verticalHeader()->hide();

to get the vertical header and hide it, and

table->setSelectionBehavior(QAbstractItemView::SelectRows);

to make QTableView only select whole rows. You may also want to specify the selection mode.