KPeople
#include <personsmodel.h>
Inherits QAbstractItemModel.
Public Types | |
enum | Role { FormattedNameRole = Qt::DisplayRole, PhotoRole = Qt::DecorationRole, PersonUriRole = Qt::UserRole, PersonVCardRole, ContactsVCardRole, GroupsRole, UserRole = Qt::UserRole + 0x1000 } |
Signals | |
void | modelInitialized (bool success) |
Public Member Functions | |
PersonsModel (QObject *parent=0) | |
virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
QVariant | contactCustomProperty (const QModelIndex &index, const QString &key) const |
virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
Q_SCRIPTABLE QVariant | get (int row, int role) |
virtual QModelIndex | index (int row, int column=0, const QModelIndex &parent=QModelIndex()) const override |
QModelIndex | indexForPersonUri (const QString &personUri) const |
bool | isInitialized () const |
virtual QModelIndex | parent (const QModelIndex &index) const override |
virtual QHash< int, QByteArray > | roleNames () const override |
virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
Properties | |
bool | isInitialized |
Detailed Description
This class creates a model of all known contacts from all sources Contacts are represented as a tree where the top level represents a "person" which is an amalgamation of all the sub-contacts.
Definition at line 42 of file personsmodel.h.
Member Enumeration Documentation
Enumerator | |
---|---|
UserRole |
groups QStringList in case it's needed to extend, use this one to start from |
Definition at line 48 of file personsmodel.h.
Member Function Documentation
QVariant PersonsModel::contactCustomProperty | ( | const QModelIndex & | index, |
const QString & | key | ||
) | const |
Makes it possible to access custom properties that are not available to the model.
- Returns
- the property for the contact at
index
defined by thekey
Definition at line 477 of file personsmodel.cpp.
QVariant PersonsModel::get | ( | int | row, |
int | role | ||
) |
Helper class to ease model access through QML.
Definition at line 472 of file personsmodel.cpp.
QModelIndex PersonsModel::indexForPersonUri | ( | const QString & | personUri | ) | const |
- Returns
- the index for a given
personUri
Definition at line 466 of file personsmodel.cpp.
bool KPeople::PersonsModel::isInitialized | ( | ) | const |
Returns if all the backends have been initialized yet.
|
signal |
Will emit when the model is finally initialized.
success
will specify if it succeeded
Property Documentation
|
read |
specifies whether the model has already been initialized
Definition at line 46 of file personsmodel.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2015 The KDE developers.
Generated on Fri Feb 13 2015 15:16:39 by doxygen 1.8.9.1 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.