Commit Graph

913 Commits

Author SHA1 Message Date
Marc Mutz c172b40ac6 Include what you need: qquaternion.h
qmatrix4x4.h will lose its qquaternion.h include, so include
qquaternion.h explicitly in all files that mention 'QQuaternion',
unless, for a foo.cpp, the own foo.h has already included it.

Picking all the way back, even though the include removal won't be
picked as far back, because it's the correct thing to do and cannot
fail.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I417307626f61b47f694b18424f8c2941f7b8a31c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-07-04 10:52:21 +02:00
Lucie Gérard 1d2b0f3a48 Make module ready for source SBOM checking
This includes:
- turning VERIFY_SOURCE_SBOM ON
- adding rules to the licenseRule.json files
- correcting the licensing given via REUSE.toml files
- renaming license files not located in LICENSES folder.
Their name needs to be prefixed with `LICENSE.` to be ignored
by reuse and excluded from the source SBOM. The names are
updated in the corresponding qt_attribution.json

A lot of files are skipped during the license test,
but all are present in the source SBOM.
This is why corrections are needed before turning the
source SBOM check on.

[ChangeLog][Third-Party Code] Renaming the license files with prefix
LICENSE. to have them ignored by reuse tool.

Task-number: QTBUG-131434
Pick-to: 6.9 6.8
Change-Id: I98c2f13d06f32d10829351cbadd76db51c3c27b2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-03-20 13:34:56 +01:00
Lucie Gérard e776c032ed Add REUSE.toml files and missing licenses
REUSE.toml files are read by reuse to complement or override the
copyright and licensing information found in file.

The use of REUSE.toml files was introduced in REUSE version 3.1.0a1.
This reuse version is compatible with reuse specification
version 3.2 [1].
With this commit's files,
* The SPDX document generated by reuse spdx conforms to SPDX 2.3,
* The reuse lint command reports that the Qt project is reuse compliant.

In order to be reuse compliant all the licenses referenced in file
or within a REUSE.toml file must be present in the LICENSES
directory at the base of the module.
The missing licenses are added.

[1]: https://reuse.software/spec-3.2/

Task-number: QTBUG-124453
Task-number: QTBUG-125211
Pick-to: 6.8
Change-Id: If07497860c819b00169a349edde641a29a5ef259
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-11-11 08:02:29 +01:00
Lucie Gérard 5b30fe6b8c Change license for snippets and examples files
According to QUIP-18 [1], all examples and snippets files should be
LicenseRef-Qt-Commercial OR BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I34b4d6d4a5a6715fb270a916ac7c19c3a09b27d9
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-04-17 09:13:03 +00:00
Topi Reinio 5277afc2b7 Doc: Move examples to '3D' category
Pick-to: 6.7
Task-number: QTBUG-122377
Change-Id: I674641da56e2a5c3578a81ff3236f7389e5ddd24
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-02-21 09:33:22 +00:00
Mats Honkamaa 59cb54aab9 Doc: Add example categories for Qt 3D examples
Task-number: QTBUG-115985
Pick-to: 6.5 6.6
Change-Id: I1064f04d39d59146e4b5af70403853ad65d12efa
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-08-11 13:03:34 +03:00
Kai Köhne 5551d97a06 pbr-materials: Fix runtime warning
Fixes

 qt.qml.context: qrc:/BasicCamera.qml:14:5 Parameter "aspectRatio" is not declared. Injection of parameters into signal handlers is deprecated. Use JavaScript functions with formal parameters instead.

Pick-to: 6.5 6.6
Change-Id: I51f8e912c41c96fdd10c9fe633ec2be3e52a8ecc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-06-07 11:44:50 +02:00
Mike Krus 437267f149 Restore missing assets
Got removed erroneously when moving stuff to manual tests.

Task-number: QTBUG-111980
Pick-to: 6.5 6.5.0
Change-Id: I66cd16ea570b77825987a9297d317e03a0789d67
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2023-03-17 11:44:34 +00:00
Andreas Eliasson 5859a840c3 Doc: Replace \quotefromfile with \snippet to make code left-aligned
The \quotefromfile command is smart enough to keep the left indentation
from the source file when it renders the code in a code snippet in a
qdoc file. This is all good when you're listing multiple code snippets
and you can clearly see the left-most-aligned code, or 'starting
point'. However, when you use \quotefromfile for a single code snippet
that is indented in the source file, the rendered code in the qdoc file
is not left-aligned - and this looks a bit odd.

