KAboutData

Search for usage in LXR

#include <KAboutData>

Properties

QList< KAboutPersonauthors
 
QString bugAddress
 
QString componentName
 
QList< KAboutComponentcomponents
 
QString copyrightStatement
 
QList< KAboutPersoncredits
 
QString desktopFileName
 
QString displayName
 
QString homepage
 
QList< KAboutLicenselicenses
 
QString otherText
 
QString productName
 
QVariant programLogo
 
QString shortDescription
 
QList< KAboutPersontranslators
 
QString version
 

Public Member Functions

 KAboutData (const KAboutData &other)
 
 KAboutData (const QString &componentName, const QString &displayName, const QString &version, const QString &shortDescription, enum KAboutLicense::LicenseKey licenseType, const QString &copyrightStatement=QString(), const QString &otherText=QString(), const QString &homePageAddress=QString(), const QString &bugAddress=QStringLiteral("submit@bugs.kde.org"))
 
 KAboutData (const QString &componentName={}, const QString &displayName={}, const QString &version={})
 
KAboutDataaddAuthor (const KAboutPerson &author)
 
KAboutDataaddAuthor (const QString &name, const QString &task, const QString &emailAddress, const QString &webAddress, const QString &kdeStoreUsername)
 
KAboutDataaddAuthor (const QString &name, const QString &task=QString(), const QString &emailAddress=QString(), const QString &webAddress=QString(), const QUrl &avatarUrl=QUrl())
 
KAboutDataaddComponent (const KAboutComponent &component)
 
KAboutDataaddComponent (const QString &name, const QString &description, const QString &version, const QString &webAddress, const QString &pathToLicenseFile)
 
KAboutDataaddComponent (const QString &name, const QString &description=QString(), const QString &version=QString(), const QString &webAddress=QString(), KAboutLicense::LicenseKey licenseKey=KAboutLicense::Unknown)
 
KAboutDataaddCredit (const KAboutPerson &person)
 
KAboutDataaddCredit (const QString &name, const QString &task, const QString &emailAddress, const QString &webAddress, const QString &kdeStoreUsername)
 
KAboutDataaddCredit (const QString &name, const QString &task=QString(), const QString &emailAddress=QString(), const QString &webAddress=QString(), const QUrl &avatarUrl=QUrl())
 
KAboutDataaddLicense (KAboutLicense::LicenseKey licenseKey)
 
KAboutDataaddLicense (KAboutLicense::LicenseKey licenseKey, KAboutLicense::VersionRestriction versionRestriction)
 
KAboutDataaddLicenseText (const QString &license)
 
KAboutDataaddLicenseTextFile (const QString &file)
 
QList< KAboutPersonauthors () const
 
QString bugAddress () const
 
QString componentName () const
 
QList< KAboutComponentcomponents () const
 
QString copyrightStatement () const
 
QList< KAboutPersoncredits () const
 
QString customAuthorPlainText () const
 
QString customAuthorRichText () const
 
bool customAuthorTextEnabled () const
 
QString desktopFileName () const
 
QString displayName () const
 
QString homepage () const
 
const char * internalBugAddress () const
 
const char * internalProductName () const
 
const char * internalProgramName () const
 
const char * internalVersion () const
 
QList< KAboutLicenselicenses () const
 
KAboutDataoperator= (const KAboutData &other)
 
QString organizationDomain () const
 
QString otherText () const
 
void processCommandLine (QCommandLineParser *parser)
 
QString productName () const
 
QVariant programLogo () const
 
KAboutDatasetBugAddress (const QByteArray &bugAddress)
 
KAboutDatasetComponentName (const QString &componentName)
 
KAboutDatasetCopyrightStatement (const QString &copyrightStatement)
 
KAboutDatasetCustomAuthorText (const QString &plainText, const QString &richText)
 
KAboutDatasetDesktopFileName (const QString &desktopFileName)
 
KAboutDatasetDisplayName (const QString &displayName)
 
KAboutDatasetHomepage (const QString &homepage)
 
KAboutDatasetLicense (KAboutLicense::LicenseKey licenseKey)
 
KAboutDatasetLicense (KAboutLicense::LicenseKey licenseKey, KAboutLicense::VersionRestriction versionRestriction)
 
KAboutDatasetLicenseText (const QString &license)
 
KAboutDatasetLicenseTextFile (const QString &file)
 
KAboutDatasetOrganizationDomain (const QByteArray &domain)
 
KAboutDatasetOtherText (const QString &otherText)
 
