You may reimplement QTableWidgetItem::operator<() if you want to have custom sorting.