aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph
Commit message (Collapse)AuthorAgeFilesLines
* Fix rendernode example wrt stackingLaszlo Agocs2022-06-161-1/+5
| | | | | | | | | | | | | | | | | | | | ...for OpenGL. This means that putting opaque content on top (which uses the opaque pass of the sg renderer) is now working as it should. Previously the custom rendering was not testing against the what was in the depth buffer, which was fine for geometry drawn in the alpha pass, but not for others. The associated bug report's example with adding a Button on top presumably triggers the latter. The software backend has no problems. The D3D12 and Metal code paths are no longer supported and will not be updated anymore. Those anyway feature various limitations, such as a lack of clipping support, so having limited stacking, depending on the content on top, is acceptable. Fixes: QTBUG-102954 Change-Id: I0ee97fb9790ee43f005b1de8226ef760c56c2573 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Doc: Capitalize "GUI" correctlySze Howe Koh2020-08-311-1/+1
| | | | | | | Change-Id: I2230e2dcb7bc2497b5dbe71a22c21d84176b5e57 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> (cherry picked from commit fd105380eb4f43c08578b6fe5ce3e5c6dd4b35d6) Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* simplematerial example: Fix double installation of main.qmlAlexander Volkov2020-06-231-4/+1
| | | | | | | | | | | qt_example_installs.prf already generates install rules for all example sources, including content of .qrc files. This commit amends bbb6071dc69a2513d2586faaf9896841bf724786. Task-number: QTBUG-84301 Change-Id: Idfef30501dfaaaddebf773aaa690206eedb458fc Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Add missing include to d3d11underqml exampleLaszlo Agocs2020-04-071-0/+1
| | | | | | Change-Id: Ib1891a509dccdbe071ce71058aaa58887ddfeb8e Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add missing QPainterPath include in rendernode exampleUlf Hermann2020-03-101-0/+1
| | | | | | Change-Id: Idd8a0fb1f02ea6f226ffe4a6cee77f49aa947a84 Fixes: QTBUG-82791 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Examples: enable HighDPI scaling for AndroidAssam Boudjelthia2020-02-241-0/+1
| | | | | | | | | These examples show very tiny UI elements on Android devices, thus enabling HighDPI. Task-number: QTBUG-80717 Change-Id: Id3b4184bef74faf9f7d165ac211bd39375d67f62 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Modernize type registration in new examplesUlf Hermann2020-02-119-12/+12
| | | | | Change-Id: I26671d47d663c126e2bff41e8db7b0945db78643 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Avoid discouraged patterns in examplesUlf Hermann2020-02-111-1/+1
| | | | | | | | | | | In particular, use required properties where applicable, explicitly import QtQml where we use it, avoid unqualified access into the root scope of a component, use JavaScript functions with explicit parameters as signal handlers. Change-Id: I3eaaba47cc3c7a2a12d488e36f9eec145cedbb0e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Generate registrations for all examplesUlf Hermann2020-01-1330-197/+331
| | | | | | | | 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>
* Minimal documentation for new examplePaul Olav Tvete2019-12-122-0/+48
| | | | | | Task-number: QTBUG-80500 Change-Id: Ifdd13bc404dd3ee34d14b339e24a72d647b6796f Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add vulkantextureimport examplePaul Olav Tvete2019-12-129-1/+1126
| | | | | | | | | | This is essentially the rendering code from vulkanunderqml put into the structure of metaltextureimport with some added memory barriers. Task-number: QTBUG-80500 Change-Id: If38301c039b38e3798ff482625daa5f63e8d6fb2 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix Metal usage on iOSLaszlo Agocs2019-11-274-6/+11
| | | | | | | | Also enable the two Metal-specific scenegraph examples on iOS. Change-Id: I0e1e6d527544ea4a5bfb0d08ca2d32c762d3c699 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Avoid initializing QFlags with 0 or nullptr in further casesFriedemann Kleint2019-11-251-1/+1
| | | | | | | Amends 744e77b841878fb017c0f2d60607090008f28180. Change-Id: I16e37aaf503eb62f67fca0e48be4c92c4a72ae46 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2019-11-222-1/+5
|\ | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlextensionplugin.cpp tests/auto/quick/qquicktableview/tst_qquicktableview.cpp Change-Id: Ic58d36a8532015bae30f2690063db9829b3bf372
| * fix rendernode example buildLorn Potter2019-11-121-0/+4
| | | | | | | | | | | | | | | | | | | | When not building developer mode, the install does not copy the files on other platforms Fixes: QTBUG-79781 Change-Id: Ibc8352c59d16b69618d53750511d5b5650ed5290 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * Doc: Fix documentation warningsTopi Reinio2019-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were a lot of documentation warnings introduced by the separation of QtQml.Models and QtQml.WorkerScript modules from the QtQml documentation project into their own sub-projects. Fix the above, and also ensure that the experimental Qt.labs.qmlmodels QML types are listed in the documentation, and add them also on the QML module page for QtQml.Models. A few warnings remain, they may be indicative of issues not in the scope of this commit. Fixes: QTBUG-79812 Change-Id: Idc25c976e4c96feab4aae893519d6c9245f57a64 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Make QQuickFbo work with the OpenGL backend of QRhiLaszlo Agocs2019-11-145-14/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So no matter if Quick goes directly to OpenGL, or via QRhi, QQuickFramebufferObject will still work. Also fix up the fboitem example to use a ShaderEffect that works with both rendering paths. With graphics APIs other than OpenGL the item will be empty, as QQuickFbo is not something we can support there. Task-number: QTBUG-79222 Change-Id: I52177d3a75f619f7075a2fc829573c17031eded1 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Make twotextureproviders work on the rhi rendering pathLaszlo Agocs2019-10-1412-73/+274
| | | | | | | | | | | | | | | | | | | | | | Involves porting away from the ill-fated QSGSimpleMaterial. This marks the first appearance of QSGMaterialRhiShader in any of the examples. Task-number: QTBUG-79086 Change-Id: I464e2bd06a6b5b19775b1b35265bb843979ec4b4 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-114-0/+8
|\| | | | | | | Change-Id: I1359574c7d89aaf3328958e2f667ba1e599ff7f1
| * Add guards in .pro of platform/api-specific scenegraph examplesLaszlo Agocs2019-10-104-0/+8
| | | | | | | | | | | | Task-number: QTBUG-78783 Change-Id: Icda60d4358c35de311552fd7562c3cf0c3425b7b Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-102-2/+5
|\| | | | | | | Change-Id: I2835748c27616103f275849141fbe5a93e3dfd8c
| * Make rendernode example compile on iOSLaszlo Agocs2019-10-092-2/+5
| | | | | | | | | | | | | | | | | | | | | | Without Metal support for now. The ifdef pattern is the same as in QRhi in qtbase. It is to be revised once Metal support is introduced for iOS. Task-number: QTBUG-78854 Change-Id: I10f37ddcb42c27958270bd3ca8bf9b8457a4bea3 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-0413-27/+27
|\| | | | | | | | | | | | | | | Conflicts: src/imports/qtquick2/plugins.qmltypes src/quick/items/qquickitemsmodule.cpp Change-Id: I841c65c9c131354788b4f3fcfe3d7ed27be316d5
| * Clean up GraphicsStateInfo after API reviewLaszlo Agocs2019-09-184-16/+16
| | | | | | | | | | Change-Id: I715ad71153151a0e6521bc182227d9fa2dc0a3ea Reviewed-by: Christian Strømme <christian.stromme@qt.io>
| * Rename textureinsgnode example to a more fitting nameLaszlo Agocs2019-09-129-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It shows QQuickFramebufferObject. "Texture in QSGNode" is ambiguous as it suggests another type of use case (where an existing texture is imported and used with the QQ scene - without rendering to it). This would conflict with upcoming future examples, so rename to fboitem, which is what this example is about. The link from examples.qdoc is already using the fitting title so that will just work. Change-Id: Ide7a563398a4b464c55f14e10fa9386432b3d06d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
| * Fix gcc warnings in vulkanunderqml exampleLaszlo Agocs2019-09-111-4/+4
| | | | | | | | | | Change-Id: Iea81662f39d2a128cea0e83a766395e0fb1e9896 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | Specify parameters of type registration in class declarationsUlf Hermann2019-09-2621-11/+22
|/ | | | | | | | | | | | | | | | | | | | | 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>
* Clarify docs and comments regarding under and overlaysLaszlo Agocs2019-09-082-0/+10
| | | | | Change-Id: I8973798996b6c775f425819af1d6a09f1773a9dc Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add metaltextureimport exampleLaszlo Agocs2019-09-0811-1/+878
| | | | | Change-Id: I499c21083faf6096a0dc3b8ee5682dd5cbcd3ce7 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rendernode example: Prevent gui-render thread data raceLaszlo Agocs2019-09-089-81/+114
| | | | | | | | By taking things like the item width and height in updatePaintNode() (while gui is locked). Change-Id: I840c6c858a0478eb6ceb09653fd1e033cb54372d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Make vulkanunderqml work and update docsLaszlo Agocs2019-09-081-5/+14
| | | | | | | | | | | | | | | What we are doing for now is setting ExternalContentsInPass always. This way vulkanunderqml works as expected. For applications that do not integrate external rendering this means that there is now an additional secondary command buffer per render pass, but we can live with this for now. Later (Qt 6) there should be a way to declare this (that the application will want to issue native rendering stuff) up front in QQuickWindow or somewhere. Change-Id: I736741f9b0eee2f8295b046bacdce862e6a546f5 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add vulkanunderqml exampleLaszlo Agocs2019-09-0814-9/+952
| | | | | Change-Id: I61e8b50f560d1f4c68731fb19eb13071992040c9 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rendernode example: Add support for MetalLaszlo Agocs2019-08-229-1/+513
| | | | | | | | | | | | Plus clarify QQuickWindow::begin/endExternalCommands() in combination with QSGRenderNode in the docs. As the example demonstrates, calling these functions is not necessary within render() of a render node. Also fix an issue with resetting the scissor in the renderer after calling render() of a QSGRenderNode. Change-Id: If8c2dab38d62aa444266d37901f062a51e767f68 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Add missing scenegraph example docsLaszlo Agocs2019-08-2212-1/+320
| | | | | Change-Id: I72e18136a26cdfb52f204ce7d0491d14411956a4 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Implement QSGRenderNode for the rhi pathLaszlo Agocs2019-08-224-31/+104
| | | | | | | | | | | | | | The documentation is also refined and extended. Revise the rendernode example as well: make it possible to test and demonstrate both scissor and stencil based clipping. An implementation of the triangle for another graphics API should follow in a separate patch at a later point. For now only OpenGL is supported in combination with the RHI. Change-Id: I7ef9f6c6e0b44f1bdf44c9266ea3fa4736367a5d Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Make openglunderqml functional with and without the rhiLaszlo Agocs2019-07-043-29/+37
| | | | | | | | | | It has to be written following the new split approach (beforeRendering for resource setup, beforeRenderPassRecording to issue the actual underlay draw calls), but it will then work both with and without QSG_RHI=1. Change-Id: I9b7b35434aa0caec543cae268064b2684256382d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add the graphics api independent scenegraph portLaszlo Agocs2019-07-0422-6/+1491
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opt in via environment variables: QSG_RHI=1 -> enable using QRhi instead of GL QSG_RHI_BACKEND -> set to vulkan, metal, d3d11, gl to override the default (the default is d3d11 on Windows, metal on Mac, gl elsewhere) Or force a given rhi backend via the existing QQuickWindow::setSceneGraphBackend(). Otherwise the default behavior is the same as before, the rhi code path is never active by default. -no-opengl builds are supported in the sense that they work and default to the software backend. However, the rhi code path cannot currently be used in such builds, even though QRhi from qtbase is fully functional with Vulkan, D3D, or Metal even when qtbase was configured with -no-opengl. This cannot be utilized by Quick atm due to OpenGL usage being all over the place in the sources corresponding to the default backend, and those host the rhi code path as well. This will be cleaned up hopefully in Qt 6, with the removal all direct OpenGL usage. Other env.vars.: QSG_RHI_DEBUG_LAYER=1 -> enable D3D debug or Vulkan validation layer (assuming the system is set up for this) QSG_RHI_SHADEREFFECT_DEBUG=1 -> print stuff from ShaderEffect QSG_SAMPLES=1,2,4,... -> MSAA sample count (but QSurfaceFormat works too) QT_D3D_ADAPTER_INDEX=0,1,... -> D3D adapter index QT_VK_PHYSICAL_DEVICE_INDEX=0,1,... -> Vulkan physical device index QSG_RHI_UINT32_INDEX=1 -> always use uint index data (both merged/unmerged, convert when needed - with some rhi backends this is implicit) QSG_RENDER_LOOP -> to override the render loop as usual. The default with RHI is threaded for Metal, threaded for Vulkan on Windows, basic for Vulkan on Linux and Android (to be checked later), while the existing rules apply for OpenGL. Not supported when running with QRhi: - particles - compressed atlases (though this is transparent to the apps) - QSGRenderNode - QQuickRenderControl - QQuickFramebufferObject - certain QQuickWindow functionality that depends directly on OpenGL - anisotropic filtering for textures - native text may lack some gamma correction - QSGEngine applicability unclear - some QML profiler logs may be incorrect or irrelevant Change-Id: I7822e99ad79e342e4166275da6e9e66498d76521 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* use the override keyword consistently and correctly (clang-tidy)Shawn Rutledge2018-02-277-22/+22
| | | | | Change-Id: If9e28d143f8cba3df3c757476b4f2265e2eb8b2a Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* init variables where they are declared when possible (clang-tidy)Shawn Rutledge2018-02-262-8/+8
| | | | | | | | 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>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-266-20/+20
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-241-2/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/compiler/qv4codegen.cpp src/qml/compiler/qv4compileddata_p.h src/qml/debugger/qqmlprofiler_p.h src/qml/jsruntime/qv4engine.cpp src/qml/memory/qv4mm.cpp src/qml/qml/qqmlcomponent.cpp src/qml/qml/qqmlobjectcreator.cpp src/qml/qml/qqmlobjectcreator_p.h src/qml/types/qqmldelegatemodel.cpp src/quick/items/qquickitem_p.h src/quick/items/qquickwindow.cpp tests/auto/quick/touchmouse/BLACKLIST tests/benchmarks/qml/holistic/tst_holistic.cpp Change-Id: I520f349ab4b048dd337d9647113564fc257865c2
| * threadedanimation: fix custom item animation when in a QQuickWidgetMitch Curtis2017-12-201-2/+5
| | | | | | | | | | | | | | | | | | As with 64a01ff5b5d1eaadb1e60013673ac25459b79e14 in qtquickcontrols2, we ensure that custom scenegraph item animations still run if within a QQuickWidget. Change-Id: I3630ee34c039420640000c9a58ed1ec186bbe82c Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Update to new QRandomGenerator APIThiago Macieira2017-11-032-6/+6
| | | | | | | | | | Change-Id: I69f37f9304f24709a823fffd14e676c097712329 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-2449-154/+574
|\| | | | | | | | | | | | | | | | | | | 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
| * Fix example code to always use BSDKai Koehne2017-10-184-12/+52
| | | | | | | | | | Change-Id: I1370ad883bb9ad821c7f1f5ac5092e9040ddc2e9 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
| * Fix outdated FDL license headerKai Koehne2017-10-177-34/+34
| | | | | | | | | | Change-Id: I76dccf547de40b5e72fd7abaa062fa96cb2c118a Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
| * Fix outdated BSD license headerKai Koehne2017-10-1738-108/+488
| | | | | | | | | | Change-Id: Icc08925454445fc9497fb3bfd2c26efe90605983 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* | Qt Quick examples: Introduce QCommandLineParserFriedemann Kleint2017-10-181-1/+15
| | | | | | | | | | | | Task-number: QTBUG-60630 Change-Id: Iaf24e09fdec92f8af495a1288685f266c39be4a7 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Use QRandomGenerator instead of q?randThiago Macieira2017-08-232-6/+8
| | | | | | | | | | Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5285d43f4afbf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devSimon Hausmann2017-08-181-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmltypecompiler.cpp src/qml/jsruntime/qv4qmlcontext.cpp src/qml/jsruntime/qv4qobjectwrapper.cpp src/qml/qml/qqmlcustomparser.cpp src/qml/qml/qqmlimport.cpp src/qml/qml/qqmlimport_p.h src/qml/qml/qqmlmetatype.cpp src/qml/qml/qqmlmetatype_p.h src/qml/qml/qqmltypenamecache.cpp src/qml/qml/qqmltypenamecache_p.h src/qml/qml/qqmltypewrapper.cpp src/qml/qml/qqmltypewrapper_p.h src/qml/qml/qqmlvmemetaobject.cpp src/qml/util/qqmladaptormodel.cpp Change-Id: Ic959d03e6f9c328fb02710d9abbb0f27cddde131