KAboutDatasetProductName (const QByteArray &name)
 
KAboutDatasetProgramLogo (const QVariant &image)
 
KAboutDatasetShortDescription (const QString &shortDescription)
 
KAboutDatasetTranslator (const QString &name, const QString &emailAddress)
 
bool setupCommandLine (QCommandLineParser *parser)
 
KAboutDatasetVersion (const QByteArray &version)
 
QString shortDescription () const
 
QList< KAboutPersontranslators () const
 
KAboutDataunsetCustomAuthorText ()
 
QString version () const
 

Static Public Member Functions

static QString aboutTranslationTeam ()
 
static KAboutData applicationData ()
 
static void setApplicationData (const KAboutData &aboutData)
 

Detailed Description

This class is used to store information about a program or plugin.

It can store such values as version number, program name, home page, address for bug reporting, multiple authors and contributors (using KAboutPerson), license and copyright information.

Currently, the values set here are shown by the "About" box (see KAboutApplicationDialog), used by the bug report dialog (see KBugReport), and by the help shown on command line (see KAboutData::setupCommandLine()).

Porting Notes: Since KDE Frameworks 5.0, the translation catalog mechanism must be provided by your translation framework to load the correct catalog instead (eg: KLocalizedString::setApplicationDomain() for KI18n, or QCoreApplication::installTranslator() for Qt's translation system). This applies to the old setCatalogName() and catalogName() members. But see also K4AboutData in kde4support as a compatibility class.

Example: Setting the metadata of an application using KAboutData in code also relying on the KDE Framework modules KI18n and KDBusAddons:

// create QApplication instance
QApplication app(argc, argv);
// setup translation string domain for the i18n calls
// create a KAboutData object to use for setting the application metadata
KAboutData aboutData("foo", i18n("Foo"), "0.1",
i18n("To Foo or not To Foo"),
i18n("Copyright 2017 Bar Foundation"), QString(),
"https://www.foo-the-app.net");
// overwrite default-generated values of organizationDomain & desktopFileName
aboutData.setOrganizationDomain("barfoundation.org");
aboutData.setDesktopFileName("org.barfoundation.foo");
// set the application metadata
// in GUI apps set the window icon manually, not covered by KAboutData
// needed for environments where the icon name is not extracted from
// the information in the application's desktop file
// integrate with commandline argument handling
aboutData.setupCommandLine(&parser);
// setup of app specific commandline args
[...]
parser.process(app);
aboutData.processCommandLine(&parser);
// with the application metadata set, register to the D-Bus session
This class is used to store information about a program or plugin.
Definition kaboutdata.h:548
static void setApplicationData(const KAboutData &aboutData)
Sets the application data for this application.
static void setApplicationDomain(const QByteArray &domain)
QString i18n(const char *text, const TYPE &arg...)
void process(const QCoreApplication &app)
void setWindowIcon(const QIcon &icon)
QIcon fromTheme(const QString &name)

Holds information needed by the "About" box and other classes.

Author
Espen Sand (espen.nosp@m.@kde.nosp@m..org), David Faure (faure.nosp@m.@kde.nosp@m..org)

Definition at line 547 of file kaboutdata.h.

Property Documentation

◆ authors

QList<KAboutPerson> KAboutData::authors
read

Definition at line 559 of file kaboutdata.h.

◆ bugAddress

QString KAboutData::bugAddress
read

Definition at line 556 of file kaboutdata.h.

◆ componentName

QString KAboutData::componentName
read

Definition at line 552 of file kaboutdata.h.

◆ components

QList<KAboutComponent> KAboutData::components
read

Definition at line 562 of file kaboutdata.h.

◆ copyrightStatement

QString KAboutData::copyrightStatement
read

Definition at line 564 of file kaboutdata.h.

◆ credits

QList<KAboutPerson> KAboutData::credits
read

Definition at line 560 of file kaboutdata.h.

◆ desktopFileName

QString KAboutData::desktopFileName
read

Definition at line 565 of file kaboutdata.h.

◆ displayName

QString KAboutData::displayName
read

Definition at line 550 of file kaboutdata.h.

◆ homepage

QString KAboutData::homepage
read

Definition at line 555 of file kaboutdata.h.

◆ licenses

QList<KAboutLicense> KAboutData::licenses
read

Definition at line 563 of file kaboutdata.h.

◆ otherText

QString KAboutData::otherText
read

Definition at line 558 of file kaboutdata.h.

◆ productName

QString KAboutData::productName
read

Definition at line 551 of file kaboutdata.h.

◆ programLogo

QVariant KAboutData::programLogo
read

Definition at line 553 of file kaboutdata.h.

◆ shortDescription

QString KAboutData::shortDescription
read

Definition at line 554 of file kaboutdata.h.

◆ translators

QList<KAboutPerson> KAboutData::translators
read

Definition at line 561 of file kaboutdata.h.

◆ version

QString KAboutData::version
read

Definition at line 557 of file kaboutdata.h.

Constructor & Destructor Documentation

◆ KAboutData() [1/3]

KAboutData::KAboutData ( const QString & componentName,
const QString & displayName,
const QString & version,
const QString & shortDescription,
enum KAboutLicense::LicenseKey licenseType,
const QString & copyrightStatement = QString(),
const QString & otherText = QString(),
const QString & homePageAddress = QString(),
const QString & bugAddress = QStringLiteral("submit@bugs.kde.org") )

Constructor.

Porting Note: The catalogName parameter present in KDE4 was deprecated and removed. See also K4AboutData in kde4support if this feature is needed for compatibility purposes, or consider using componentName() instead.

Parameters
componentNameThe program name or plugin name used internally. Example: QStringLiteral("kwrite"). This should never be translated.
displayNameA displayable name for the program or plugin. This string should be translated. Example: i18n("KWrite")
versionThe component version string. Example: QStringLiteral("1.0").
shortDescriptionA short description of what the component does. This string should be translated. Example: i18n("A simple text editor.")
licenseTypeThe license identifier. Use setLicenseText or setLicenseTextFile if you use a license not predefined here.
copyrightStatementA copyright statement, that can look like this: i18n("Copyright (C) 1999-2000 Name"). The string specified here is taken verbatim; the author information from addAuthor is not used.
otherTextSome free form text, that can contain any kind of information. The text can contain newlines. This string should be translated.
homePageAddressThe URL to the component's homepage, including URL scheme. "http://some.domain" is correct, "some.domain" is not. Since KDE Frameworks 5.17, https and other valid URL schemes are also valid. See also the note below.
bugAddressThe bug report address string, an email address or a URL. This defaults to the kde.org bug system.
Note
The homePageAddress argument is used to derive a default organization domain for the application (which is used to register on the session D-Bus, locate the appropriate desktop file, etc.), by taking the host name and dropping the first component, unless there are less than three (e.g. "www.kde.org" -> "kde.org"). Use both setOrganizationDomain(const QByteArray&) and setDesktopFileName() if their default values do not have proper values.
See also
setOrganizationDomain(const QByteArray&), setDesktopFileName(const QString&)

Definition at line 511 of file kaboutdata.cpp.

◆ KAboutData() [2/3]

KAboutData::KAboutData ( const QString & componentName = {},
const QString & displayName = {},
const QString & version = {} )
explicit

Constructor.

Parameters
componentNameThe program name or plugin name used internally. Example: "kwrite".
displayNameA displayable name for the program or plugin. This string should be translated. Example: i18n("KWrite")
versionThe component version string.

Sets the property desktopFileName to "org.kde."+componentName and the property organizationDomain to "kde.org".

Default arguments

Since
5.53
See also
setOrganizationDomain(const QByteArray&), setDesktopFileName(const QString&)

Definition at line 566 of file kaboutdata.cpp.

◆ KAboutData() [3/3]

KAboutData::KAboutData ( const KAboutData & other)

Copy constructor.

Performs a deep copy.

Parameters
otherobject to copy

Definition at line 592 of file kaboutdata.cpp.

Member Function Documentation

◆ aboutTranslationTeam()

QString KAboutData::aboutTranslationTeam ( )
static

Returns a message about the translation team.

Returns
a message about the translation team

Definition at line 932 of file kaboutdata.cpp.

◆ addAuthor() [1/3]

KAboutData & KAboutData::addAuthor ( const KAboutPerson & author)

Add an author.

You can call this function as many times as you need. Each entry is appended to a list.

Parameters
authorThe author.
Since
6.9

Definition at line 620 of file kaboutdata.cpp.

◆ addAuthor() [2/3]

KAboutData & KAboutData::addAuthor ( const QString & name,
const QString & task,
const QString & emailAddress,
const QString & webAddress,
const QString & kdeStoreUsername )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Since
6.0

Definition at line 737 of file kaboutdata.h.

◆ addAuthor() [3/3]

KAboutData & KAboutData::addAuthor ( const QString & name,
const QString & task = QString(),
const QString & emailAddress = QString(),
const QString & webAddress = QString(),
const QUrl & avatarUrl = QUrl() )

Defines an author.

You can call this function as many times as you need. Each entry is appended to a list. The person in the first entry is assumed to be the leader of the project.

Parameters
nameThe developer's name. It should be translated.
taskWhat the person is responsible for. This text can contain newlines. It should be translated. Can be left empty.
emailAddressAn Email address where the person can be reached. Can be left empty.
webAddressThe person's homepage or a relevant link. Start the address with "http://". "http://some.domain" is correct, "some.domain" is not. Can be left empty.
avatarUrlURL to the avatar of the person

Definition at line 614 of file kaboutdata.cpp.

◆ addComponent() [1/3]

KAboutData & KAboutData::addComponent ( const KAboutComponent & component)

Add a component that is used by the application.

You can call this function as many times as you need. Each entry is appended to a list.

Parameters
componentThe component
Since
6.9

Definition at line 644 of file kaboutdata.cpp.

◆ addComponent() [2/3]

KAboutData & KAboutData::addComponent ( const QString & name,
const QString & description,
const QString & version,
const QString & webAddress,
const QString & pathToLicenseFile )

Defines a component that is used by the application with a custom license text file.

You can call this function as many times as you need. Each entry is appended to a list.

Parameters
nameThe component's name. It should be translated.
descriptionShort description of the component and maybe copyright info. This text can contain newlines. It should be translated. Can be left empty.
versionThe version of the component. Can be left empty.
webAddressThe component's homepage or a relevant link. Start the address with "http://". "http://some.domain" is correct, "some.domain" is not. Can be left empty.
pathToLicenseFilePath to the file in the local filesystem containing the license text. The file format has to be plain text in an encoding compatible to the local.
Since
5.84

Definition at line 661 of file kaboutdata.cpp.

◆ addComponent() [3/3]

KAboutData & KAboutData::addComponent ( const QString & name,
const QString & description = QString(),
const QString & version = QString(),
const QString & webAddress = QString(),
KAboutLicense::LicenseKey licenseKey = KAboutLicense::Unknown )

Defines a component that is used by the application.

You can call this function as many times as you need. Each entry is appended to a list.

Parameters
nameThe component's name. It should be translated.
descriptionShort description of the component and maybe copyright info. This text can contain newlines. It should be translated. Can be left empty.
versionThe version of the component. Can be left empty.
webAddressThe component's homepage or a relevant link. Start the address with "http://". "http://some.domain" is correct, "some.domain" is not. Can be left empty.
licenseKeyThe component's license identifier. Can be left empty (i.e. KAboutLicense::Unknown)
Since
5.84

Definition at line 650 of file kaboutdata.cpp.

◆ addCredit() [1/3]

KAboutData & KAboutData::addCredit ( const KAboutPerson & person)

Add a person that deserves credit.

You can call this function as many times as you need. Each entry is appended to a list.

Parameters
personThe person.
Since
6.9

Definition at line 626 of file kaboutdata.cpp.

◆ addCredit() [2/3]

KAboutData & KAboutData::addCredit ( const QString & name,
const QString & task,
const QString & emailAddress,
const QString & webAddress,
const QString & kdeStoreUsername )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Since
6.0

Definition at line 784 of file kaboutdata.h.

◆ addCredit() [3/3]

KAboutData & KAboutData::addCredit ( const QString & name,
const QString & task = QString(),
const QString & emailAddress = QString(),
const QString & webAddress = QString(),
const QUrl & avatarUrl = QUrl() )

Defines a person that deserves credit.

You can call this function as many times as you need. Each entry is appended to a list.

Parameters
nameThe person's name. It should be translated.
taskWhat the person has done to deserve the honor. The text can contain newlines. It should be translated. Can be left empty.
emailAddressAn email address when the person can be reached. Can be left empty.
webAddressThe person's homepage or a relevant link. Start the address with "http://". "http://some.domain" is is correct, "some.domain" is not. Can be left empty.
avatarUrlURL to the avatar of the person

Definition at line 632 of file kaboutdata.cpp.

◆ addLicense() [1/2]

KAboutData & KAboutData::addLicense ( KAboutLicense::LicenseKey licenseKey)

Adds a license identifier.

If there is only one unknown license set, e.g. by using the default parameter in the constructor, that one is replaced.

Parameters
licenseKeyThe license identifier.
See also
setLicenseText, addLicenseText, addLicenseTextFile

Definition at line 746 of file kaboutdata.cpp.

◆ addLicense() [2/2]

KAboutData & KAboutData::addLicense ( KAboutLicense::LicenseKey licenseKey,
KAboutLicense::VersionRestriction versionRestriction )

Adds a license identifier.

If there is only one unknown license set, e.g. by using the default parameter in the constructor, that one is replaced.

Parameters
licenseKeyThe license identifier.
versionRestrictionWhether later versions of the license are also allowed. e.g. licensed under "GPL 2.0 or at your option later versions" would be OrLaterVersions.
See also
setLicenseText, addLicenseText, addLicenseTextFile
Since
5.37

Definition at line 751 of file kaboutdata.cpp.

◆ addLicenseText()

KAboutData & KAboutData::addLicenseText ( const QString & license)

Adds a license text, which is translated.

If there is only one unknown license set, e.g. by using the default parameter in the constructor, that one is replaced.

Example:

addLicenseText( i18n("This is my license") );
KAboutData & addLicenseText(const QString &license)
Adds a license text, which is translated.
Parameters
licenseThe license text.
See also
setLicenseText, addLicense, addLicenseTextFile

Definition at line 674 of file kaboutdata.cpp.

◆ addLicenseTextFile()

KAboutData & KAboutData::addLicenseTextFile ( const QString & file)

Adds a license text by pointing to a file where it resides.

The file format has to be plain text in an encoding compatible to the locale.

If there is only one unknown license set, e.g. by using the default parameter in the constructor, that one is replaced.

Parameters
filePath to the file in the local filesystem containing the license text.
See also
addLicenseText, addLicense, setLicenseTextFile

Definition at line 696 of file kaboutdata.cpp.

◆ applicationData()

KAboutData KAboutData::applicationData ( )
static

Returns the KAboutData for the application.

This contains information such as authors, license, etc., provided that setApplicationData has been called before. If not called before, the returned KAboutData will be initialized from the equivalent properties of QCoreApplication (and its subclasses), if an instance of that already exists. For the list of such properties see setApplicationData (before 5.22: limited to QCoreApplication::applicationName).

See also
setApplicationData

Definition at line 1056 of file kaboutdata.cpp.

◆ authors()

QList< KAboutPerson > KAboutData::authors ( ) const

Returns a list of authors.

Returns
author information (list of persons).

Definition at line 885 of file kaboutdata.cpp.

◆ bugAddress()

QString KAboutData::bugAddress ( ) const

Returns the email address or URL for bugs.

Returns
the address where to report bugs.

Definition at line 864 of file kaboutdata.cpp.

◆ componentName()

QString KAboutData::componentName ( ) const

Returns the application's internal name.

Returns
the internal program name.

Definition at line 799 of file kaboutdata.cpp.

◆ components()

QList< KAboutComponent > KAboutData::components ( ) const

Returns a list of components.

Returns
component information (list of components).
Since
5.84

Definition at line 947 of file kaboutdata.cpp.

◆ copyrightStatement()

QString KAboutData::copyrightStatement ( ) const

Returns the copyright statement.

Returns
the copyright statement. Can be QString() if not set.

Definition at line 957 of file kaboutdata.cpp.

◆ credits()

QList< KAboutPerson > KAboutData::credits ( ) const

Returns a list of persons who contributed.

Returns
credit information (list of persons).

Definition at line 890 of file kaboutdata.cpp.

◆ customAuthorPlainText()

QString KAboutData::customAuthorPlainText ( ) const

Returns the plain text displayed around the list of authors instead of the default message telling users to send bug reports to bugAddress().

Returns
the plain text displayed around the list of authors instead of the default message. Can be QString().

Definition at line 962 of file kaboutdata.cpp.

◆ customAuthorRichText()

QString KAboutData::customAuthorRichText ( ) const

Returns the rich text displayed around the list of authors instead of the default message telling users to send bug reports to bugAddress().

Returns
the rich text displayed around the list of authors instead of the default message. Can be QString().

Definition at line 967 of file kaboutdata.cpp.

◆ customAuthorTextEnabled()

bool KAboutData::customAuthorTextEnabled ( ) const

Returns whether custom text should be displayed around the list of authors.

Returns
whether custom text should be displayed around the list of authors.

Definition at line 972 of file kaboutdata.cpp.

◆ desktopFileName()

QString KAboutData::desktopFileName ( ) const
Returns
The desktop file name of this application (e.g. "org.kde.foo")
See also
setDesktopFileName(const QString&)
Since
5.16

Definition at line 1004 of file kaboutdata.cpp.

◆ displayName()

QString KAboutData::displayName ( ) const

Returns the translated program name.

Returns
the program name (translated).

Definition at line 817 of file kaboutdata.cpp.

◆ homepage()

QString KAboutData::homepage ( ) const

Returns the application homepage.

Returns
the application homepage URL. Can be QString() if not set.

Definition at line 859 of file kaboutdata.cpp.

◆ internalBugAddress()

const char * KAboutData::internalBugAddress ( ) const

Provided for use by KCrash

Return the untranslated and uninterpreted (to UTF8) string for the bug mail address. Used in particular for KCrash.

Definition at line 877 of file kaboutdata.cpp.

◆ internalProductName()

const char * KAboutData::internalProductName ( ) const

Provided for use by KCrash

Definition at line 812 of file kaboutdata.cpp.

◆ internalProgramName()

const char * KAboutData::internalProgramName ( ) const

Provided for use by KCrash

Return the program name. It is always pre-allocated. Needed for KCrash in particular.

Definition at line 825 of file kaboutdata.cpp.

◆ internalVersion()

const char * KAboutData::internalVersion ( ) const

Provided for use by KCrash

Return the untranslated and uninterpreted (to UTF8) string for the version information. Used in particular for KCrash.

Definition at line 849 of file kaboutdata.cpp.

◆ licenses()

QList< KAboutLicense > KAboutData::licenses ( ) const

Returns a list of licenses.

Returns
licenses information (list of licenses)

Definition at line 952 of file kaboutdata.cpp.

◆ operator=()

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

Assignment operator.

Performs a deep copy.

Parameters
otherobject to copy

Definition at line 602 of file kaboutdata.cpp.

◆ organizationDomain()

QString KAboutData::organizationDomain ( ) const

Returns the domain name of the organization that wrote this application.

See also
setOrganizationDomain(const QByteArray&)

Definition at line 869 of file kaboutdata.cpp.

◆ otherText()

QString KAboutData::otherText ( ) const

Returns a translated, free form text.

Returns
the free form text (translated). Can be QString() if not set.

Definition at line 942 of file kaboutdata.cpp.

◆ processCommandLine()

void KAboutData::processCommandLine ( QCommandLineParser * parser)

Reads the processed parser and sees if any of the arguments are the ones set up from setupCommandLine().

See also
setupCommandLine()

Definition at line 1174 of file kaboutdata.cpp.

◆ productName()

QString KAboutData::productName ( ) const

Returns the application's product name, which will be used in KBugReport dialog.

By default it returns componentName(), otherwise the one which is set with setProductName()

Returns
the product name.

Definition at line 804 of file kaboutdata.cpp.

◆ programLogo()

QVariant KAboutData::programLogo ( ) const

Returns the program logo image.

Because KAboutData is a core class it cannot use QImage/QPixmap/QIcon directly, so this is a QVariant containing a QImage/QPixmap/QIcon.

Returns
the program logo data, or a null image if there is no custom application logo defined.

Definition at line 830 of file kaboutdata.cpp.

◆ setApplicationData()

void KAboutData::setApplicationData ( const KAboutData & aboutData)
static

Sets the application data for this application.

In addition to changing the result of applicationData(), this initializes the equivalent properties of QCoreApplication (and its subclasses) with information from aboutData, if an instance of that already exists. Those properties are:

See also
applicationData

Definition at line 1113 of file kaboutdata.cpp.

◆ setBugAddress()

KAboutData & KAboutData::setBugAddress ( const QByteArray & bugAddress)

Defines the address where bug reports should be sent.

Parameters
bugAddressThe bug report email address or URL. This defaults to the kde.org bug system.

Definition at line 781 of file kaboutdata.cpp.

◆ setComponentName()

KAboutData & KAboutData::setComponentName ( const QString & componentName)

Defines the component name used internally.

Parameters
componentNameThe application or plugin name. Example: "kate".

Definition at line 710 of file kaboutdata.cpp.

◆ setCopyrightStatement()

KAboutData & KAboutData::setCopyrightStatement ( const QString & copyrightStatement)

Defines the copyright statement to show when displaying the license.

Parameters
copyrightStatementA copyright statement, that can look like this: i18n("Copyright (C) 1999-2000 Name"). The string specified here is taken verbatim; the author information from addAuthor is not used.

Definition at line 763 of file kaboutdata.cpp.

◆ setCustomAuthorText()

KAboutData & KAboutData::setCustomAuthorText ( const QString & plainText,
const QString & richText )

Sets the custom text displayed around the list of authors instead of the default message telling users to send bug reports to bugAddress().

Parameters
plainTextThe plain text.
richTextThe rich text.

Setting both to parameters to QString() will cause no message to be displayed at all. Call unsetCustomAuthorText() to revert to the default message.

Definition at line 977 of file kaboutdata.cpp.

◆ setDesktopFileName()

KAboutData & KAboutData::setDesktopFileName ( const QString & desktopFileName)

Sets the base name of the desktop entry for this application.

This is the file name, without the full path and without extension, of the desktop entry that represents this application according to the freedesktop desktop entry specification (e.g. "org.kde.foo").

A default desktop file name is constructed when the KAboutData object is created, using the reverse domain name of the organizationDomain() and the componentName() as they are at the time of the KAboutData object creation. Call this method to override that default name. Typically this is done when also setOrganizationDomain(const QByteArray&) or setComponentName(const QString&) need to be called to override the initial values.

The desktop file name can also be passed to the application at runtime through the desktopfile command line option which is added by setupCommandLine(QCommandLineParser*). This is useful if an application supports multiple desktop files with different runtime settings.

Parameters
desktopFileNameThe desktop file name of this application
See also
desktopFileName()
organizationDomain()
componentName()
setupCommandLine(QCommandLineParser*)
Since
5.16

Definition at line 997 of file kaboutdata.cpp.

◆ setDisplayName()

KAboutData & KAboutData::setDisplayName ( const QString & displayName)

Defines the displayable component name string.

Parameters
displayNameThe display name. This string should be translated. Example: i18n("Advanced Text Editor").

Definition at line 716 of file kaboutdata.cpp.

◆ setHomepage()

KAboutData & KAboutData::setHomepage ( const QString & homepage)

Defines the program homepage.

Parameters
homepageThe program homepage string. Start the address with "http://". "http://kate.kde.org" is correct but "kate.kde.org" is not.

Definition at line 775 of file kaboutdata.cpp.

◆ setLicense() [1/2]

KAboutData & KAboutData::setLicense ( KAboutLicense::LicenseKey licenseKey)

Defines the license identifier.

Parameters
licenseKeyThe license identifier.
See also
addLicenseText, setLicenseText, setLicenseTextFile

Definition at line 735 of file kaboutdata.cpp.

◆ setLicense() [2/2]

KAboutData & KAboutData::setLicense ( KAboutLicense::LicenseKey licenseKey,
KAboutLicense::VersionRestriction versionRestriction )

Defines the license identifier.

Parameters
licenseKeyThe license identifier.
versionRestrictionWhether later versions of the license are also allowed. e.g. licensed under "GPL 2.0 or at your option later versions" would be OrLaterVersions.
See also
addLicenseText, setLicenseText, setLicenseTextFile
Since
5.37

Definition at line 740 of file kaboutdata.cpp.

◆ setLicenseText()

KAboutData & KAboutData::setLicenseText ( const QString & license)

Defines a license text, which is translated.

Example:

setLicenseText( i18n("This is my license") );
KAboutData & setLicenseText(const QString &license)
Defines a license text, which is translated.
Parameters
licenseThe license text.

Definition at line 667 of file kaboutdata.cpp.

◆ setLicenseTextFile()

KAboutData & KAboutData::setLicenseTextFile ( const QString & file)

Defines a license text by pointing to a file where it resides.

The file format has to be plain text in an encoding compatible to the locale.

Parameters
filePath to the file in the local filesystem containing the license text.

Definition at line 689 of file kaboutdata.cpp.

◆ setOrganizationDomain()

KAboutData & KAboutData::setOrganizationDomain ( const QByteArray & domain)

Defines the domain of the organization that wrote this application.

The domain is set to kde.org by default, or the domain of the homePageAddress constructor argument, if set.

Make sure to call setOrganizationDomain(const QByteArray&) if your product is not developed inside the KDE community.

Used e.g. for the registration to D-Bus done by KDBusService from the KDE Frameworks KDBusAddons module.

Calling this method has no effect on the value of the desktopFileName property.

Note
If your program should work as a D-Bus activatable service, the base name of the D-Bus service description file or of the desktop file you install must match the D-Bus "well-known name" for which the program will register. For example, KDBusService will use a name created from the reversed organization domain with the component name attached, so for an organization domain "bar.org" and a component name "foo" the name of an installed D-Bus service file needs to be "org.bar.foo.service" or the name of the installed desktop file "org.bar.foo.desktop" (and the desktopFileName property accordingly set to "org.bar.foo").
Parameters
domainthe domain name, for instance kde.org, koffice.org, etc.
See also
setDesktopFileName(const QString&)

Definition at line 787 of file kaboutdata.cpp.

◆ setOtherText()

KAboutData & KAboutData::setOtherText ( const QString & otherText)

Defines the additional text to show in the about dialog.

Parameters
otherTextSome free form text, that can contain any kind of information. The text can contain newlines. This string should be translated.

Definition at line 769 of file kaboutdata.cpp.

◆ setProductName()

KAboutData & KAboutData::setProductName ( const QByteArray & name)

Defines the product name which will be used in the KBugReport dialog.

By default it's the componentName, but you can overwrite it here to provide support for special components e.g. in the form 'product/component', such as 'kontact/summary'.

Parameters
nameThe name of product

Definition at line 793 of file kaboutdata.cpp.

◆ setProgramLogo()

KAboutData & KAboutData::setProgramLogo ( const QVariant & image)

Defines the program logo.

Use this if you need to have an application logo in AboutData other than the application icon.

Because KAboutData is a core class it cannot use QImage/QPixmap/QIcon directly, so this is a QVariant that should contain a QImage/QPixmap/QIcon.

QIcon should be preferred, to be able to properly handle HiDPI scaling. If a QIcon is provided, it will be used at a typical size of 48x48.

Parameters
imagelogo image.
See also
programLogo()

Definition at line 835 of file kaboutdata.cpp.

◆ setShortDescription()

KAboutData & KAboutData::setShortDescription ( const QString & shortDescription)

Defines a short description of what the program does.

Parameters
shortDescriptionThe program description. This string should be translated. Example: i18n("An advanced text editor with syntax highlighting support.").

Definition at line 729 of file kaboutdata.cpp.

◆ setTranslator()

KAboutData & KAboutData::setTranslator ( const QString & name,
const QString & emailAddress )

Sets the name(s) of the translator(s) of the GUI.

The canonical use with the ki18n framework is:

setTranslator(i18nc("NAME OF TRANSLATORS", "Your names"),
i18nc("EMAIL OF TRANSLATORS", "Your emails"));
KAboutData & setTranslator(const QString &name, const QString &emailAddress)
Sets the name(s) of the translator(s) of the GUI.
QString i18nc(const char *context, const char *text, const TYPE &arg...)

If you are using a KMainWindow this is done for you automatically.

The name and emailAddress are treated as lists separated with ",".

If the strings are empty or "Your names"/"Your emails" respectively they will be ignored.

Parameters
namethe name(s) of the translator(s)
emailAddressthe email address(es) of the translator(s)
See also
KAboutTranslator

Definition at line 638 of file kaboutdata.cpp.

◆ setupCommandLine()

bool KAboutData::setupCommandLine ( QCommandLineParser * parser)

Configures the parser command line parser to provide an authors entry with information about the developers of the application and an entry specifying the license.

Additionally, it will set the description to the command line parser, will add the help option and if the QApplication has a version set (e.g. via KAboutData::setApplicationData) it will also add the version option.

Since 5.16 it also adds an option to set the desktop file name.

Returns
true if adding the options was successful; otherwise returns false.
See also
processCommandLine()

Definition at line 1154 of file kaboutdata.cpp.

◆ setVersion()

KAboutData & KAboutData::setVersion ( const QByteArray & version)

Defines the program version string.

Parameters
versionThe program version.

Definition at line 723 of file kaboutdata.cpp.

◆ shortDescription()

QString KAboutData::shortDescription ( ) const

Returns a short, translated description.

Returns
the short description (translated). Can be QString() if not set.

Definition at line 854 of file kaboutdata.cpp.

◆ translators()

QList< KAboutPerson > KAboutData::translators ( ) const

Returns a list of translators.

Returns
translators information (list of persons)

Definition at line 927 of file kaboutdata.cpp.

◆ unsetCustomAuthorText()

KAboutData & KAboutData::unsetCustomAuthorText ( )

Clears any custom text displayed around the list of authors and falls back to the default message telling users to send bug reports to bugAddress().

Definition at line 987 of file kaboutdata.cpp.

◆ version()

QString KAboutData::version ( ) const

Returns the program's version.

Returns
the version string.

Definition at line 841 of file kaboutdata.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:07:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.