Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

how can i sort depend on various "column" data when i re-implement operator< in QListWidgetItem ?



  • when i re-implement operator<, how can i sort depend on various "column" data , not only the DisplayRole data.
    why i do this is i want have a QTreeWidget and a QListWidget, which have the Same contents.

    1. i sort the QTreeWidget items by the data on a column.
    2. when i switch into the QListWidget, i will sort by the same data with the QTreeWidget, sort the QListWidget....so i need more than sort by the DisplayRole

Log in to reply