I guess QTableWidget::sortItems() is not virtual, and cant be reimplemented , isnt it ??

Also for sorting icons, one can associate some role with the item and do sorting based on that role for the icon.