Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

Qt attribution.json: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
(Add link to page with 3rd party libraries)
 
(26 intermediate revisions by 2 users not shown)
Line 1: Line 1:
''This is currently only a proposal.''
[[Category:Developing Qt::Process]]
qt_attribution.json files are used to document [[Third Party Code in Qt|3rd party code]] inside the Qt modules (from Qt 5.8 onwards). It is a JSON based format that can be processed with the licensescanner tool.  It is officially documented in {{QUIP|7}}.


qt_attribution.json files are used to document 3rd party code inside the Qt modules. It is a JSON based format that can be processed with the licensescanner tool.
A qt_attribution.json file  needs to contain one JSON object, or one array of JSON objects, with the following string properties:


= Content =
= Content =
Line 9: Line 10:
! Name !! Description !! Usage in qdoc
! Name !! Description !! Usage in qdoc
|-
|-
| '''Name''' || Descriptive name of the package, without version number. Camel case. Mandatory. || Title
| '''Id''' || Unique name for package, without spaces. All lower case. Mandatory. || \target and part of page name
|-
|-
| '''ShortName''' || Unique name for package, without spaces. All lower case. Mandatory. || Link target
| '''Name''' || Descriptive name of the package, without version number. Camel case. Mandatory. || \title
|-
|-
| '''QDocModule''' || The qch file the page should be part of. Mandatory. ||
| '''QDocModule''' || The qch file the documentation of the package should be part of. Mandatory. || -
|-
|-
| Description || A short description of what the package is and is used for. Optional. ||
| '''QtUsage''' || Free text on where the 3rd party code in Qt is used, and how to avoid it (configure options?). Mandatory. || Shown as text.
|-
|-
| '''Modules''' || Either array of modules, or one single module where the code is used. Mandatory. || Link target
| QtParts || JS array with possible entries "examples", "tests", "tools", or "libs". Default is [ "libs" ]. || Only code with "libs" is shown in the 3rd party overview per module.
|-
|-
| '''Usage''' || Free text on where the 3rd party code in Qt is used, and how to avoid it (configure options?). Mandatory. ||
| Path || (Relative) path to the sources. Default is same directory is qt_attribution.json file. Optional. || Shown as text.
|-
|-
| Homepage || Homepage of the upstream project. Optional. ||
| Files || List of files, relative to Path. Optional. || Shown as text.
|-
|-
| Version || Version used from the upstream project. Optional. ||
| Description || A short description of what the package is and is used for. Optional. || Shown as text.
|-
|-
| VersionLink || Link to exact upstream version. Optional. ||
| Homepage || Homepage of the upstream project. Optional. || Shown as link.
|-
|-
| '''License''' || The license under which the package is distributed, preferably with the names from [https://spdx.org/licenses/ SPDX] 'Full Name'. Mandatory. ||
| Version || Version used from the upstream project. Optional. || Shown as text.
|-
|-
| LicenseId || [https://spdx.org/licenses/ SPDX] ID. Optional. ||
| DownloadLocation || Link to exact upstream version. Optional. || Shown as link for Version text.
|-
|-
| LicenseFile || Relative path to file containing the license text. Optional. ||
| '''License''' || The license under which the package is distributed, preferably with the names from [https://spdx.org/licenses/ SPDX] 'Full Name'. Mandatory. || Shown as text.
|-
|-
| Copyright || (Aggregated) list of copyright lines. Optional. ||
| LicenseId || [https://spdx.org/licenses/ SPDX] or [https://enterprise.dejacode.com/licenses/ DejaCode] ID. Optional. || Shown as link (\l https://spdx.org/licenses/XXX).
|-
| LicenseFile || Relative path to file containing the license text. Optional for code in the Public Domain, otherwise needed. || Content is shown as text.
|-
| LicenseFiles || List of license files. Handling is the same as for 'LicenseFile' (the content in the output will just be concatenated). Supported in Qt 6.0 onwards. || Content is shown as text.
|-
| '''Copyright''' || (Aggregated) list of copyright lines. Mandatory, except if CopyrightFile is provided. || Shown as text.
|-
| CopyrightFile || Relative path to a file containing the copyright text. Supported in Qt 6.0 onwards. || Content is shown as text.
|}
|}


= Example =
= Example =
<pre>
{
    "Id": "sqlite",
    "Name": "SQLite",
    "QDocModule": "qtsql",
    "QtUsage": "Used in Qt SQL Lite plugin.",
    "Description": "SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.
Configure with -system-sqlite or -no-sqlite to avoid.",
    "Homepage": "http://www.sqlite.org/",
    "Version": "3.11.1.0",
    "License": "Public Domain",
    "Copyright": "The author disclaims copyright to this source code. However, a license can be obtained if needed."
}
</pre>

Latest revision as of 10:50, 19 September 2022

qt_attribution.json files are used to document 3rd party code inside the Qt modules (from Qt 5.8 onwards). It is a JSON based format that can be processed with the licensescanner tool. It is officially documented in QUIP 7.

A qt_attribution.json file needs to contain one JSON object, or one array of JSON objects, with the following string properties:

Content

Name Description Usage in qdoc
Id Unique name for package, without spaces. All lower case. Mandatory. \target and part of page name
Name Descriptive name of the package, without version number. Camel case. Mandatory. \title
QDocModule The qch file the documentation of the package should be part of. Mandatory. -
QtUsage Free text on where the 3rd party code in Qt is used, and how to avoid it (configure options?). Mandatory. Shown as text.
QtParts JS array with possible entries "examples", "tests", "tools", or "libs". Default is [ "libs" ]. Only code with "libs" is shown in the 3rd party overview per module.
Path (Relative) path to the sources. Default is same directory is qt_attribution.json file. Optional. Shown as text.
Files List of files, relative to Path. Optional. Shown as text.
Description A short description of what the package is and is used for. Optional. Shown as text.
Homepage Homepage of the upstream project. Optional. Shown as link.
Version Version used from the upstream project. Optional. Shown as text.
DownloadLocation Link to exact upstream version. Optional. Shown as link for Version text.
License The license under which the package is distributed, preferably with the names from SPDX 'Full Name'. Mandatory. Shown as text.
LicenseId SPDX or DejaCode ID. Optional. Shown as link (\l https://spdx.org/licenses/XXX).
LicenseFile Relative path to file containing the license text. Optional for code in the Public Domain, otherwise needed. Content is shown as text.
LicenseFiles List of license files. Handling is the same as for 'LicenseFile' (the content in the output will just be concatenated). Supported in Qt 6.0 onwards. Content is shown as text.
Copyright (Aggregated) list of copyright lines. Mandatory, except if CopyrightFile is provided. Shown as text.
CopyrightFile Relative path to a file containing the copyright text. Supported in Qt 6.0 onwards. Content is shown as text.

Example

{
    "Id": "sqlite",
    "Name": "SQLite",
    "QDocModule": "qtsql",
    "QtUsage": "Used in Qt SQL Lite plugin.",

    "Description": "SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.
Configure with -system-sqlite or -no-sqlite to avoid.",
    "Homepage": "http://www.sqlite.org/",
    "Version": "3.11.1.0",
    "License": "Public Domain",
    "Copyright": "The author disclaims copyright to this source code. However, a license can be obtained if needed."
}