KIdentityManagementCore::IdentityModel Class

class KIdentityManagementCore::IdentityModel

The IdentityModel class. More...

Header: #include <KIdentityManagementCore/IdentityModel>
CMake: find_package(KPim6IdentityManagementCore REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::IdentityManagementCore)
Inherits: QAbstractListModel

Public Types

enum Roles { EmailRole, UoidRole, IdentityNameRole, DisplayNameRole, DefaultRole }

Public Functions

IdentityModel(QObject *parent = nullptr)
virtual ~IdentityModel() override
QString email(uint uoid)

Reimplemented Public Functions

virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
virtual QHash<int, QByteArray> roleNames() const override
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override

Detailed Description

Author: Laurent Montel <montel@kde.org>

Member Type Documentation

enum IdentityModel::Roles

Custom data roles provided by the model.

ConstantValueDescription
KIdentityManagementCore::IdentityModel::EmailRoleQt::UserRoleThe primary email address of the identity
KIdentityManagementCore::IdentityModel::UoidRole257The unique object identifier of the identity
KIdentityManagementCore::IdentityModel::IdentityNameRole258The name of the identity
KIdentityManagementCore::IdentityModel::DisplayNameRole259The name used to display the identity
KIdentityManagementCore::IdentityModel::DefaultRole260Whether the identity is the default one

Member Function Documentation

[explicit] IdentityModel::IdentityModel(QObject *parent = nullptr)

Constructor parent the parent object

[override virtual noexcept] IdentityModel::~IdentityModel()

Destructor

[override virtual] QVariant IdentityModel::data(const QModelIndex &index, int role = Qt::DisplayRole) const

Reimplements: QAbstractItemModel::data(const QModelIndex &index, int role) const.

Gets the data for the given model index index the model index to get data for role the data role to retrieve Returns the data at the given index for the specified role

[invokable] QString IdentityModel::email(uint uoid)

Returns the email address of the identity with the given uoid uoid the unique object identifier for the identity in question Returns the email address for the identity

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

[override virtual] QHash<int, QByteArray> IdentityModel::roleNames() const

Reimplements: QAbstractItemModel::roleNames() const.

Returns the role names for the model Returns a hash of role names

[override virtual] int IdentityModel::rowCount(const QModelIndex &parent = QModelIndex()) const

Reimplements: QAbstractItemModel::rowCount(const QModelIndex &parent) const.

Returns the number of rows under the given parent parent the parent model index Returns the number of rows