I need to sort a table by different values that are displayed in the cells.

The QTableView model has wonderful option to do it.

Qt Code:
  1. model->setSortRole(Qt::UserRole);
To copy to clipboard, switch view to plain text mode 

But I do use QTableWidget and don't want to switch to TableView.

What I can use to get it working in TableWidget instead ??

Thanks