Commit Graph

62 Commits

Author SHA1 Message Date
Fabian Kosmale 2a32ec77c0 examples: Consistently require Qt 6.8
This prevents policy warnings in a few cases, and we want people to
opt-in to new policies, so make our examples copy'n'paste friendly.

Pick-to: 6.8
Task-number: QTBUG-126201
Task-number: QTBUG-126468
Change-Id: Iefa666b61c2d2f767da3583f0f6efd8e4a2169e5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
2024-07-03 08:43:43 +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
Eirik Aavitsland 1ebd8ef853 quickwidget example: Avoid potential for crash on close
Widgets that had been broken out to separate top-level windows would
live on after the mainwindow was closed. Subsequent attempts to move
them back to the tab widget would crash, since the that would be
deleted by then. Fix by closing detached top-level windows on
mainwindow close.

Fixes: QTBUG-122790
Pick-to: 6.7 6.6 6.5
Change-Id: I0ae268c5e30b6563dc1556b3f79a83418cc3c703
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-29 17:56:20 +01:00
Shawn Rutledge f719ee6408 Avoid crashing in the quickwidgets example after closing the subwindow
Closing the window deletes m_quickWidget; so we disable the menu items
for grabbing from it, because those cannot work. Also add asserts.

Fixes: QTBUG-120296
Pick-to: 5.15 6.2 6.5 6.6 6.7
Change-Id: I68154c2d1e4553c771815e29cbe3b095d85893f1
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-01-05 22:50:35 -07:00
Jaishree Vyas 46fc095ae4 Doc: Add example categories for qtquick
Task-number: QTBUG-116334
Pick-to: 6.5 6.6
Change-Id: I993b6157c3ef8a69e4e218d62596b5219ab4b34b
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-09-26 14:08:47 +02:00
Laszlo Agocs 76ae3dd783 Fix QQuickWidget rendering API mapping for D3D12
Right now requesting d3d12 via QSG_RHI_BACKEND or the C++
API maps to the Null backend of QRhi. That is not ideal.

QRhiWidget has this logic, but the already existing
QQuickWidget was not yet adjusted in 6.6 it seems.

Pick-to: 6.6
Change-Id: I12301e815d525c14584b01dcd0caa787d1c79ad0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-09-04 14:55:03 +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
Oliver Eftevaag dc58fc1f10 quickwidget and tableview: Make example cmake files adhere to guidelines
- Add qt_standard_project_setup(REQUIRES 6.5)
- Use PRIVATE linkage
- Set WIN32 and MACOSX_BUNDLE properties directly in qt_add_executable()

amends 94e3cf3d95eda294cd578bea01c04e9527a9fd68

Pick-to: 6.5
Change-Id: Ic02b7b15a8aea9387d93ab024f05feeab8a84016
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-02-21 19:45:44 +01: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 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
Lucie Gérard 1b9808737a Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: Id89ed14990804a5024183e75382cc539d4293da1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-07 17:01:30 +02:00
Kai Köhne b7f448f864 Examples: Do not use import version numbers anymore
Pick-to: 6.4
Change-Id: I1f4d4920bb9d132a846ac2dbcfdb8b660759d540
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-08-31 16:37:35 +02:00
Lucie Gérard 5a7b716474 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: I72c89a98c42bbc9234d8495e9e503bec81d11037
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-07-08 10:41:06 +02:00
Lucie Gérard 0dc4fd240a Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-06-11 08:05:15 +02:00
Laszlo Agocs a184f2e0ab Make QQuickWidget QRhi-based
When it comes to examples, quickwidget has the direct OpenGL usage
removed because we want this example to be working with any graphics
API. qquickviewcomparison, which features direct OpenGL usage within
its Qt Quick scene, is renamed to a more descriptive name and is also
getting a doc landing page. It continues to be requesting OpenGL (via
QRhi) explicitly.

Change-Id: Iae5b835441f3af229e9746e14dedbe9d1a62b2b9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-03-18 22:56:54 +01:00
Kai Köhne e2138561df Use QSGRendererInterface::OpenGL in documentation and examples
QSGRendererInterface::OpenGLRhi is only an (undocumented) alias to
...::OpenGL, so let's use that instead.