Pick-to: 6.5 6.4 6.2
Change-Id: Ie6d2445b37faa4a75749d6013001892de012a1ef
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-03-06 12:12:02 +01:00
Mike Krus 6c1155f6ac Merge both controls based examples
Can toggle underlay mode from main.cpp.

Pick-to: 6.5
Change-Id: Id3ef156b0df9b30dd9d7d3620a2878e70434d69b
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2023-02-28 09:38:31 +00:00
Mike Krus 00d139e39f Move some examples to manual tests
Reduces the maintenance burden.
Also fixed a few issues when moving code.

Pick-to: 6.5
Change-Id: I647f0c1a215f27a0e834d328ca64cfb570639b04
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2023-02-27 13:36:05 +00:00
Mike Krus d1e1ccc8f9 Remove scene2d example and manual test
Not supported in Qt6

Pick-to: 6.5
Change-Id: Id33603d3b88e0eda1ae27e6ed4b8d08e2e0c91c7
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2023-02-23 09:04:17 +00:00
Paul Lemire c889af3880 Remove Qt6 QT_VERSION checks from the code base
Those are left overs from the Qt 5.15 to Qt 6 port. Now that both
code based have diverged, there's no much point in keeping those
checks.

Pick-to: 6.5
Change-Id: I4e83876b6b4cb18b181af32e376f4411054a1183
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2023-02-10 12:37:17 +01:00
Tomi Korpipaa be9ccff07d Fix audio-visualizer example
Pick-to: 6.2 6.4
Fixes: QTCREATORBUG-27852
Change-Id: Icc10aa51f54a7ff19dcff2349048b436f273d6bf
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
2022-10-20 08:05:17 +03:00
Lucie Gérard d8efe38791 Use SPDX license identifiers
Amends commit 2f1bc82b35.
Some files were still missing.

Task-number: QTBUG-67283
Change-Id: Ia16185d82a339fb83939a1d91ecacd717c19eb6e
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-10-12 08:33:12 +00:00
Lucie Gérard 4db4d65cbf Apply fixes for SPDX compliance and easier parsing
Task-number: QTBUG-106233
Change-Id: I376f131892f3adf9785ffa214671f7d5922ef172
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-26 12:12:10 +02:00
Lucie Gérard 8f339ea3d0 Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: I97fa27f60a8546ea3d73cc7daf1b728c615a1ab0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-24 01:53:10 +02:00
Lucie Gérard 0802d82e08 Add license headers to cmake files
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.

Existing copyright statements remain intact

Task-number: QTBUG-88621
Change-Id: I141f5077ae0c11e1058de64d573ca33e2a308ccd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-07-08 13:42:44 +02:00
Mike Krus b8837ca6f5 Avoid clash with internal resources handling in static builds
quick3d already defines a scene3d resource file, static build
generates some symbols to load these.
Avoid clash in symbol names by rename resource file here.

Task-number: QTBUG-102883
Pick-to: 6.3
Change-Id: I962c1a62e4a4379e4ccf0ac5d29383dc551ec8ec
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2022-06-23 09:01:20 +01:00
Lucie Gérard 2f1bc82b35 Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I8105424281eed871037fa6c463871ca8829876b5
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-06-22 10:47:10 +02:00
Mike Krus a0ee9d6b48 Fix compilation of example
Task-number: QTBUG-101595
Change-Id: I9578d2943768c62ad57da9d19d9ca667a2dff3e9
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2022-04-19 09:56:53 +00:00
Kai Köhne 754fad1ba8 Remove .prev_CMakeLists.txt
These are leftovers from the qmake conversion.

Pick-to: 6.3
Change-Id: Id80e21ed99bd67b1d05586f596a9585526d47e7e
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-03-22 14:32:43 +00:00
Kai Köhne 97c866c75f Improve examples CMakeLists.txt
- Remove # generated from xyz.pro comment from pro2cmake
- Remove "# special case" markers for pro2cmake
- Remove automatic use of CMAKE_AUTORCC
- Only opt into CMAKE_AUTOUIC if .ui files are involved
- Remove explicit setting of CMAKE_INCLUDE_CURRENT_DIR
- Combine multiple find_package(Qt6 ... calls)
 - use REQUIRED COMPONENTS
 - sort components alphabetically
