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

Can i change QTreeWidget/QTableWidget to a icon mode like QListWidget??



  • Can i change QTreeWidget/QTableWidget to a icon mode like QListWidget??
    and setItemDelegate to it ?


  • Lifetime Qt Champion

    Hi,

    No it's QListView/Widget specific.

    Yes you can set a delegate on them.



  • is it simple to realize?
    now i temporarily use QStackedWidget to make one of the 2 widgets Visible


  • Lifetime Qt Champion

    Do you mean easy to set an item delegate ?



  • i use QListWidget first, and i want to use it which can dynamically switch between ListMode and IconMode. However, when i want the ListMode support multi-column...problem comes...
    now i do it like this, use a QStackedWidget, then put a QTreeWidget and a QListWidget into it, when i switch to multi-column ListMode i use QTreeWidget, when i switch to preview IconMode i use QListWidget's IconMode(and use ItemDelegate to customize the preview picture).........is there any better way to realize my work here?
    and right now i find another problem, when sort the WidgetItem, the QTreeWidget'Header has default sorting method, however, i don't know how to sort the QListWidget based on(and have the same result with) the QTreeWidget...


  • Lifetime Qt Champion

    What is the problem with the icon mode ?


Log in to reply