tableWidget->setSelectionBehavior( QAbstractItemView::SelectItems ); tableWidget->setSelectionMode( QAbstractItemView::SingleSelection );