Like other examples already do. It would have prevented (at least
when CMake is used, not qmake) problems like in the associated
bug report where .qsb files from newer versions were cherry picked
to older Qt branches that cannot load them.
Pick-to: 6.10 6.9 6.8
Task-number: QTBUG-135407
Change-Id: I25bf69139de13a70e3682865dd779e0a5ab05e28
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
QPair is just an alias of std::pair anyway.
Task-number: QTBUG-115841
Change-Id: I26fc90adcc775aac9955ad57304af914dc4ed48f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Add a missing dependency to QtQuick so that qmlls stops complaining
about Spinner's base type QQuickItem.
Amends a86fd709dd.
Pick-to: 6.8 6.9
Change-Id: I7e8af3ee053ecbe66074104be86359a006ed9a05
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The SceneGraph - RHI under QML example gives the impression that
QQuickWindow::beforeRendering() is used with underlays and
QQuickWindow::afterRendering() is used with overlays which is
misleading.
QQuickWindow::beforeRendering() can be used to upload data to buffers in
both instances. Then, based on whether an underlay/overlay is required,
the user can QQuickWindow::beforeRenderPassRecording() or
QQuickWindow::afterRenderPassRecording(), respectively.
This patch updates the documentation to make this distinction clear.
Fixes: QTBUG-130570
Pick-to: 6.6 6.7 6.8 6.9
Change-Id: I3d086b9309d759a5e80f4abbd81d2fc1da55e9f0
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Usage of a private module needs a respective find_package call now.
Change-Id: I20f7571e11ab9b2ca6d185b4834e72100d9ce2d6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Using textureSize in the uniform block leads to renaming it
to _textureSize when transpiling to GLSL. This is not
reflected in the reflection metadata for some reason.
For OpenGL this matters because the QRhi backend won't
be correctly able to set up the uniforms when the
names do not match. To overcome this, use a name
in the shader that does not conflict with a built-in
GLSL function. Strictly speaking the name (textureSize)
is somewhat incorrect anyway. Use texCoordScale to
express its meaning better.
Pick-to: 6.7 6.6 6.5 6.2
Change-Id: I863e98c6d56cc46fad895763b9b5106a40e2952c
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
The method got removed in Qt 6.0, and the example code was adjusted
accordingly (commit fb96109bbc).
While at it, also remove the mentioning of the even older
QQuickWindow::createTextureFromId(), as that is most likely
not relevant for new users looking into this example.
Pick-to: 6.6 6.7
Change-Id: I2ea3fcf3de78e13afec9e2b25aa8d4a6a9a9b571
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
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>
There are issues with for loops in GLSL, see for instance:
https://learnwebgl.brown37.net/12_shader_language/glsl_control_structures.html
The solution is to rewrite the shader so that it also works on WebGL.
Fixes: QTBUG-123593
Change-Id: Ia9fd4d9ef3f1b99a29d4bbabae20ad779fe4fbba
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
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>
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>
The size policy of item updated as part of task QTBUG-117597. This
patch update existing examples and manual tests that depends on quick
layout to embrace size policy change.
Task-number: QTBUG-117597
Pick-to: 6.7
Change-Id: I68469a3bba3c4d3e5ed4b6eae0fd765b5206efc0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Based on the API review. Also follow QRhiWidget for
symmetry.
Pick-to: 6.7
Change-Id: Id04a0029ebeb9326b76b485414b58c83f384c466
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
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>
The current page only mentions qmake. Let's add a CMake section.
Also, make minor grammatical fixes.
Fixes: QTBUG-118802
Pick-to: 6.6 6.5
Change-Id: I311084c72f609a72ef5716964cd6c7c28fa64208
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
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>
In the dev (6.7) version this is definitely not needed.
Not sure how it got there.
Change-Id: Iba0c68aef0fc19c92565908d622e4f8827fe72c9
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
To make the logical window/item size vs. reality (texture sizes
in pixels) difference obvious immediately.
Also change the slider max value to 2048 to allow exercising up to
2048x2048 textures.
Also clean up the texture format label.
Change-Id: I27e0d1fe99fa2a32f55176612ac1ca65c9045a4d
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
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>
Use FrameAnimation instead of Timer and double the amount of samples
to make the example smoother.
Pick-to: 6.6
Change-Id: I6f5bb1414fd7532e16aeb25f886879828ce29854
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Add mobile example category tags for the chosen examples.
Add for the ones that work best for both Android and iOS.
Remove from the ones that do not work for both (at least yet).
Added, as verified on Android
-scenegraph openglunderqml
-qtquickcontrols-contactlist
-qtquickcontrols-gallery
-qtquickcontrols-wearable
Removed (for now), as not verified yet on Android
-qtquickcontrols-todolist
Fixes: QTBUG-116780
Pick-to: 6.6
Change-Id: I7f22329ec93dedaa63df34bb55dd67d14ffe5c1d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
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>
The "Scene Graph - Vulkan Under QML" example includes snippets of code
from the example source file(s) using a combination of the `\skipto` and
`\printto` QDoc commands. The former skips content until the line that
contains the argument passed to the command
(here, "class VulkanSquircle"). The latter prints lines up to, but not
including, the line that contains the argument passed to the command
(here, "public"). I suspect the author's intention was for QDoc to
output lines from the start of the class declaration until the public
access specifier in the member specification of the class. However, the
first instance of `public` QDoc encounters is the base-specifier of the
derived class, which is on the same line as the argument to the
`\skipto` command. Hence, there's nothing for QDoc to output.
Modifying the argument to include the colon that indicates the keyword
is for member-declarations ensures QDoc generates output as expected.
Fixes: QTBUG-116304
Pick-to: 6.6 6.5
Change-Id: Ibfc17fbacd10f902fc2a5f57873fe0990571535e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Try to follow the QRhiWidget API in most ways.
Implies that the rhitextureitem example is repurposed
to be the QQuickRhiItem example.
The qquickitemrhiintegration autotest is repurposed as
the qquickrhiitem autotest.
Task-number: QTBUG-113331
Change-Id: I045d87f82ace07c8571c72c78e193cd5201cad69
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
fboitem, the OpenGL-based QQuickFramebufferObject example is now gone,
replaced by the rhitextureitem example.
It is now possible to implement a custom QQuickItem that renders into a
QRhiTexture and then draws a triangle/strip geometry textured with that
texture using just public Qt Quick APIs and the semi-public QRhi APIs.
There should be conveniences provided for this in future Qt versions,
but for the time being we provide an example how applications can do
this in Qt 6.6 already. This complements the rhiunderqml example which
shows the underlay/overlay approach, and the customrendernode example
that shows the "inline" approach with a custom QSGRenderNode. The
rhitextureitem example added here shows the third, "offscreen" approach
that goes through a texture.
The example docs are better than before but not yet complete.
To be extended separately.
Task-number: QTBUG-113331
Change-Id: I83000c08b057dd72371e2909905120dc496cb34d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
And fix up the scenegraph example list on the Qt Quick example page.
Task-number: QTBUG-113331
Change-Id: Ic7b97871253d16b778f7da6088f4a9130bef2ec5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
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>
This was selected as a featured example for Qt for Android, so it has
been given some attention.
Fixes: QTBUG-112517
Pick-to: 6.5 6.5.1
Change-Id: Ic8b5f2c92930f9135bf0bcfff8ca564f393d781d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
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>
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>
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>
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>
The qDebug() doesn't add any value to the example.
Fixes: 6.5
Change-Id: I73c1af251f342e3ed542f683dd0b3d71d92a3f58
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>