Amends 0b2311a62b

Pick-to: 6.2 6.3
Change-Id: I4acdd39dc1d9b75bed5c474667a43b4ad86e7f47
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-02-14 11:38:10 +00:00
Kai Köhne 9d82f4bff8 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: I0d6bfb06c4b25e9921d3d2bf31d977150f12b31b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-01-24 13:25:13 +01:00
Craig Scott a86fd709dd Update quick examples to new QML CMake API
This is a pre-requisite to being able to make
qt6_qml_type_registration() an internal rather than public command.
Not all examples have been updated, only those that were using the
qt6_qml_type_registration() command.

Task-number: QTBUG-95093
Pick-to: 6.2
Change-Id: I3f1814a29af608461daa90477eca0aa2304eb9d1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-24 16:08:21 +10:00
Joerg Bornemann b4ab58d791 Raise cmake_minimum_required to VERSION 3.16 in examples
Pick-to: 6.2
Task-number: QTBUG-95636
Change-Id: I9f76b787533dad1c469fbb8c69df6c27b20a9aa3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-17 13:48:14 +02:00
Ulf Hermann 213b890899 Add missing "override" keywords
Our examples should follow best practices.

Change-Id: Ice90a818ae46e921b421e8d297806d8f7200294b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-06-30 14:17:01 +02:00
Alexandru Croitor 20d5e2d7ef CMake: Regenerate examples to set the WIN32_EXECUTABLE property
As well as the MACOSX_BUNDLE properties as necessary.

Task-number: QTBUG-87664
Task-number: QTBUG-86827
Change-Id: I46769fb543acb2cbeba122470b5e44ad478fbe4e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-26 23:38:39 +01:00
Alexandru Croitor 903252b240 CMake: Regenerate examples to use qt_add_executable
Task-number: QTBUG-87661
Change-Id: Ie5bba408000211b24694aa0143bdf79c4a298f42
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
2020-10-20 09:32:34 +02:00
Laszlo Agocs 4e266103ad Rename setSceneGraphBackend to setGraphicsApi
...and fix up the docs.

The string-based setSceneGraphBackend() stays of course (the docs have
been enhanced, however). The GraphicsApi enum-based overload is now
renamed to setGraphicsApi().

Using the same name for both functions is a historical artifact, reflecting
the evolution (5.0 - 5.8 - 5.14). In 6.0 we can give it a more appropriate
name, since it does not have much to do with "backends" from the user's
perspective.

Change-Id: Id75dbf81f50a148797e5b5de9be4000153737473
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-06-22 16:10:52 +02:00
Alexandru Croitor a7c7e7ceaa CMake: Don't install .qmltypes for Qt tests, examples and tools
that don't have an explicit QT_QML_MODULE_INSTALL_DIR path
specified. We don't want to pollute the Qt qml import path with
these files.

Task-number: QTBUG-84403
Change-Id: I768267e0e79daa8090d882c301648cce14e1a809
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-29 10:01:40 +02:00
Alexandru Croitor 965984771d CMake: Regenerate qtdeclarative/examples
Includes
- new example installation paths
- one case of QT_QMLTYPES_FILENAME addition

Change-Id: I24423da9b04b6ecc8445017fa35f148dd43b1829
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-05-29 10:01:22 +02:00
Laszlo Agocs 0d80dbd8c2 Enable QQuickWidget with OpenGL over RHI
Also adapts to new NativeTexture format, where the actual
handle is passed around instead of a pointer to it.

[ChangeLog][QQuickWidget][Important Behavioral Changes] In
earlier versions, the returned value from QQuickWidget::quickWindow()
would persist for the life time of the widget. This is no
longer the case, so if you are connecting to its signals, make
sure you also connect to its destroyed() signal and update the
connections when it is destroyed.

Fixes: QTBUG-78638
Change-Id: I33cee8543ef1ff5d31555ed3ac18ba78c9c45102
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-05-27 10:45:45 +02:00
Alexandru Croitor b684ba2194 Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
        dependencies.yaml

