Commit Graph

21 Commits

Author SHA1 Message Date
Laszlo Agocs e32d335c8f sg: Fix culling in layers
Pick-to: 6.10 6.9 6.8
Fixes: QTBUG-136611
Change-Id: If2a0a0365ca24360d850ffce98c0bec4a3961976
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
2025-07-22 14:17:21 +02:00
Dennis Oberst a2fef7d214 Examples: Add explicit 6.9 project setup for private library users
Looking up private libraries requires version 6.9 or higher.

Amends: f71e2f9955.

Pick-to: 6.9
Change-Id: I3a22893aef4dda6825955157667bec38f7b82b96
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-03-10 09:14:24 +01:00
Joerg Bornemann f71e2f9955 CMake: Fix examples built as external projects
Usage of a private module needs a respective find_package call now.

Change-Id: I20f7571e11ab9b2ca6d185b4834e72100d9ce2d6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-01-31 17:11:34 +01:00
Even Oscar Andersen 793f81b1c6 Set correct shader version for CustomRenderNode example
The custom rendernode example uses the default GLSL which is:
"100es,120,150". The problem with this is that gl_VertexId only
exists in OpenGL ES 3.00 or later, and GLSL 1.30 and later
end result is that the shader compiles but does not run.

Change-Id: I1ac18e381b1e8b28368f67e4140f4bb43bb17e62
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-04-19 12:39:01 +02:00
Alexandru Croitor a6bd1dc3e0 CMake: Add deployment API to our examples
Projects were modified using the tool at:
https://git.qt.io/alcroito/cmake_refactor

A few examples had to be adapted manually, mostly those that build
additional qml modules / plugins.

The INSTALL_EXAMPLESDIR and INSTALL_EXAMPLEDIR assignments were
removed, these are not needed anymore because example directory
selection is handled by the qt_internal_add_example calls.

The install(TARGETS) calls were modified according to our
documentation snippets for qt_generate_deploy_qml_app_script.

A qt_generate_deploy_qml_app_script call was added for each
executable target.

Note that the deployment step will be skipped in the CI for now,
because:
- we enable QT_DEPLOY_MINIMAL_EXAMPLES in the CI instructions and thus
  set QT_INTERNAL_SKIP_DEPLOYMENT to true
- standalone examples feature is not yet enabled in the CI, which
  means we continue to build examples in-tree, and deployment is
  disabled for in-tree prefix builds.
A small list of examples to deploy in the CI will be chosen in the
future, to ensure deployment coverage, without slowing down overall CI
times due to all the *deployqt invocations.

Even if deployment is disabled in the CI, the install(TARGETS) calls
for each example will still run, installing into an
'installed_examples' directory, which will not be archived by the CI.

The QtBundleQmlModuleForMacOS and bundle_shared code was removed,
because we can now depend on the MACOS_BUNDLE_POST_BUILD option of the
deployment api, to ensure macOS bundle examples run properly in the
build dir. This works even in prefix in-tree builds, when installation
deployment is disabled.

Finally, for all examples that build additional qml module libraries or
plugins, the libraries / plugins must be installed into the bin dir of
each project, along with a qmldir file.

This is to support running the installed project for platforms that
don't have deployment api yet, like boot2qt / yocto.

If we want to have super clean install / deployment rules in the
future, we won't be able to avoid adding ugly per-platform conditions.
The current status quo is deemed an improvement over what we had
before.

Pick-to: 6.7
Task-number: QTBUG-101340
Task-number: QTBUG-102056
Task-number: QTBUG-102057
Change-Id: I843d934668c25dbcd1abca52495b393579633fc5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-27 18:57:34 +01:00
Lucie Gérard 53295d9102 Correct license for examples files
Example takes precedent over build system file type.
According to QUIP-18 [1], all examples file should be
LicenseRef-Qt-Commercial OR BSD-3-Clause

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

Pick-to: 6.7 6.7.0
Task-number: QTBUG-121787
Change-Id: Ie8c2539e7659f53a1fd6b48f99ee883ee9aeb0a7
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-03-21 10:41:29 +01:00
Tim Blechmann 1dbdcf070f examples: fix unused parameter warning
Change-Id: I6ca097113fb2b3ba0a7ddde251f9068538af986c
Pick-to: 6.7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-02-14 02:53:46 +00:00
Jaishree Vyas 486cc33ce5 Doc: Create separate Graphics and Multimedia example categories
Fixes: QTBUG-117884
Pick-to: 6.6 6.7
Change-Id: Ib0bb6217c29795fe50efdf827aa9902bbd572032
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2024-01-17 15:36:27 +01:00
Topi Reinio dfe316ad0b Doc: Fix linking issues and missing QDoc commands
Fix multiple incorrect \l (link) command arguments that were not
captured by documentation testing in CI.

Add missing \endqml and \endcode commands to code snippets.

Convert \sa commands that are meant to be related to specific \section
commands into manual 'See also' paragraphs. Otherwise, they are listed
at the bottom of the page.

