Search for usage in LXR

#include <KAboutPerson>


QUrl avatarUrl
QString emailAddress
QString name
QString task
QString webAddress

Public Member Functions

 KAboutPerson (const KAboutPerson &other)
 KAboutPerson (const QString &name=QString(), const QString &task=QString(), const QString &emailAddress=QString(), const QString &webAddress=QString(), const QUrl &avatarUrl=QUrl())
QUrl avatarUrl () const
QString emailAddress () const
QString name () const
KAboutPersonoperator= (const KAboutPerson &other)
QString task () const
QString webAddress () const

Static Public Member Functions

static KAboutPerson fromJSON (const QJsonObject &obj)

Detailed Description

This class is used to store information about a person or developer. It can store the person's name, a task, an email address and a link to a home page. This class is intended for use in the KAboutData class, but it can be used elsewhere as well. Normally you should at least define the person's name. Creating a KAboutPerson object by yourself is relatively useless, but the KAboutData methods KAboutData::authors() and KAboutData::credits() return lists of KAboutPerson data objects which you can examine.

Example usage within a main(), retrieving the list of people involved with a program and re-using data from one of them:

KAboutData about("khello", i18n("KHello"), "0.1",
i18n("A KDE version of Hello, world!"),
i18n("Copyright (C) 2014 Developer"));
about.addAuthor(i18n("Joe Developer"), i18n("developer"), "joe@host.com", 0);
QList<KAboutPerson> people = about.authors();
about.addCredit(people[0].name(), people[0].task());

Definition at line 63 of file kaboutdata.h.

Constructor & Destructor Documentation

◆ KAboutPerson() [1/2]

KAboutPerson::KAboutPerson ( const QString name = QString(),
const QString task = QString(),
const QString emailAddress = QString(),
const QString webAddress = QString(),
const QUrl avatarUrl = QUrl() 

Convenience constructor.

nameThe name of the person.
taskThe task of this person.
emailAddressThe email address of the person.
webAddressHome page of the person.
avatarUrlURL to the avatar of the person, since 6.0

name default argument


Definition at line 46 of file kaboutdata.cpp.

◆ KAboutPerson() [2/2]

KAboutPerson::KAboutPerson ( const KAboutPerson other)

Copy constructor.

Performs a deep copy.

otherobject to copy

Member Function Documentation

◆ avatarUrl()

QUrl KAboutPerson::avatarUrl ( ) const
an URL pointing to the user's avatar

◆ emailAddress()

QString KAboutPerson::emailAddress ( ) const

The person's email address.

the person's email address (can be QString(), if it has been constructed with an empty email)

◆ fromJSON()

KAboutPerson KAboutPerson::fromJSON ( const QJsonObject obj)

Creates a KAboutPerson from a JSON object with the following structure:

Key Accessor
Name name()
Email emailAddress()
Task task()
Website webAddress()
AvatarUrl avatarUrl()

The Name and Task key are translatable (by using e.g. a "Task[de_DE]" key) The AvatarUrl exists since version 6.0


Definition at line 94 of file kaboutdata.cpp.

◆ name()

QString KAboutPerson::name ( ) const

The person's name.

the person's name (can be QString(), if it has been constructed with an empty name)

◆ operator=()

KAboutPerson & KAboutPerson::operator= ( const KAboutPerson other)

Assignment operator.

Performs a deep copy.

otherobject to copy

◆ task()

QString KAboutPerson::task ( ) const

The person's task.

the person's task (can be QString(), if it has been constructed with an empty task)

◆ webAddress()

QString KAboutPerson::webAddress ( ) const

The home page or a relevant link.

the persons home page (can be QString(), if it has been constructed with an empty home page)

The documentation for this class was generated from the following files:
QString i18n(const char *text, const TYPE &arg...)
Holds information needed by the "About" box and other classes.
Definition: kaboutdata.h:547
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Thu Feb 15 2024 04:01:38 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.