Change-Id: Ie3e9dc62031a85e5e81cbdf04694b95159d49fca
2020-01-29 16:52:58 +01:00
Alexandru Croitor 97a5cf8634 Regenerate examples
Change-Id: I39564d4b644a7ee367d9ce92b85426a5c2a122a4
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-29 15:39:22 +00:00
Ulf Hermann 406f15ce0e Quick: Don't qualify OpenGL includes
The headers are moving from QtGui to QtOpenGL. By avoiding the
qualification we can keep them compiling either way. Also, add
opengl-private to make the types available.

Also removed the QGraphicsRotation hack to get access to the projected
rotation function of QMatrix4x4. The function is public now.

Task-number: QTBUG-74409
Change-Id: I216e8ca09f8e247f96627b081308e3a57c55c29c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-01-27 13:03:18 +01:00
Leander Beernaert 1d333d3375 Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: I0c5b939c70bdb91ccdf7068784308416dcaa5736
2020-01-16 16:25:06 +01:00
Ulf Hermann 2c3419e127 Generate registrations for all examples
Now that we can generate all QML type information at build time, we
should also use it.

Change-Id: I647c72bbe38fdb2deb565b75c86a696af3d15b61
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-13 16:47:57 +01:00
Alexandru Croitor c2f8b9535d Merge remote-tracking branch 'origin/dev' into wip/cmake
Removed dependencies.yaml because we don't use it yet in wip/cmake.
Fixed conflict in qmlcachegen.cpp.

Change-Id: Ie1060c737bee1daa85779903598e5b6d5020d922
2019-10-14 19:02:37 +02:00
Leander Beernaert 9e633bbda7 Regenerate Examples
Change-Id: I2fbfb44bbb6d667e022bffb480feaf74ff0d0a5e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-14 09:09:55 +00:00
Ulf Hermann cc1a604c70 Specify parameters of type registration in class declarations
Using this technique we can automatically register all necessary
revisions and minor versions of a type, using the metaobject system.
This greatly reduces the potential for mistakes and resulting
incompatibilities between versions of imports.

We assume that for each type we need to register all revisions of its
super types and its attached type, and that the revisions match. That
is, if you import version X of type A, you will also get version X of
its attached type and of any super types. As we previously didn't take
these dependencies into account when manually registering the types, a
number of extra revisions are now registered for some types.

Potentially, we can now generate the qmltypes files at compile time,
using moc.

Change-Id: I7abb8a5c39f5e63ad1a0cb41a783f2c91909491b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-26 12:32:17 +02:00
Leander Beernaert bf58a1cc04 Update Examples with lowercase qt6_add_resources()
Re-run pro2cmake on all exampls.

Change-Id: Iafd1092beff023b407a8f29c2a5b651f2e534b75
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-09-20 08:38:06 +00:00
Leander Beernaert b938edcfb3 Convert Examples
This patch converts all examples in qtdeclarative except for a few
exceptions which require a public facing qml plugin api.

Change-Id: I2cd2b1bb455be8b48796893a8235dea7f8b35aa2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-08-23 13:51:06 +00:00
Shawn Rutledge e17c89f4ce use the override keyword consistently and correctly (clang-tidy)
Change-Id: If9e28d143f8cba3df3c757476b4f2265e2eb8b2a
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2018-02-27 08:27:38 +00:00
Shawn Rutledge 06e962f263 init variables where they are declared when possible (clang-tidy)
clang-tidy -p compile_commands.json $file -checks='-*,modernize-use-default-member-init,readability-redundant-member-init'
 -config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' -header-filter='qtdeclarative' -fix

Change-Id: I705f3235ff129ba68b0d8dad54a083e29fcead5f
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2018-02-26 13:08:30 +00:00
Liang Qi 15dd1b7883 Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
	src/qml/qml/qqmlimport.cpp
	src/qml/qml/qqmlimport_p.h
	src/qml/qml/qqmltypenamecache.cpp