Pick-to: 6.7
Change-Id: Icf2a97f63b8b8cdec2d9398448d28759dabdb06b
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
2024-01-06 05:50:39 +00:00
Laszlo Agocs d70b847f77 Fix corrupt rendering when toggling rendernode-based items
Meaning the toggling of visibility. Having a QSGRenderNode come and
go in the scenegraph leads to visual problems, in case the adding
and removal of the node toggles the m_forceNoUseDepthBuffer flag,
which in turn makes useDepthBuffer() return a different value
than before (so disables and then enables doing the opaque
pass in the renderer). Changing this value needs a full rebuild
of the render lists. When adding a node, this is done (regardless
of toggling the flag). When removing, it was not done at all.
Now we do it when resetting the no-Z flag back to false.

Add a button to the customrendernode example to toggle visibility
since this is useful for example's purposes anyways. However, this
on its own is not sufficient to reproduce the issue. For that,
the DepthAwareRendering flag needs to be removed from the
QSGRenderNode subclass.

Pick-to: 6.6 6.5
Fixes: QTBUG-119160
Change-Id: I232354d88f5a4fe5f9f2d6102d0d5439d92782fb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-11-24 18:34:03 +01:00
Eskil Abrahamsen Blomfeldt 85e65e101b Add license headers to shader source
Pick-to: 5.15 6.2 6.5 6.6
Change-Id: I007eaddf0a3a9e7e6242d4e02b487fa0806c96a7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-10-30 10:30:37 +02:00
Laszlo Agocs aeb3bd235a Clean up customrendernode example
Make it more consistent with other scenegraph examples, and make it
more compact, in particular when it comes to handling the QRhi
resources (smart pointers are quite useful in this case since they
help dropping a bunch of lines)

Expand the docs.

Pick-to: 6.6 6.6.0
Change-Id: I97bceca7759db9738d34f0fbf7eb29b0ae6e4c0f
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2023-09-25 09:01:17 +00:00
Inkamari Harjula e421c21c3b Doc: Add example category to all the files that haven't yet got it
Added example category and also fixed one copy-paste mistake in Vulkan Texture Import.

Task-number: QTBUG-116205
Pick-to: 6.5 6.6
Change-Id: I96692f214849596e9555c635d9996d9b884c5cab
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-09-06 06:55:46 +00:00
Kai Köhne 8f1e6aa0ed Examples: Fix license to Commercial or BSD-3-Clause
Pick-to: 6.5 6.6
Change-Id: Ieb1db96846e02c3b93888ed409af82bfb3567c19
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-06-26 16:23:24 +02:00
Laszlo Agocs 040189e8e2 rhi examples: expand docs
Change-Id: I88991ffe3612b76aaa687f86acd59e24c5543a76
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-01 19:22:29 +02:00
Laszlo Agocs ace43e1db1 Adapt to the RHI API concept
Besides following the header naming changes, make the obvious API
changes that are based on data that is already there but was hidden
previously due to not wanting anything QRhi to shine through in the
public API.

This kind of hiding is no longer needed, even if qrhi.h and similar
still cannot be included from a public header. Forward declarations
are now perfectly fine however.

Task-number: QTBUG-113331
Change-Id: I9a114082cf9218edc487df50956f5793d6b8bdb4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-05-22 12:08:08 +02:00
Kai Köhne 2e6403f8bf Examples: Use versioned CMake targets for Qt modules
Use e.g. Qt6::Core instead of Qt::Core. This is better matching the
find_package(Qt6 ...) call, and also avoids issues that the versionless
targets have.

Pick-to: 6.5
Task-number: QTBUG-113277
Change-Id: Ib80f885e9f73fb9ad54b9e9b22cae2318877dc07
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-02 12:12:35 +02:00
Ulf Hermann 2d44365f69 CMake: Allow omitting the version of QML modules
Also, drop all the VERSION 1.0 lines from the examples and tests. 1.0 is
actually a bad default version since it's before all the Qt versions.

[ChangeLog][QML] You can now omit the VERSION argument to
qt_add_qml_module(). This will automatically generate the highest
possible version.

Pick-to: 6.5
Task-number: QTBUG-99146
Change-Id: Ic10ec69b87c224e0e94e1785f65653815d4c778c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2023-01-27 19:16:39 +01:00
Oliver Eftevaag 1c6afffc94 Quick scenegraph examples: use qsTr() for user facing strings
All user facing strings should use qsTr()

Pick-to: 6.5
Change-Id: I2f776fe088b05bb046ceafbc6c29528212a2c1a0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-01-17 16:45:12 +01:00
Oliver Eftevaag 7409c217e8 Quick examples: Modernize cmake files according to our guidelines
The following changes are made to the CMakeLists.txt files in all
quick examples:

- Use PRIVATE linkage when possible.
- Use qt_standard_project_setup()
- Set WIN32 and MACOSX_BUNDLE in qt_add_executable() instead of
  set_target_properties()

Pick-to: 6.5
Change-Id: I18217585aec56794b327f103d6959879df59d68a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-16 16:16:47 +01:00
Ben Fletcher 7be8566719 scenegraph: Add example for QSGRenderNode based RHI rendering
Add an example to demonstrate RHI rendering in the scenegraph with a
custom QSGRenderNode.  Works for Vulkan/OpenGL/Metal/D3D rendering
directly, and into a layer.

Change-Id: I0333f63fd729312b71e51f5b6376e46f8afe1fe6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-11-01 10:39:02 -07:00