Reputation: 81
I want the user to be able to select only one cell at time. How can I set the maximum possible selection of cells of a QTableView to 1 (c++) ?
Upvotes: 0
Views: 453
Reputation: 24068
Set selectionMode
to SingleSelection
and set selectionBehavior
to SelectItems
tableView->setSelectionMode(QAbstractItemView::SingleSelection);
tableView->setSelectionBehavior(QAbstractItemView::SelectItems);
Upvotes: 1