- Fix wrong indentations
- Use (only) one empty line after multi-line commands

Pick-to: 6.3
Change-Id: I42cb1788cd53082f71f6a67446dc94f502497dca
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2022-02-15 17:31:17 +01:00
Alexandru Croitor 967130d661 Switch examples to build as isolated sub-builds part 2
qt_examples_build_begin needs the EXTERNAL_BUILD flag
to know that it's safe to build examples as ExternalProjects.

It still won't do it in CI until we enable building
examples as ExternalProjects for prefix builds.

This is preparation for that.

Pick-to: 6.2 6.3
Task-number: QTBUG-90820
Change-Id: I7bd1fdddfba2b87280ebe8bc0762746ade8da468
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-02-05 01:35:26 +01:00
Joerg Bornemann 30199e8ab7 CMake: Use big resources in some examples
Update CMake project files for examples that use
exampleresources/textures.qrc to use big resources.  This avoids too
much memory load on the compiler process.

Pick-to: 6.2 6.3
Fixes: QTBUG-100201
Change-Id: Iba933361f66ccb459f6fd1b36774748117b9655c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-01-27 09:27:45 +01:00
Mike Krus a09a741464 Fix compilation
Task-number: QTBUG-99945
Pick-to: 6.2
Change-Id: I6bafcb26e976e80a0987e2f1d6950cd7cf811794
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2022-01-19 06:31:02 +00:00
Alexandru Croitor 7611c48f0c Switch examples to build as isolated sub-builds
Pick-to: 6.2 6.3
Task-number: QTBUG-90820
Change-Id: I975f67a1899363687092b25d936c874163c661ea
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2021-12-15 11:11:03 +01:00
Assam Boudjelthia cdc32c1e4a Android: trim down the manifest file from unneeded tags
Follow-up to 468e4a8242da3e795fe0b218f97cfd97a1d7e032.

Fixes: QTBUG-95439
Pick-to: 6.2
Change-Id: I1584ca4b29b25e669c8844be1a6941025c93288f
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-12-03 08:46:52 +00:00
Edward Welbourne bc1edab457 Use qDegreesToRadians() in preference to hand-rolled macros
Also remove an unused macro, as well as the one that was used.

Change-Id: I230c6ffded0a6db7e25c0a6b8f3f82bf583f4005
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-09-10 13:18:14 +02:00
Joerg Bornemann 2372efc5d1 Raise cmake_minimum_required to VERSION 3.16 in examples
Pick-to: 6.2
Task-number: QTBUG-95636
Change-Id: I2ae5ba6164cb5ed450c8924d484d30167461c10d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-17 13:48:01 +02:00
Alexandru Croitor 018d776786 CMake: Fix incorrect dependency on private modules
Public modules shouldn't propagate private modules as usage
requirements.

Pick-to: 6.2
Fixes: QTBUG-93428
Change-Id: Ic7aca0e8a6469604722596782e87d92d7e510e9e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2021-08-05 13:43:47 +02:00
Mike Krus 3964b27345 Disable RHI Renderer by default
RHI renderer use ShaderTools which is GPL licensed. This patch
disables the plugin by default until Qt3D provides a suitable
replacement for the dependency.

To enable the RHI backend, compile Qt3D and pass parameter
-DFEATURE_qt3d_rhi_renderer=ON to cmake.

Unfortunate side effect of RHI backend being disabled is that
when using Scene3D, the QtQuick renderer must be configured to
use the opengl backend.

[ChangeLog] RHI Backend is not longer built by default

Task-number: QTBUG-94960
Pick-to: 6.1 6.2
Change-Id: I0bff7523e159b800734b58bfef37e5088d0a0d41
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2021-07-19 16:14:26 +01:00
Lars Knoll c143cb02ba Disable the audio visualizer example for now
It requires Qt Multimedia, but as that API has changed
significantly, the example won't currently compile.

Change-Id: Ic64ec8382b6a3dc778b1a9e2d6ff95a200fe8415
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-06-07 14:45:58 +02:00
Joerg Bornemann c1ae8a2812 Use fixed qt_add_resource BASE argument
Task-number: QTBUG-86726
Change-Id: I2a7748b67b55008962809ece1a34c6cf2a0617bb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-04 15:43:42 +02:00
Paul Lemire 3811620724 wireframe example: fix to run properly
- use qrc:/ prefix for resources required by Qt 6
- for Qt3D OpenGL backend as RHI as no support for Geometry/Tessellation
  shaders

