I want to owner draw the item for QListWidget, not simple change the background color,and I notice the QListWidget isn't derived from QWidget, so it hasn't the paintEvent. how to implement it? thanks.
I want to owner draw the item for QListWidget, not simple change the background color,and I notice the QListWidget isn't derived from QWidget, so it hasn't the paintEvent. how to implement it? thanks.
QWidget > QFrame > QAbstractScrollArea > QAbstractItemView > QListView > QListWidget.and I notice the QListWidget isn't derived from QWidget, so it hasn't the paintEvent.
See the inheritance ? so paintevent is available in QListWidget.
However for your need, its simple to use delegates. Have a look at QItemDelegate and QStyledItemDelegate
Bookmarks