Cenoc
Cenoc

Reputation: 11662

Is it possible to make only one item selectable in QTableWidget?

Is it possible to make only one cell (or item) selectable at a time in a QTableWidget, rather than the default of allowing multiple?

Upvotes: 18

Views: 11365

Answers (1)

Chris
Chris

Reputation: 17535

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

Upvotes: 30

Related Questions