Done-with: Ulf Hermann<ulf.hermann@qt.io>
Change-Id: I41ba7a592b2659ddf53da6952ea3b456a7bba319
2017-10-24 11:13:09 +02:00
Friedemann Kleint f82c4de515 Qt Quick examples: Introduce QCommandLineParser
Task-number: QTBUG-60630
Change-Id: Iaf24e09fdec92f8af495a1288685f266c39be4a7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-10-18 09:45:59 +00:00
Kai Koehne 341a04377b Fix outdated FDL license header
Change-Id: I76dccf547de40b5e72fd7abaa062fa96cb2c118a
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-10-17 11:18:21 +00:00
Kai Koehne ea6cd0de3c Fix outdated BSD license header
Change-Id: Icc08925454445fc9497fb3bfd2c26efe90605983
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-10-17 11:18:11 +00:00
Liang Qi 0e80d28aa5 Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
	src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp
	src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
	src/qml/qml/qqmlimport.cpp
	src/quick/items/context2d/qquickcontext2dtexture_p.h
	tools/qmleasing/splineeditor.h

Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
2016-12-14 19:01:23 +01:00
Lars Knoll e579076bb3 Get rid of most QT_NO_FOO usages
Instead use QT_CONFIG(foo). This change actually detected a few
mis-spelled macros and invalid usages.

Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-11-29 10:10:27 +00:00
Liang Qi f04c2c40fd Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
	src/qml/jsruntime/qv4variantobject.cpp
	src/qml/types/qquickworkerscript.cpp
	src/quick/scenegraph/util/qsgdefaultpainternode_p.h
	tools/qmljs/qmljs.cpp

Change-Id: I876242714ec8c046238d8fd673a5ace2455b2b59
2016-10-18 08:33:26 +02:00
Liang Qi 102fa9b6db Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
	examples/quick/quickwidgets/quickwidget/main.cpp
	src/qml/jsruntime/qv4jsonobject.cpp
	src/qml/jsruntime/qv4qobjectwrapper.cpp
	src/qml/jsruntime/qv4qobjectwrapper_p.h
	src/qml/qml/qqmlengine.cpp
	src/qml/qml/qqmlpropertycache.cpp
	src/qml/qml/qqmlpropertycache_p.h
	src/quick/items/qquickanimatedsprite.cpp
	src/quick/items/qquickitem.cpp
	src/quick/items/qquickitem.h
	src/quick/items/qquickitem_p.h
	src/quick/items/qquickview_p.h
	src/quick/scenegraph/qsgcontext.cpp
	src/quick/scenegraph/qsgdefaultrendercontext.cpp

Change-Id: I172c6fbff97208f21ed4c8b6db3d1747a889f22b
2016-10-10 16:01:48 +02:00
Laszlo Agocs e1a303dd01 Enhance quickwidget example with all grabbing cases
Add a demo of QQuickItem::grabToImage(), in addition to grabFramebuffer()
and render(). This way all possible approaches are demonstrated and tested.

Task-number: QTBUG-55879
Change-Id: I13c427730c416f0d87f83092627e2cb46aba2cc4
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-09-22 08:04:05 +00:00
Anton Kudryavtsev 2f9db0a631 examples: replace 'foreach' with 'range for'
While touching the code, replace QStringLiteral
with QL1S in QStringBuilder expression.

Change-Id: I2519b254d82453e1c9bd5b834c0bd78e5c026f83
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-09-03 16:50:01 +00:00
Laszlo Agocs b30d970691 Add a tab widget to QQuickWidget example
...and include a tab with custom OpenGL rendering. Tab widgets are
interesting because they are commonly used in applications in combination
with widgets like QOpenGLWidget and QQuickWidget, and because they typically
trigger rapid show-hide sequences which QQuickWidget does not always handle
as well as it could.

Thus this serves both as a helpful example and a useful testing tool.

Plus it exposes at least two bugs already, namely that the continuous
animation in the QQuickFBO does not start when switching to the tab
containing the QQuickWidget in question, and that it is impossible
to integrate third-party rendering code in a robust manner due to
QQuickWidget destroying everything whenever hiding the widget. This
is not what happens with a QQuickView and the normal render loops.

Task-number: QTBUG-54133
Change-Id: Ie7d92cd0f685e4a26f4bb351cc023eb697a36bf4
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-06-20 15:50:32 +00:00