KAboutLicense Class Reference
from PyKDE5.kcoreaddons import *
Detailed Description
This class is used to store information about a license. The license can be one of some predefined, one given as text or one that can be loaded from a file. This class is used in the KAboutData class. Explicitly creating a KAboutLicense object is not possible. If the license is wanted for a KDE component having KAboutData object, use KAboutData.licenses() to get the licenses for that component. If the license is for a non-code resource and given by a keyword (e.g. in .desktop files), try using KAboutLicense.byKeyword().
Enumerations | |
LicenseKey | { Custom, File, Unknown, GPL, GPL_V2, LGPL, LGPL_V2, BSDL, Artistic, QPL, QPL_V1_0, GPL_V3, LGPL_V3 } |
NameFormat | { ShortName, FullName } |
Methods | |
__init__ (self, KAboutLicense other) | |
__init__ (self, KAboutData aboutData) | |
__init__ (self, KAboutLicense::LicenseKey licenseType, KAboutData aboutData) | |
KAboutLicense::LicenseKey | key (self) |
QString | name (self, KAboutLicense::NameFormat formatName) |
QString | text (self) |
Static Methods | |
KAboutLicense | byKeyword (QString keyword) |
Method Documentation
__init__ | ( | self, | ||
KAboutLicense | other | |||
) |
Copy constructor. Performs a deep copy.
- Parameters:
-
other object to copy
__init__ | ( | self, | ||
KAboutData | aboutData | |||
) |
- Internal:
- Used by KAboutData to construct a KAboutLicense
__init__ | ( | self, | ||
KAboutLicense::LicenseKey | licenseType, | |||
KAboutData | aboutData | |||
) |
- Internal:
- Used by KAboutData to construct a predefined license.
KAboutLicense::LicenseKey key | ( | self ) |
Returns the license key.
- Returns:
- The license key as element of KAboutLicense.LicenseKey enum.
QString name | ( | self, | ||
KAboutLicense::NameFormat | formatName | |||
) |
Returns the license name.
- Returns:
- The license name as a string.
QString text | ( | self ) |
Returns the full license text. If the licenseType argument of the constructor has been used, any text defined by setLicenseText is ignored, and the standard text for the chosen license will be returned.
- Returns:
- The license text.
Static Method Documentation
KAboutLicense byKeyword | ( | QString | keyword | |
) |
Fetch a known license by a keyword.
Frequently the license data is provided by a terse keyword-like string, e.g. by a field in a .desktop file. Using this method, an application can get hold of a proper KAboutLicense object, providing that the license is one of the several known to KDE, and use it to present more human-readable information to the user.
Keywords are matched by stripping all whitespace and lowercasing. The known keywords correspond to the KAboutLicense.LicenseKey enumeration, e.g. any of "LGPLV3", "LGPLv3", "LGPL v3" would match KAboutLicense.LGPL_V3. If there is no match for the keyword, a valid license object is still returned, with its name and text informing about a custom license, and its key equal to KAboutLicense.Custom.
- Parameters:
-
keyword The license keyword.
- Returns:
- The license object.
- See also:
- KAboutLicense.LicenseKey
Enumeration Documentation
LicenseKey |
Describes the license of the software.
- Enumerator:
-
Custom = -2 File = -1 Unknown = 0 GPL = 1 GPL_V2 = 1 LGPL = 2 LGPL_V2 = 2 BSDL = 3 Artistic = 4 QPL = 5 QPL_V1_0 = 5 GPL_V3 = 6 LGPL_V3 = 7
NameFormat |
Format of the license name.
- Enumerator:
-
ShortName FullName