KAboutData
#include <KAboutData>
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:
Holds information needed by the "About" box and other classes.
Definition at line 547 of file kaboutdata.h.
Property Documentation
◆ authors
|
read |
Definition at line 559 of file kaboutdata.h.
◆ bugAddress
|
read |
Definition at line 556 of file kaboutdata.h.
◆ componentName
|
read |
Definition at line 552 of file kaboutdata.h.
◆ components
|
read |
Definition at line 562 of file kaboutdata.h.
◆ copyrightStatement
|
read |
Definition at line 564 of file kaboutdata.h.
◆ credits
|
read |
Definition at line 560 of file kaboutdata.h.
◆ desktopFileName
|
read |
Definition at line 565 of file kaboutdata.h.
◆ displayName
|
read |
Definition at line 550 of file kaboutdata.h.
◆ homepage
|
read |
Definition at line 555 of file kaboutdata.h.
◆ licenses
|
read |
Definition at line 563 of file kaboutdata.h.
◆ otherText
|
read |
Definition at line 558 of file kaboutdata.h.
◆ productName
|
read |
Definition at line 551 of file kaboutdata.h.
◆ programLogo
|
read |
Definition at line 553 of file kaboutdata.h.
◆ shortDescription
|
read |
Definition at line 554 of file kaboutdata.h.
◆ translators
|
read |
Definition at line 561 of file kaboutdata.h.
◆ 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
-
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.
Definition at line 511 of file kaboutdata.cpp.
◆ KAboutData() [2/3]
|
explicit |
Constructor.
- Parameters
-
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
Definition at line 566 of file kaboutdata.cpp.
◆ KAboutData() [3/3]
KAboutData::KAboutData | ( | const KAboutData & | other | ) |
Copy constructor.
Performs a deep copy.
- Parameters
-
other object to copy
Definition at line 592 of file kaboutdata.cpp.
Member Function Documentation
◆ 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
-
author The author.
- Since
- 6.9
Definition at line 620 of file kaboutdata.cpp.
◆ addAuthor() [2/3]
|
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
-
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
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
-
component The 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
-
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
- 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
-
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)
- 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
-
person The person.
- Since
- 6.9
Definition at line 626 of file kaboutdata.cpp.
◆ addCredit() [2/3]
|
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
-
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
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
-
licenseKey The 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
-
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, 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:
- Parameters
-
license The 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
-
file Path 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()
|
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")
- 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
-
other object 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.
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()
|
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:
- QCoreApplication::applicationName
- QCoreApplication::applicationVersion
- QCoreApplication::organizationDomain
- QGuiApplication::applicationDisplayName
- QGuiApplication::desktopFileName (since 5.16)
- 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
-
bugAddress The 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
-
componentName The 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
-
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.
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
-
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.
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
-
desktopFileName The 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
-
displayName The 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
-
homepage The 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
-
licenseKey The 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
-
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, 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:
- Parameters
-
license The 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
-
file Path 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
-
domain the domain name, for instance kde.org, koffice.org, etc.
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
-
otherText Some 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
-
name The 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
-
image logo 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
-
shortDescription The 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:
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
-
name the name(s) of the translator(s) emailAddress the 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
-
version The 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:
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.