QUIP: 18 Title: License specification in Qt's modules Author: Lucie Gerard, Jörg Bornemann Status: Active Type: Informational Created: 2022-09-26 Post-History: https://lists.qt-project.org/pipermail/development/2023-February/043648.html https://lists.qt-project.org/pipermail/development/2024-February/045028.html Overview ======== This QUIP specifies the licenses that are used in different parts of a typical Qt module repository and also provides helpful guidance about how to express which license source code is under. License header format ===================== The license header follows the SPDX standard [0]_. There is at least one copyright line and exactly one license expression line:: Copyright (C) 2023 The Qt Company Ltd. SPDX-License-Identifier: A copyright line for code written by a contributor outside the Qt Company can include that contributor's name (or a legal entity they represent) in the Copyright header. The copyright line should include the year the file was created, or - in the case of additional copyright lines - the year the additional copyright notice was added. Updating the copyright year when changes are made to the file is possible. The copyright line may be prefixed with `SPDX-FileCopyrightText:`. The `` must be a valid expression, according to the SPDX standard as defined in [1]_. The license identifiers used in a license expression are either from the list of known licenses [2]_ or prefixed with `LicenseRef-`. The license files are placed into a `LICENSES` directory below the Qt module repository's root. The license files are named after the SPDX license identifier followed by ``.txt`` [3]_. Classification of files ======================= There are various kinds of files in a Qt module repository that should include license headers. Here, we classify these files in order to identify which files should be under which licenses. Files that do not support inline comments do not have to contain licensing information. If licensing information for such files is still desirable, it should be placed into an adjacent ``.license`` text file. For example, ``blob.bin`` may be accompanied by ``blob.bin.license`` in the same directory. Licensing information may be omitted for files with trivial content. The documentation landing page of a Qt module contains a "Licenses and Attributions" section that defines the licenses under which the module and plugin implementation is available. See the list of Qt modules [6]_. Module and plugin implementation -------------------------------- Files that belong to the implementation of Qt modules and plugins. The usual locations for module source code are the subdirectories ``src/`` and ``plugins/``. There are two licensing models for module and plugin implementations: GPL-only and one that is additionally licensed under LPGL. The license expression permitting the LPGL is ``LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only``. The GPL-only license expression is ``LicenseRef-Qt-Commercial OR GPL-3.0-only``. The license expression for files that are statically linked with user code - even for dynamic builds of Qt - is ``LicenseRef-Qt-Commercial OR BSD-3-Clause``. Examples and Snippets --------------------- Files that belong to the implementation of Qt examples. The usual locations for examples is the ``examples/`` subdirectory. Also, any source code that appears in the documentation. The usual locations are ``snippets/`` directories throughout the Qt module repository's directory tree. The license expression for examples and snippets is ``LicenseRef-Qt-Commercial OR BSD-3-Clause``. Tests ----- Files that belong to the implementation of Qt tests. The usual location is the ``tests/`` subdirectory. The license expression for tests is ``LicenseRef-Qt-Commercial OR GPL-3.0-only``. Tools and Utils --------------- Files that belong to the implementation of Qt tools that are for use by Qt users. The usual location is the ``src/tools/`` subdirectory. Also considered tools are script and shell files, as long as they are not part of an example or a documentation snippet. Such files are usually using the following file name patterns: - ``*.sh`` - ``*.py`` - ``*.pl`` - ``*.bat`` - ``*.ps1`` Finally, files that are located in a /util/ directory. The license expression for tools and utils is ``LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0``. Documentation ------------- All ``.qdoc``, ``.qdocinc`` and ``.qdocconf`` files that are needed to generate the documentation. The license expression for documentation is ``LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only``. Build System Files ------------------ All files that contribute to Qt's build system. That includes the following file name patterns: - ``CMakeLists.txt`` - ``*.cmake`` - ``*.pro`` - ``*.pri`` - ``*.prf`` If such a file is present in a snippet directory, it is licensed as a documentation snippets file. If such a file is present in an example directory, it is licensed as an example file. The license expression for build system files is ``BSD-3-Clause``. Testing License Usage ===================== The Qt CI can enforce correct usages of license files. This requires a 'licenseRule.json' file to exist in the top-level directory of the Qt module's repository. This file contain declarative rules, based on file suffix and directory, and should follow the rules set out in this QUIP. They do allow for exceptions and special cases though, if necessary. Related Work ============ The "Software License Agreement between The KDE Free Qt Foundation and The Qt Company Oy" [4]_ poses restrictions for the licenses of the Qt Free Edition modules. To a certain extent, Qt follows REUSE [5]_. REUSE is a guideline on how to specify the licenses in a project. We don't aim for full compliance at this point, due to small/binary files and 3rd party content. References ========== .. [0] https://spdx.github.io/spdx-spec/v2.3/ .. [1] https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/ .. [2] https://spdx.org/licenses/ .. [3] https://reuse.software/tutorial/#step-1 .. [4] https://kde.org/community/whatiskde/Software_License_Agreement_2015_Text.pdf .. [5] https://reuse.software/spec/ .. [6] https://doc.qt.io/qt-6/qtmodules.html