PDA

View Full Version : Deselecting Rows in a QTableWidget



Sarol
26th July 2011, 21:43
Good Day Everyone,

I am current working with a QTableWidget and have questions regarding selection methods. I have the table set so the selectionMode is SingleSelection and the SelectionBehavior is row. When I left click on an item it selects the entire row as expected. When I click on another item in a different row it deselects the current row and selects the new row. My issue now, is how do I go about deslecting the row?

I was trying to find a method that would all me to do something like

if ( RowSelected )
{
UnselectRow ( row_num )
}

But am unsure what I really should be looking for.

Any guidance would be appreciated.

Thank you

ChrisW67
27th July 2011, 00:47
QAbstractItemView::clearSelection() or the equivalent method on the selection model itself: QItemSelectionModel::clearSelection()