PlasmaCore
datamodel.cpp
Go to the documentation of this file.
197 if (!m_sourceFilter.isEmpty() && m_sourceFilterRE.isValid() && !m_sourceFilterRE.exactMatch(sourceName)) {
209 if (!m_sourceFilter.isEmpty() && m_sourceFilterRE.isValid() && !m_sourceFilterRE.exactMatch(i.key())) {
268 connect(m_dataSource, SIGNAL(sourceRemoved(const QString &)), this, SLOT(removeSource(const QString &)));
269 connect(m_dataSource, SIGNAL(sourceDisconnected(const QString &)), this, SLOT(removeSource(const QString &)));
337 //better than a model reset because doesn't cause deletion and re-creation of every list item on a qml ListView, repeaters etc.
402 if (m_items.value(QString())[i].value<QVariantHash>().value("DataEngineSource") == sourceName) {
442 //also, if each source is an item DataEngineSource is a role between all the others, otherwise we know it from the role variable
447 return m_items.value(source).value(actualRow).value<QVariantHash>().value(m_roleNames.value(role));
449 return m_items.value(source).value(actualRow).value<QVariantMap>().value(m_roleNames.value(role));
void setFilterRole(const QString &role)
Definition: datamodel.cpp:107
Q_INVOKABLE QVariantHash get(int i) const
Returns the item at index in the list model.
Definition: datamodel.cpp:498
void setSourceFilter(const QString &key)
Include only sources that matches this regexp in the model.
Definition: datamodel.cpp:299
QObject * dataSource() const
QString sortRole() const
void filterRegExpChanged(const QString &)
QString filterRegExp() const
QModelIndex parent(const QModelIndex &child) const
Definition: datamodel.cpp:471
void countChanged()
Q_INVOKABLE QVariantHash get(int i) const
Returns the item at index in the list model.
Definition: datamodel.cpp:143
QString keyRoleFilter() const
void setKeyRoleFilter(const QString &key)
Include only items with a key that matches this regexp in the model.
Definition: datamodel.cpp:277
void countChanged()
Q_INVOKABLE int mapRowToSource(int i) const
Definition: datamodel.cpp:156
int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: datamodel.cpp:478
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: datamodel.cpp:453
Q_INVOKABLE int mapRowFromSource(int i) const
Definition: datamodel.cpp:162
void setSortOrder(const Qt::SortOrder order)
Definition: datamodel.cpp:134
QVariant data(const QModelIndex &index, int role) const
Definition: datamodel.cpp:419
void setItems(const QString &sourceName, const QVariantList &list)
Definition: datamodel.cpp:321
QString filterRole() const
void sourceModelChanged(QObject *)
QAbstractItemModel sourceModel
The source model of this sorting proxy model.
Definition: datamodel.h:44
void setSortRole(const QString &role)
Definition: datamodel.cpp:118
QString sourceFilter() const
void setModel(QAbstractItemModel *source)
Definition: datamodel.cpp:73
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: datamodel.cpp:462
Definition: datasource.h:42
void sortOrderChanged(const Qt::SortOrder)
void setFilterRegExp(const QString &exp)
Definition: datamodel.cpp:93
int roleNameToId(const QString &name)
Definition: datamodel.cpp:65
int columnCount(const QModelIndex &parent=QModelIndex()) const
Definition: datamodel.cpp:489
SortFilterModel(QObject *parent=0)
Definition: datamodel.cpp:30
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:02:42 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:02:42 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.