KAboutData

#include <KAboutData>

Properties

QVariantList authors
 
QString bugAddress
 
QString componentName
 
QString copyrightStatement
 
QVariantList credits
 
QString desktopFileName
 
QString displayName
 
QString homepage
 
QVariantList licenses
 
QString otherText
 
QString productName
 
QVariant programLogo
 
QString shortDescription
 
QVariantList translators
 
QString version
 

Public Member Functions

 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("[email protected]"))
 
 KAboutData (const QString &componentName={}, const QString &displayName={}, const QString &version={})
 
 KAboutData (const KAboutData &other)
 
KAboutDataaddAuthor (const QString &name, const QString &task=QString(), const QString &emailAddress=QString(), const QString &webAddress=QString(), const QString &ocsUsername=QString())
 
KAboutDataaddCredit (const QString &name, const QString &task=QString(), const QString &emailAddress=QString(), const QString &webAddress=QString(), const QString &ocsUsername=QString())
 
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
 
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 * internalProgramName () const
 
const char * internalVersion () const
 
QList< KAboutLicenselicenses () const
 
QString ocsProviderUrl () const
 
KAboutDataoperator= (const KAboutData &other)
 
QString organizationDomain () const
 
QString otherText () const
 
void processCommandLine (QCommandLineParser *parser)
 
QString productName () const
 
QString programIconName () 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)
 
KAboutDatasetOcsProvider (const QString &providerUrl)
 
KAboutDatasetOrganizationDomain (const QByteArray &domain)
 
KAboutDatasetOtherText (const QString &otherText)
 
KAboutDatasetProductName (const QByteArray &name)
 
KAboutDatasetProgramIconName (const QString &iconName)
 
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 KAboutData fromPluginMetaData (const KPluginMetaData &plugin)
 
static KAboutDatapluginData (const QString &componentName)
 
static void registerPluginData (const KAboutData &aboutData)
 
static void setApplicationData (const KAboutData &aboutData)
 

Friends

void KCrash::defaultCrashHandler (int sig)
 

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 KAboutDialog), 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"),
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
// 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

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

Author
Espen Sand (espen[email protected]@kde[email protected].org), David Faure (faure[email protected]@kde[email protected].org)

Definition at line 394 of file kaboutdata.h.

Constructor & Destructor Documentation

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("[email protected]") 
)

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 485 of file kaboutdata.cpp.

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 541 of file kaboutdata.cpp.

KAboutData::KAboutData ( const KAboutData other)

Copy constructor.

Performs a deep copy.

Parameters
otherobject to copy

Definition at line 573 of file kaboutdata.cpp.

Member Function Documentation

QString KAboutData::aboutTranslationTeam ( )
static

Returns a message about the translation team.

Returns
a message about the translation team

Definition at line 934 of file kaboutdata.cpp.

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

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.
ocsUsernameThe person's Open Collaboration Services username. The provider can be optionally specified with
See also
setOcsProvider.

Definition at line 615 of file kaboutdata.cpp.

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

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.
ocsUsernameThe person's Open Collaboration Services username. The provider can be optionally specified with
See also
setOcsProvider.

Definition at line 625 of file kaboutdata.cpp.

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 728 of file kaboutdata.cpp.

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 733 of file kaboutdata.cpp.

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") );
Parameters
licenseThe license text.
See also
setLicenseText, addLicense, addLicenseTextFile

Definition at line 649 of file kaboutdata.cpp.

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 671 of file kaboutdata.cpp.

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 1060 of file kaboutdata.cpp.

QList<KAboutPerson> KAboutData::authors ( ) const

Returns a list of authors.

Returns
author information (list of persons).
QString KAboutData::bugAddress ( ) const

Returns the email address or URL for bugs.

Returns
the address where to report bugs.
QString KAboutData::componentName ( ) const

Returns the application's internal name.

Returns
the internal program name.
QString KAboutData::copyrightStatement ( ) const

Returns the copyright statement.

Returns
the copyright statement. Can be QString() if not set.
QList<KAboutPerson> KAboutData::credits ( ) const

Returns a list of persons who contributed.

Returns
credit information (list of persons).
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 961 of file kaboutdata.cpp.

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 966 of file kaboutdata.cpp.

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 971 of file kaboutdata.cpp.

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
QString KAboutData::displayName ( ) const

Returns the translated program name.

Returns
the program name (translated).
KAboutData KAboutData::fromPluginMetaData ( const KPluginMetaData plugin)
static

Creates a KAboutData from the given plugin metadata.

Since
5.18
Deprecated:
Since 5.65, use KAboutPluginDialog to show info about a plugin instead of KAboutApplicationDialog, with the latter having had been the only known need for this conversion.

Definition at line 599 of file kaboutdata.cpp.

QString KAboutData::homepage ( ) const

Returns the application homepage.

Returns
the application homepage URL. Can be QString() if not set.
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 876 of file kaboutdata.cpp.

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 806 of file kaboutdata.cpp.

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 848 of file kaboutdata.cpp.

