KAboutLicense

KDE 4.2 PyKDE API Reference

- KDE's Python API

# KAboutLicense Class Reference

`from PyKDE4.kdecore import *`

## Detailed Description

## Methods
| __init__ (self, KAboutLicense other)
| __init__ (self, KAboutData.LicenseKey licenseType, KAboutData aboutData)
| __init__ (self, QString pathToFile, KAboutData aboutData)
| __init__ (self, KLocalizedString licenseText, KAboutData aboutData)
KAboutData.LicenseKey | key (self)
QString | name (self, KAboutData.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.LicenseKey | licenseType,
|  | KAboutData | aboutData
| ) |  |  |

Internal:
  Used by KAboutData to construct a predefined license.

__init__ | ( | self, |
|  | QString | pathToFile,
|  | KAboutData | aboutData
| ) |  |  |

Internal:
  Used by KAboutData to construct license by given text

__init__ | ( | self, |
|  | KLocalizedString | licenseText,
|  | KAboutData | aboutData
| ) |  |  |

Internal:
  Used by KAboutData to construct license by given text

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 KAboutData.LicenseKey enumeration, e.g. any of "LGPLV3", "LGPLv3", "LGPL v3" would match License_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 KAboutData.License_Custom.

Parameters:

  | keyword | The license keyword.

Returns:
  The license object.

See also:
  KAboutData.LicenseKey

Since:
  4.1

KAboutData.LicenseKey key | ( |  | self ) |

Returns the license key.

Returns:
  The license key as element of KAboutData.LicenseKey enum.

Since:
  4.1

QString name | ( | self, |
|  | KAboutData.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.