1

I set a few custom delegates in my list. When I do a reset of the model QListView::reset(); gets called but the delegates are not reset. Is this a bug, if not how can I reset all delegates?

Iterating over all rows and set the delegates to nullptr would work but is not a proper solution.

ManuelSchneid3r
  • 15,850
  • 12
  • 65
  • 103

1 Answers1

0

Qt internally maintains an map of the custom row delegates but does not give acces to it. I ended up maintaining a list myself and unset them all if I need to using

void QAbstractItemView::setItemDelegateForRow(int row, QAbstractItemDelegate * delegate)

with a nullptr as delegate;

Community
  • 1
  • 1
ManuelSchneid3r
  • 15,850
  • 12
  • 65
  • 103