NewModel model;
QAbstractItemModel * pm = qobject_cast<QAbstractItemModel *>(&model);
QSortFilterProxyModel proxy;
proxy.setSourceModel(pm);
proxy.setSortRole(NewModel::WordRole);
proxy.setDynamicSortFilter(true);
This is what I tried, but it doesn’t seem to work. The ListView in QML is able to pick up the model through the proxy, but there is no sorting. Am I doing something wrong?
↧