10#ifndef PERSONS_MODEL_H
11#define PERSONS_MODEL_H
13#include <kpeople/kpeople_export.h>
17#include <QAbstractItemModel>
24class PersonsModelPrivate;
37 Q_PROPERTY(
bool isInitialized READ isInitialized NOTIFY modelInitialized)
40 FormattedNameRole = Qt::DisplayRole,
41 PhotoRole = Qt::DecorationRole,
42 PersonUriRole = Qt::UserRole,
50 UserRole = Qt::UserRole + 0x1000,
58 int columnCount(
const QModelIndex &parent = QModelIndex())
const override;
59 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const override;
60 QModelIndex index(
int row,
int column = 0,
const QModelIndex &parent = QModelIndex())
const override;
61 QModelIndex parent(
const QModelIndex &index)
const override;
62 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
63 QHash<int, QByteArray> roleNames()
const override;
72 Q_SCRIPTABLE QVariant
get(
int row,
int role);
88 QScopedPointer<PersonsModelPrivate>
const d_ptr;
This class creates a model of all known contacts from all sources Contacts are represented as a tree ...
Definition personsmodel.h:34
void modelInitialized(bool success)
Will emit when the model is finally initialized.
QVariant contactCustomProperty(const QModelIndex &index, const QString &key) const
Makes it possible to access custom properties that are not available to the model.
QModelIndex indexForPersonUri(const QString &personUri) const
bool isInitialized() const
Returns if all the backends have been initialized yet.
QVariant get(int row, int role)
Helper class to ease model access through QML.
Role
Definition personsmodel.h:39
@ PhotoImageProviderUri
Provide a URL to use with QtQuick's Image.source, similar to the Photo Role.
Definition personsmodel.h:48
@ PhoneNumberRole
groups QStringList
Definition personsmodel.h:47