KAboutData Class | KCoreAddons
KDE API Reference
KCoreAddons
KCoreAddons
KAboutData
Contents
Properties
Public Functions
Static Public Members
Detailed Description
KAboutData Class
This class is used to store information about a program or plugin.
More...
Header:
#include
CMake:
find_package(KF6 REQUIRED COMPONENTS CoreAddons)
target_link_libraries(mytarget PRIVATE KF6::CoreAddons)
List of all members, including inherited members
Properties
authors
: const QList
bugAddress
: const QString
componentName
: const QString
components
: const QList
copyrightStatement
: const QString
credits
: const QList
desktopFileName
: const QString
displayName
: const QString
homepage
: const QString
licenses
: const QList
otherText
: const QString
productName
: const QString
programLogo
: const QVariant
releases
: QList
shortDescription
: const QString
translators
: const QList
version
: const QString
Public Functions
KAboutData
(const QString &
componentName
= {}, const QString &
displayName
= {}, const QString &
version
= {})
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 KAboutData &
other
(since 6.9)
KAboutData &
addAuthor
(const KAboutPerson &
author
KAboutData &
addAuthor
(const QString &
name
, const QString &
task
= QString(), const QString &
emailAddress
= QString(), const QString &
webAddress
= QString(), const QUrl &
avatarUrl
= QUrl())
(since 6.0)
KAboutData &
addAuthor
(const QString &
name
, const QString &
task
, const QString &
emailAddress
, const QString &
webAddress
, const QString &
kdeStoreUsername
(since 6.9)
KAboutData &
addComponent
(const KAboutComponent &
component
KAboutData &
addComponent
(const QString &
name
, const QString &
description
= QString(), const QString &
version
= QString(), const QString &
webAddress
= QString(), KAboutLicense::LicenseKey
licenseKey
= KAboutLicense::Unknown)
KAboutData &
addComponent
(const QString &
name
, const QString &
description
, const QString &
version
, const QString &
webAddress
, const QString &
pathToLicenseFile
(since 6.9)
KAboutData &
addCredit
(const KAboutPerson &
person
KAboutData &
addCredit
(const QString &
name
, const QString &
task
= QString(), const QString &
emailAddress
= QString(), const QString &
webAddress
= QString(), const QUrl &
avatarUrl
= QUrl())
(since 6.0)
KAboutData &
addCredit
(const QString &
name
, const QString &
task
, const QString &
emailAddress
, const QString &
webAddress
, const QString &
kdeStoreUsername
(since 6.26)
KAboutData &
addLicense
(KAboutLicense &&
license
KAboutData &
addLicense
(KAboutLicense::LicenseKey
licenseKey
KAboutData &
addLicense
(KAboutLicense::LicenseKey
licenseKey
, KAboutLicense::VersionRestriction
versionRestriction
KAboutData &
addLicenseText
(const QString &
license
KAboutData &
addLicenseTextFile
(const QString &
file
(since 6.26)
KAboutData &
addRelease
(KAboutRelease &&
release
QList
authors
() const
QString
bugAddress
() const
QString
componentName
() const
QList
components
() const
QString
copyrightStatement
() const
QList
credits
() const
QString
customAuthorPlainText
() const
QString
customAuthorRichText
() const
bool
customAuthorTextEnabled
() const
QString
desktopFileName
() const
QString
displayName
() const
QString
homepage
() const
QList
licenses
() const
QString
organizationDomain
() const
QString
otherText
() const
void
processCommandLine
(QCommandLineParser *
parser
QString
productName
() const
QVariant
programLogo
() const
(since 6.26)
QList
releases
() const
KAboutData &
setBugAddress
(const QByteArray &
bugAddress
KAboutData &
setComponentName
(const QString &
componentName
KAboutData &
setCopyrightStatement
(const QString &
copyrightStatement
KAboutData &
setCustomAuthorText
(const QString &
plainText
, const QString &
richText
KAboutData &
setDesktopFileName
(const QString &
desktopFileName
KAboutData &
setDisplayName
(const QString &
displayName
KAboutData &
setHomepage
(const QString &
homepage
(since 6.26)
KAboutData &
setLicense
(KAboutLicense &&
license
KAboutData &
setLicense
(KAboutLicense::LicenseKey
licenseKey
KAboutData &
setLicense
(KAboutLicense::LicenseKey
licenseKey
, KAboutLicense::VersionRestriction
versionRestriction
KAboutData &
setLicenseText
(const QString &
license
KAboutData &
setLicenseTextFile
(const QString &
file
KAboutData &
setOrganizationDomain
(const QByteArray &
domain
KAboutData &
setOtherText
(const QString &
otherText
KAboutData &
setProductName
(const QByteArray &
name
KAboutData &
setProgramLogo
(const QVariant &
image
KAboutData &
setShortDescription
(const QString &
shortDescription
KAboutData &
setTranslator
(const QString &
name
, const QString &
emailAddress
KAboutData &
setVersion
(const QByteArray &
version
bool
setupCommandLine
(QCommandLineParser *
parser
QString
shortDescription
() const
QList
translators
() const
KAboutData &
unsetCustomAuthorText
()
QString
version
() const
Static Public Members
QString
aboutTranslationTeam
()
KAboutData
applicationData
()
(since 6.26)
KAboutData
fromAppStreamFile
(const QString &
appStreamFileName
(since 6.26)
KAboutData
fromAppStreamForApplication
()
(since 6.26)
KAboutData
fromAppStreamId
(const QString &
applicationId
void
setApplicationData
(const KAboutData &
aboutData
Detailed Description
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
KLocalizedString
::
setApplicationDomain(
"foo"
);
// 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"
KAboutLicense
::
LGPL
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
KAboutData
::
setApplicationData(aboutData);
// 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
QApplication
::
setWindowIcon(
QIcon
::
fromTheme(
QStringLiteral
"foo"
)));
// integrate with commandline argument handling
QCommandLineParser
parser;
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
KDBusService programDBusService(KDBusService
::
Multiple
KDBusService
::
NoExitOnFailure);
Property Documentation
[read-only]
authors
: const
QList
KAboutPerson
Access functions:
QList
authors
() const
[read-only]
bugAddress
: const
QString
Access functions:
QString
bugAddress
() const
[read-only]
componentName
: const
QString
Access functions:
QString
componentName
() const
[read-only]
components
: const
QList
KAboutComponent
Access functions:
QList
components
() const
[read-only]
copyrightStatement
: const
QString
Access functions:
QString
copyrightStatement
() const
[read-only]
credits
: const
QList
KAboutPerson
Access functions:
QList
credits
() const
[read-only]
desktopFileName
: const
QString
Access functions:
QString
desktopFileName
() const
[read-only]
displayName
: const
QString
Access functions:
QString
displayName
() const
[read-only]
homepage
: const
QString
Access functions:
QString
homepage
() const
[read-only]
licenses
: const
QList
KAboutLicense
Access functions:
QList
licenses
() const
[read-only]
otherText
: const
QString
Access functions:
QString
otherText
() const
[read-only]
productName
: const
QString
Access functions:
QString
productName
() const
[read-only]
programLogo
: const
QVariant
Access functions:
QVariant
programLogo
() const
[read-only]
releases
QList
KAboutRelease
Access functions:
QList
releases
() const
[read-only]
shortDescription
: const
QString
Access functions:
QString
shortDescription
() const
[read-only]
translators
: const
QList
KAboutPerson
Access functions:
QList
translators
() const
[read-only]
version
: const
QString
Access functions:
QString
version
() const
Member Function Documentation
[explicit]
KAboutData::
KAboutData
(const
QString
componentName
= {}, const
QString
displayName
= {}, const
QString
version
= {})
Constructor.
componentName
The program name or plugin name used internally. Example: "kwrite".
displayName
A displayable name for the program or plugin. This string should be translated. Example: i18n("KWrite")
version
The 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&) and
setDesktopFileName
(const QString&).
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.
componentName
The program name or plugin name used internally. Example: QStringLiteral("kwrite"). This should never be translated.
displayName
A displayable name for the program or plugin. This string should be translated. Example: i18n("KWrite")
version
The component version string. Example: QStringLiteral("1.0").
shortDescription
A short description of what the component does. This string should be translated. Example: i18n("A simple text editor.")
licenseType
The license identifier. Use
setLicenseText
or
setLicenseTextFile
if you use a license not predefined here.
copyrightStatement
A 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.
otherText
Some free form text, that can contain any kind of information. The text can contain newlines. This string should be translated.
homePageAddress
The 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.
bugAddress
The 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&) and
setDesktopFileName
(const QString&).
KAboutData::
KAboutData
(const
KAboutData
other
Copy constructor. Performs a deep copy.
other
object to copy
[static]
QString
KAboutData::
aboutTranslationTeam
()
Returns a message about the translation team.
[since 6.9]
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.
author
the author.
This function was introduced in 6.9.
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.
name
The developer's name. It should be translated.
task
What the person is responsible for. This text can contain newlines. It should be translated. Can be left empty.
emailAddress
An Email address where the person can be reached. Can be left empty.
webAddress
The 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.
avatarUrl
URL to the avatar of the person
[since 6.0]
KAboutData
&KAboutData::
addAuthor
(const
QString
name
, const
QString
task
, const
QString
emailAddress
, const
QString
webAddress
, const
QString
kdeStoreUsername
This is an overloaded function.
This function was introduced in 6.0.
[since 6.9]
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.
component
The component
This function was introduced in 6.9.
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.
name
The component's name. It should be translated.
description
Short description of the component and maybe copyright info. This text can contain newlines. It should be translated. Can be left empty.
version
The version of the component. Can be left empty.
webAddress
The 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.
licenseKey
The component's license identifier. Can be left empty (i.e.
KAboutLicense::Unknown
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.
name
The component's name. It should be translated.
description
Short description of the component and maybe copyright info. This text can contain newlines. It should be translated. Can be left empty.
version
The version of the component. Can be left empty.
webAddress
The 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.
pathToLicenseFile
Path 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 6.9]
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.
person
The person.
This function was introduced in 6.9.
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.
name
The person's name. It should be translated.
task
What the person has done to deserve the honor. The text can contain newlines. It should be translated. Can be left empty.
emailAddress
An email address when the person can be reached. Can be left empty.
webAddress
The 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.
avatarUrl
URL to the avatar of the person
[since 6.0]
KAboutData
&KAboutData::
addCredit
(const
QString
name
, const
QString
task
, const
QString
emailAddress
, const
QString
webAddress
, const
QString
kdeStoreUsername
This is an overloaded function.
This function was introduced in 6.0.
[since 6.26]
KAboutData
&KAboutData::
addLicense
KAboutLicense
&&
license
Adds a license.
license
a license object, obtained e.g. via
KAboutLicense::byKeyword
().
This function was introduced in 6.26.
See also
addLicenseText
setLicense
setLicenseText
, and
setLicenseTextFile
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.
licenseKey
the license identifier.
See also
setLicenseText
addLicenseText
, and
addLicenseTextFile
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.
licenseKey
the license identifier.
versionRestriction
Whether 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
, and
addLicenseTextFile
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"
) );
license
The license text.
See also
setLicenseText
addLicense
, and
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.
file
path to the file in the local filesystem containing the license text.
See also
addLicenseText
addLicense
, and
setLicenseTextFile
[since 6.26]
KAboutData
&KAboutData::
addRelease
KAboutRelease
&&
release
Adds a release note for this application.
This function was introduced in 6.26.
See also
releases
().
[static]
KAboutData
KAboutData::
applicationData
()
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
QList
KAboutPerson
> KAboutData::
authors
() const
Returns a list of authors.
Note:
Getter function for property authors.
QString
KAboutData::
bugAddress
() const
Returns the email address or URL for bugs.
Note:
Getter function for property bugAddress.
See also
setBugAddress
().
QString
KAboutData::
componentName
() const
Returns the application's internal name.
Note:
Getter function for property componentName.
See also
setComponentName
().
QList
KAboutComponent
> KAboutData::
components
() const
Returns a list of components.
Note:
Getter function for property components.
QString
KAboutData::
copyrightStatement
() const
Returns the copyright statement.
Note:
Getter function for property copyrightStatement.
See also
setCopyrightStatement
().
QList
KAboutPerson
> KAboutData::
credits
() const
Returns a list of persons who contributed.
Note:
Getter function for property credits.
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
().
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
().
bool
KAboutData::
customAuthorTextEnabled
() const
Returns whether custom text should be displayed around the list of authors.
QString
KAboutData::
desktopFileName
() const
Returns the desktop file name of this application (e.g. "org.kde.foo")
Note:
Getter function for property desktopFileName.
See also
setDesktopFileName
(const QString&).
QString
KAboutData::
displayName
() const
Returns the translated program name.
Note:
Getter function for property displayName.
See also
setDisplayName
().
[static, since 6.26]
KAboutData
KAboutData::
fromAppStreamFile
(const
QString
appStreamFileName
Create about data from an AppStream file.
This fills all fields of the returned
KAboutData
object that can be found in the the given AppStream file, including (translated) name, license, URLs, etc. Note that most importantly the version number is not included in this.
appStreamFileName
A path to the AppStream file to read.
This function was introduced in 6.26.
See also
fromAppStreamId
and
fromAppStreamForApplication
[static, since 6.26]
KAboutData
KAboutData::
fromAppStreamForApplication
()
Create about data from the AppStream file of the current application.
This fills all fields of the returned
KAboutData
object that can be found in the the given AppStream file, including (translated) name, license, URLs, etc. Note that most importantly the version number is not included in this.
QGuiApplication::desktopFileName has to be set prior to calling this.
This function was introduced in 6.26.
See also
fromAppStreamFile
and
fromAppStreamId
[static, since 6.26]
KAboutData
KAboutData::
fromAppStreamId
(const
QString
applicationId
Create about data from an AppStream file.
This fills all fields of the returned
KAboutData
object that can be found in the the given AppStream file, including (translated) name, license, URLs, etc. Note that most importantly the version number is not included in this.
applicationId
An application identifier used to find the corresponding AppStream file in the default install location.
This function was introduced in 6.26.
See also
fromAppStreamFile
and
fromAppStreamForApplication
QString
KAboutData::
homepage
() const
Returns the application homepage.
Note:
Getter function for property homepage.
See also
setHomepage
().
QList
KAboutLicense
> KAboutData::
licenses
() const
Returns a list of licenses.
Note:
Getter function for property licenses.
QString
KAboutData::
organizationDomain
() const
Returns the domain name of the organization that wrote this application.
See also
setOrganizationDomain
(const QByteArray&).
QString
KAboutData::
otherText
() const
Returns a translated, free form text.
Note:
Getter function for property otherText.
See also
setOtherText
().
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
().
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
()
Note:
Getter function for property productName.
See also
setProductName
().
QVariant
KAboutData::
programLogo
() const
Returns the program logo data, or a null image if there is no custom application logo defined.
Because
KAboutData
is a core class it cannot use QImage/QPixmap/QIcon directly, so this is a QVariant containing a QImage/QPixmap/QIcon.
Note:
Getter function for property programLogo.
See also
setProgramLogo
().
[since 6.26]
QList
KAboutRelease
> KAboutData::
releases
() const
Returns all release notes for this application.
Note:
Getter function for property releases.
This function was introduced in 6.26.
See also
addRelease
().
[static]
void
KAboutData::
setApplicationData
(const
KAboutData
aboutData
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:
QCoreApplication::applicationName
QCoreApplication::applicationVersion
QCoreApplication::organizationDomain
QGuiApplication::applicationDisplayName
QGuiApplication::desktopFileName (since 5.16)
See also
applicationData
KAboutData
&KAboutData::
setBugAddress
(const
QByteArray
bugAddress
Defines the address where bug reports should be sent.
bugAddress
The bug report email address or URL. This defaults to the kde.org bug system.
See also
bugAddress
().
KAboutData
&KAboutData::
setComponentName
(const
QString
componentName
Defines the component name used internally.
componentName
the application or plugin name. Example: "kate".
See also
componentName
().
KAboutData
&KAboutData::
setCopyrightStatement
(const
QString
copyrightStatement
Defines the copyright statement to show when displaying the license.
copyrightStatement
a 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.
See also
copyrightStatement
().
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
().
plainText
the plain text.
richText
the 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.
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
or
setComponentName
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
. This is useful if an application supports multiple desktop files with different runtime settings.
desktopFileName
the desktop file name of this application
See also
desktopFileName
(),
organizationDomain
(),
componentName
(), and
setupCommandLine
().
KAboutData
&KAboutData::
setDisplayName
(const
QString
displayName
Defines the displayable component name string.
displayName
the display name. This string should be translated. Example: i18n("Advanced Text Editor").
See also
displayName
().
KAboutData
&KAboutData::
setHomepage
(const
QString
homepage
Defines the program homepage.
homepage
the program homepage string. Start the address with "http://". "http://kate.kde.org" is correct but "kate.kde.org" is not.
See also
homepage
().
[since 6.26]
KAboutData
&KAboutData::
setLicense
KAboutLicense
&&
license
Sets the license.
license
a license object, obtained e.g. via
KAboutLicense::byKeyword
().
This function was introduced in 6.26.
See also
addLicense
addLicenseText
setLicenseText
, and
setLicenseTextFile
KAboutData
&KAboutData::
setLicense
KAboutLicense::LicenseKey
licenseKey
Defines the license identifier.
licenseKey
the license identifier.
See also
addLicenseText
setLicenseText
, and
setLicenseTextFile
KAboutData
&KAboutData::
setLicense
KAboutLicense::LicenseKey
licenseKey
KAboutLicense::VersionRestriction
versionRestriction
Defines the license identifier.
licenseKey
the license identifier.
versionRestriction
Whether 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
, and
setLicenseTextFile
KAboutData
&KAboutData::
setLicenseText
(const
QString
license
Defines a license text, which is translated.
Example:
setLicenseText( i18n(
"This is my license"
) );
license
The license text.
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.
file
Path to the file in the local filesystem containing the license text.
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").
domain
the domain name, for instance kde.org, koffice.org, etc.
See also
organizationDomain
() and
setDesktopFileName
(const QString&).
KAboutData
&KAboutData::
setOtherText
(const
QString
otherText
Defines the additional text to show in the about dialog.
otherText
some free form text, that can contain any kind of information. The text can contain newlines. This string should be translated.
See also
otherText
().
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'.
name
the name of product
See also
productName
().
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.
image
logo image.
See also
programLogo
().
KAboutData
&KAboutData::
setShortDescription
(const
QString
shortDescription
Defines a short description of what the program does.
shortDescription
the program description. This string should be translated. Example: i18n("An advanced text editor with syntax highlighting support.").
See also
shortDescription
().
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"
));
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.
name
the name(s) of the translator(s)
emailAddress
the email address(es) of the translator(s)
KAboutData
&KAboutData::
setVersion
(const
QByteArray
version
Defines the program version string.
version
the program version.
See also
version
().
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
QString
KAboutData::
shortDescription
() const
Returns a short, translated description.
Note:
Getter function for property shortDescription.
See also
setShortDescription
().
QList
KAboutPerson
> KAboutData::
translators
() const
Returns a list of translators.
Note:
Getter function for property translators.
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
().
QString
KAboutData::
version
() const
Returns the program's version.
Note:
Getter function for property version.
See also
setVersion
().
US