Qt, How can I sort QTableWidget column if the cells are widgets
问题 I have a QTableWidget , some columns are filled with text, some with numbers, these columns are fine to sort. But I also have a column with custom widgets, how should I enable sorting for these? My first thought was of course to overload the '<' method on the QTableWidgetItem , but there are no QTableWidgetItem . So what would be the best way to solve this? 回答1: QTableWidget is not ideal for this case, consider using QTableView . Anyway, I will show you how to sort a QProgressBar widget in a