17 #ifndef UNITYSORTFILTERPROXYMODELQML_H
18 #define UNITYSORTFILTERPROXYMODELQML_H
20 #include <QSortFilterProxyModel>
22 class UnitySortFilterProxyModelQML :
public QSortFilterProxyModel
26 Q_PROPERTY(QAbstractItemModel* model READ sourceModel WRITE setModel NOTIFY modelChanged)
27 Q_PROPERTY(
int totalCount READ totalCount NOTIFY totalCountChanged)
28 Q_PROPERTY(
int count READ count NOTIFY countChanged)
29 Q_PROPERTY(
bool invertMatch READ invertMatch WRITE setInvertMatch NOTIFY invertMatchChanged)
32 explicit UnitySortFilterProxyModelQML(QObject *parent = 0);
34 Q_INVOKABLE QVariantMap
get(
int row);
35 Q_INVOKABLE QVariant data(
int row,
int role);
36 Q_INVOKABLE
int count();
37 Q_INVOKABLE
int findFirst(
int role,
const QVariant& value)
const;
38 Q_INVOKABLE
int mapRowToSource(
int row);
39 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent)
const override;
42 int totalCount()
const;
43 bool invertMatch()
const;
44 QHash<int, QByteArray> roleNames()
const override;
47 void setModel(QAbstractItemModel *model);
48 void setInvertMatch(
bool invertMatch);
50 Q_INVOKABLE
int mapFromSource(
int row);
51 Q_INVOKABLE
int mapToSource(
int row);
54 void totalCountChanged();
56 void invertMatchChanged(
bool);
63 #endif // UNITYSORTFILTERPROXYMODELQML_H