qtqt4

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?


Solution

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