1

I'm looking for a way to have a QTableView show a subset of the total rows in the QAbstractTableModel in a random order.

I have found QSortFilterProxyModel to display a subset of rows (filter). However, it can't do a random order, it can only do sorted (sort).
QAbstractProxyModel looked promising, but the editors don't even work when I use that transparantly. Maybe I'm missing something here, but reimplementing mapToSource and mapFromSource proves insufficient.

What would be the correct way to get this done?
I could obviously do this inside my model, but this feels wrong if it's only for viewing/editor purpose.

Jeroen3
  • 919
  • 5
  • 20
  • 2
    You can subclass `QSortFilterProxyModel` and reimplement its `sort` method to do what you want - create a random order of items and sort according to it. – Dmitry Sep 19 '17 at 13:36

0 Answers0