Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

QSortFilterProxyModel not working with a QAbstractListModel derived model.

$
0
0
    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?

Viewing all articles
Browse latest Browse all 18427

Trending Articles