Change-Id: Ie5bd0381088de561ead0c5592f16bbacb68043e6
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2021-06-02 07:07:25 +00:00
Paul Lemire 45b04bdc52 wave example: for Qt3D's OpenGL backend
As RHI has no support for Geometry Shaders

Change-Id: I1f7f3a375be463936e5bda59362b08d9b0e34c9a
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2021-06-02 09:07:25 +02:00
Paul Lemire f36708263b Don't build Scene2D examples
Since we haven't ported Scene2D over to Qt6 yet following the whole
QtQuick rendering changes.

Change-Id: I95c6eb8d70bcfafa2ee51ee684b2e4b9177f1f13
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2021-06-02 07:59:04 +02:00
Joerg Bornemann b7b7285d01 Re-generate CMake project files for examples
Pick-to: 6.1
Change-Id: Ic123a704f904096e112b5bdece167800dfc295bb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-18 16:27:34 +02:00
Paul Lemire 3dbfb4f73f pbr-material example: add qrc:/ prefix resource for assets
So that assets are properly picked up by Qt 6

Change-Id: I78eb79f0c4f5a2e124d57692d4af2947e743bd33
Pick-to: 6.1 6.0
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2021-04-23 11:00:42 +02:00
Paul Lemire 7821344a88 Minor fixes to compile against 5.15
Change-Id: Id9574cf23b9af29815d8452915cebfc380fd94d1
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2021-02-01 09:20:47 +01:00
Mike Krus 8a6b7a377d Update QtQuick API to build with 5.15
Haven't tried to run anything, it just builds

Change-Id: I6c2c2a949bc3892a363697cf38f1608af87c303c
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2021-01-11 11:48:21 +00:00
Mike Krus 090ea5502e Enable compiling non-QML API against Qt 5.15
Built with QtQuick disabled.

- C++17 required
- minor issues with QList vs QVector
- QMutexLocker templated vs not
- moc forward declaration handling

Change-Id: I5540625e74e2c009e528f56203e4b88be8d54599
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2021-01-05 16:03:03 +00:00
Paul Lemire 934c9f9292 QtQuick based examples: let QtQuick/Qt3D decide on backend
Change-Id: Id3ab38d02f8df7701410b8fcef8e112057825ecf
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-11-26 17:47:36 +01:00
Paul Lemire 230a2650d7 planet-qml example: port to RHI
Change-Id: I4246c59903a6d8f302a916ba7d19e9e37b5fe9c8
Pick-to: 6.0 6.0.0
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-11-26 17:47:24 +01:00
Paul Lemire 1e62ec8397 control examples: fix asset path to also work on Qt6
Pick-to: 6.0 6.0.0
Change-Id: I723807d46d043c4d78dd6c6ead598886a7974efb
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-11-26 14:49:35 +01:00
Paul Lemire 6531a4e6c5 advancedcustommaterial example: add RHI support
Pick-to: 6.0 6.0.0
Change-Id: I2e356cb893710c759a4d73eaf850ce39d46e5935
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-11-26 14:49:22 +01:00
Paul Lemire 4ad2efac3e simplecustommaterial example: add RHI support
Pick-to: 6.0 6.0.0
Change-Id: Id1dfc3c6a6f0c8090b5c5facc1a0dd9bb5a02bd6
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-11-26 14:31:45 +01:00
Paul Lemire e57682ca4f compute-particles examples: add RHI techniques and shaders
Pick-to: 6.0
Pick-to: 6.0.0
Change-Id: I56f1bb06479f82a10dda6dce0902a64381cd8147
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-11-24 19:57:36 +01:00
Mike Krus b0dbd67d7b Fix deprecated API usage and compile warnings
- QVariant::Type deprecated, use QMetaType related APIs
- QNodeId not used as reference in for loops (nop but really noisy)
- some unused code

Change-Id: I291219207fcd1ad0bf89533b4e2bb5fa47a353bb
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-11-20 14:58:05 +00:00
Mike Krus cbe7310d2a Fix build for latest qtbase changes
Change-Id: Ifc20f29a849be695558851d5ea01a68f94c35f26
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-11-05 11:14:56 +00:00