Plasma5Support
datamodel.h
37 * The source model of this sorting proxy model. It has to inherit QAbstractItemModel (ListModel is not supported)
39 Q_PROPERTY(QAbstractItemModel *sourceModel READ sourceModel WRITE setModel NOTIFY sourceModelChanged)
42 * The regular expression for the filter, only items with their filterRole matching filterRegExp will be displayed
44 Q_PROPERTY(QString filterRegExp READ filterRegExp WRITE setFilterRegExp NOTIFY filterRegExpChanged)
47 * The string for the filter, only items with their filterRole matching filterString will be displayed
49 Q_PROPERTY(QString filterString READ filterString WRITE setFilterString NOTIFY filterStringChanged REVISION 1)
52 * A JavaScript callable that is passed the source model row index as first argument and the value
53 * of filterRole as second argument. The callable's return value is evaluated as boolean to determine
54 * whether the row is accepted (true) or filtered out (false). It overrides the default implementation
56 * ignored. Attempts to write a non-callable to this property are silently ignored, but you can set
59 Q_PROPERTY(QJSValue filterCallback READ filterCallback WRITE setFilterCallback NOTIFY filterCallbackChanged REVISION 1)
209 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
210 QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
Filter and sort an existing QAbstractItemModel.
Definition datamodel.h:33
QML_ELEMENTQAbstractItemModel * sourceModel
The source model of this sorting proxy model.
Definition datamodel.h:39
Q_INVOKABLE QVariantMap get(int i) const
Returns the item at index in the list model.
Definition datamodel.cpp:191
QString filterRole
The role of the sourceModel on which filterRegExp must be applied.
Definition datamodel.h:64
QString filterRegExp
The regular expression for the filter, only items with their filterRole matching filterRegExp will be...
Definition datamodel.h:44
QJSValue filterCallback
A JavaScript callable that is passed the source model row index as first argument and the value of fi...
Definition datamodel.h:59
QString filterString
The string for the filter, only items with their filterRole matching filterString will be displayed.
Definition datamodel.h:49
void sourceModelChanged()
Q_INVOKABLEQ_INVOKABLE
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_REVISIONQ_REVISION
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
virtual int columnCount(const QModelIndex &parent) const const override
virtual QVariant data(const QModelIndex &index, int role) const const override
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const const override
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
virtual int rowCount(const QModelIndex &parent) const const override
DataSource
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.