24#include <QSortFilterProxyModel>
38 QML_FOREIGN(QSortFilterProxyModel)
103 [[nodiscard]] QString
filter()
const {
return m_filter; }
155 [[nodiscard]]
bool filterAcceptsRow(
int sourceRow,
const QModelIndex& sourceParent)
const override;
170 QString m_filterRoleName {QStringLiteral(
"name")};
173 int m_filterRole {-1};
QString filterRoleName() const
Getter function for the property with the same name.
void setFilter(const QString &newFilter)
Setter function for the property with the same name.
QString filter
Filter string.
void filterChanged()
Notification signal for property with the same name.
QString filterRoleName
Name of the source model role that the filter is matched against.
void setFilterRoleName(const QString &newFilterRoleName)
Setter function for the property with the same name.
void setSourceModel(QAbstractItemModel *newSourceModel) override
Re-implemented from QAbstractProxyModel.
void filterRoleNameChanged()
Notification signal for property with the same name.
int roleForName(const QString &roleName) const
Looks up a role by name in the source model.
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override
Re-implemented from QSortFilterProxyModel.
NameFilterProxyModel(QObject *parent=nullptr)
Standard constructor.
Makes QSortFilterProxyModel known to the QML type system.