QList<KAboutLicense> KAboutData::licenses ( ) const

Returns a list of licenses.

Returns
licenses information (list of licenses)
QString KAboutData::ocsProviderUrl ( ) const

Returns the chosen Open Collaboration Services provider URL.

Returns
the provider URL.

Definition at line 835 of file kaboutdata.cpp.

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

Assignment operator.

Performs a deep copy.

Parameters
otherobject to copy

Definition at line 584 of file kaboutdata.cpp.

QString KAboutData::organizationDomain ( ) const

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

See also
setOrganizationDomain(const QByteArray&)

Definition at line 868 of file kaboutdata.cpp.

QString KAboutData::otherText ( ) const

Returns a translated, free form text.

Returns
the free form text (translated). Can be QString() if not set.
KAboutData * KAboutData::pluginData ( const QString componentName)
static

Return the KAboutData for the given plugin identified by componentName.

Deprecated:
Since 5.76. The central registry is to be removed in the future in favour of plugin type specific local registries, using KPluginMetaData.

Definition at line 1152 of file kaboutdata.cpp.

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 1188 of file kaboutdata.cpp.

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.
QString KAboutData::programIconName ( ) const

Returns the program's icon name.

The default value is componentName().

Returns
the program's icon name.

This is mostly for compatibility, given that setProgramIconName is deprecated.

Definition at line 812 of file kaboutdata.cpp.

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.
void KAboutData::registerPluginData ( const KAboutData aboutData)
static

Register the KAboutData information for a plugin.

Call this from the constructor of the plugin. This will register the plugin's aboutData under the component name that was set in aboutData.

Deprecated:
Since 5.76. The central registry is to be removed in the future in favour of plugin type specific local registries, using KPluginMetaData.

Definition at line 1139 of file kaboutdata.cpp.

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 1106 of file kaboutdata.cpp.

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 764 of file kaboutdata.cpp.

KAboutData & KAboutData::setComponentName ( const QString componentName)

Defines the component name used internally.

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

Definition at line 685 of file kaboutdata.cpp.

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 746 of file kaboutdata.cpp.

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 976 of file kaboutdata.cpp.

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.

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 691 of file kaboutdata.cpp.

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 758 of file kaboutdata.cpp.

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

Defines the license identifier.

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

Definition at line 716 of file kaboutdata.cpp.

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 721 of file kaboutdata.cpp.

KAboutData & KAboutData::setLicenseText ( const QString license)

Defines a license text, which is translated.

Example:

setLicenseText( i18n("This is my license") );
Parameters
licenseThe license text.

Definition at line 642 of file kaboutdata.cpp.

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 664 of file kaboutdata.cpp.

KAboutData & KAboutData::setOcsProvider ( const QString providerUrl)

Specifies an Open Collaboration Services provider by URL.

A provider file must be available for the chosen provider.

Use this if you need to override the default provider.

If this method is not used, all the KAboutPerson OCS usernames will be used with the openDesktop.org entry from the default provider file.

Parameters
providerUrlThe provider URL as defined in the provider file.

Definition at line 698 of file kaboutdata.cpp.

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"). For still supporting the deprecated start of services via KToolInvocation, the desktop file needs to have an entry with the key "X-DBUS-ServiceName" and a value which matches the used D-Bus "well-known name" as just described, so with the above used values it needs a line "X-DBUS-ServiceName=org.bar.foo"
Parameters
domainthe domain name, for instance kde.org, koffice.org, etc.
See also
setDesktopFileName(const QString&)

Definition at line 770 of file kaboutdata.cpp.

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 752 of file kaboutdata.cpp.

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 776 of file kaboutdata.cpp.

KAboutData & KAboutData::setProgramIconName ( const QString iconName)

Obsolete method.

This method used to set the icon name but this is no longer possible in KDE Frameworks 5 because KCoreAddons does not depend on QtGui.

Parameters
iconNamename of the icon. Example: "accessories-text-editor"
See also
programIconName()
Deprecated:
since 5.2, use QApplication::setWindowIcon(QIcon::fromTheme()) instead.

Definition at line 817 of file kaboutdata.cpp.

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 829 of file kaboutdata.cpp.

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 710 of file kaboutdata.cpp.

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.

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

Definition at line 635 of file kaboutdata.cpp.

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 1168 of file kaboutdata.cpp.

KAboutData & KAboutData::setVersion ( const QByteArray version)

Defines the program version string.

Parameters
versionThe program version.

Definition at line 704 of file kaboutdata.cpp.

QString KAboutData::shortDescription ( ) const

Returns a short, translated description.

Returns
the short description (translated). Can be QString() if not set.
QList<KAboutPerson> KAboutData::translators ( ) const

Returns a list of translators.

Returns
translators information (list of persons)
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.

QString KAboutData::version ( ) const

Returns the program's version.

Returns
the version string.

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Nov 30 2020 23:02:55 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.