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

Need help on QAbstractItemView/QAbstractItemDelegate.



  • Hi, I'm new to programming and Qt, pardon me if I'm asking anything stupid. I have a doubt regarding QListView. I have a populated model with 3 keys, I need to add Radio Buttons to each index. https://snaptube.cam/ https://9apps.cam/ I initially used QListView which couldn't help me achieve that. I realized I needed a delegate to do that. QTreeView usually uses QStyledItemDelegate so what should I do to have a list view with radio buttons. I read on Qt forum which said I need to use QAbstractItemView, so I was wondering if I need to QAbstractItemView instead of QListView or subclass QAbstractItemDelegate and then use QAbstractItemView? If I'm subclassing which function do I need to use.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    For custom rendering, go with QStyledItemDelegate. It can be used with all views.

    Can you explain your need of a radio button ?


Log in to reply