17#ifndef LOMIRISORTFILTERPROXYMODELQML_H
18#define LOMIRISORTFILTERPROXYMODELQML_H
20#include <QSortFilterProxyModel>
22class LomiriSortFilterProxyModelQML :
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 LomiriSortFilterProxyModelQML(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 using QSortFilterProxyModel::data;
43 using QSortFilterProxyModel::mapFromSource;
44 using QSortFilterProxyModel::mapToSource;
47 int totalCount()
const;
48 bool invertMatch()
const;
49 QHash<int, QByteArray> roleNames()
const override;
52 void setModel(QAbstractItemModel *model);
53 void setInvertMatch(
bool invertMatch);
55 Q_INVOKABLE
int mapFromSource(
int row);
56 Q_INVOKABLE
int mapToSource(
int row);
59 void totalCountChanged();
61 void invertMatchChanged(
bool);