KAboutComponent Class
Header: | #include <KAboutData> |
CMake: | find_package(KF6 REQUIRED COMPONENTS CoreAddons) target_link_libraries(mytarget PRIVATE KF6::CoreAddons) |
Since: | 5.84 |
Public Functions
KAboutComponent(const QString &name, const QString &description, const QString &version, const QString &webAddress, const QString &pathToLicenseFile) | |
KAboutComponent(const QString &name = QString(), const QString &description = QString(), const QString &version = QString(), const QString &webAddress = QString(), enum KAboutLicense::LicenseKey licenseType = KAboutLicense::Unknown) | |
KAboutComponent(const KAboutComponent &other) | |
QString | description() const |
KAboutLicense | license() const |
QString | name() const |
QString | version() const |
QString | webAddress() const |
KAboutComponent & | operator=(const KAboutComponent &other) |
Detailed Description
This class is used to store information about a third party component. It can store the component's name, a description, a link to a website and the license of the libary. This class is intended for use in the KAboutData class, but it can be used elsewhere as well. Normally you should at least define the libary's name. Creating a KAboutComponent object by yourself is relatively useless, but the KAboutData method KAboutData::libaries() return lists of KAboutComponent data objects which you can examine.
Example usage within a main(), retrieving the list of components used by a program and re-using data from one of them:
KAboutData about("khello", i18n("KHello"), "0.1", i18n("A KDE version of Hello, world!"), KAboutLicense::LGPL, i18n("Copyright (C) 2014 Developer")); about.addComponent(i18n("Awsom Lib"), i18n("Does awesom stuff. Copyright (C) 2014"), i18n("1.02.3"), "http://example.com", KAboutLicense::LGPL); QList<KAboutComponent> components = about.components();
Member Function Documentation
[explicit]
KAboutComponent::KAboutComponent(const QString &name, const QString &description, const QString &version, const QString &webAddress, const QString &pathToLicenseFile)
Convenience constructor
name The name of the component.
description The description of this component.
version The version of this component.
webAddress Website of the component.
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.
name default argument
[explicit]
KAboutComponent::KAboutComponent(const QString &name = QString(), const QString &description = QString(), const QString &version = QString(), const QString &webAddress = QString(), enum KAboutLicense::LicenseKey licenseType = KAboutLicense::Unknown)
Convenience constructor
name The name of the component.
description The description of this component.
version The version of this component.
webAddress Website of the component.
licenseType The license identifier of the component.
name default argument
KAboutComponent::KAboutComponent(const KAboutComponent &other)
Copy constructor. Performs a deep copy.
other object to copy
QString KAboutComponent::description() const
The component's description Returns the component's description (can be empty)
Note: Getter function for property description.
KAboutLicense KAboutComponent::license() const
The component's license Returns the component's KAboutLicense
Note: Getter function for property licenses.
QString KAboutComponent::name() const
The component's name Returns the component's name (can be QString(), if it has been constructed with an empty name)
Note: Getter function for property name.
QString KAboutComponent::version() const
The component's version Returns the component's task (can be empty)
Note: Getter function for property version.
QString KAboutComponent::webAddress() const
The website or a relevant link Returns the component's website (can be empty)
Note: Getter function for property webAddress.
KAboutComponent &KAboutComponent::operator=(const KAboutComponent &other)
Assignment operator. Performs a deep copy.
other object to copy