• Skip to content
  • Skip to link menu
KDE API Documentation - KPeople::PersonsModel Class Reference (KPeople)
  • KDE Home
  • Contact Us
 

KPeople

  • View on LXR
  • Comments
  • KPeople
  • PersonsModel
Public Types | Signals | Public Member Functions | Properties | List of all members
KPeople::PersonsModel Class Reference

#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

enum KPeople::PersonsModel::Role
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 the key

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.

void KPeople::PersonsModel::modelInitialized ( bool  success)
signal

Will emit when the model is finally initialized.

success will specify if it succeeded

Property Documentation

bool PersonsModel::isInitialized
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:
  • personsmodel.h
  • personsmodel.cpp
This file is part of the KDE documentation.
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.

KPeople

Skip menu "KPeople"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • File List

Class Picker

Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal