summaryrefslogtreecommitdiff
path: root/examples/quick/scenegraph
Commit message (Collapse)AuthorAgeFilesLines
* graph example: Remove old todoLaszlo Agocs2023-05-161-2/+0
| | | | | | Pick-to: 6.5 Change-Id: I1fcd01ee35a808c5310f08a1a9e025f5aba6f3bc Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Docs: Expand Vulcan under QML Example documentationNicholas Bennett2023-05-161-24/+63
| | | | | | | | | | 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>
* Examples: Use versioned CMake targets for Qt modulesKai Köhne2023-05-0213-50/+50
| | | | | | | | | | | | 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>
* CMake: Allow omitting the version of QML modulesUlf Hermann2023-01-2713-13/+0
| | | | | | | | | | | | | | | | | 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>
* Quick scenegraph examples: use qsTr() for user facing stringsOliver Eftevaag2023-01-179-17/+15
| | | | | | | | 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>
* Quick examples: Modernize cmake files according to our guidelinesOliver Eftevaag2023-01-1610-81/+40
| | | | | | | | | | | | | | | | 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>
* Remove spurious qDebug() statementOliver Eftevaag2023-01-111-2/+0
| | | | | | | | 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>
* Examples: Update custom QSGMaterialShader correctlySze Howe Koh2023-01-041-0/+1
| | | | | | Pick-to: 6.5 6.4 6.2 Change-Id: I469c4f813f006ca47f9660a0c9ccfa30bbe89dc6 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* scenegraph: Add example for QSGRenderNode based RHI renderingBen Fletcher2022-11-0110-0/+586
| | | | | | | | | 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>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-09-0713-13/+13
| | | | | | | 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>
* Examples: Do not use import version numbers anymoreKai Köhne2022-08-3112-24/+24
| | | | | | | | 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>
* Add license headers to cmake filesLucie Gérard2022-07-0813-0/+39
| | | | | | | | | | | | 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>
* Use SPDX license identifiersLucie Gérard2022-06-1168-3078/+135
| | | | | | | | | | | | 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>
* Use QSGRendererInterface::OpenGL in documentation and examplesKai Köhne2022-02-148-8/+8
| | | | | | | | | | | QSGRendererInterface::OpenGLRhi is only an (undocumented) alias to ...::OpenGL, so let's use that instead. Amends 0b2311a62b25c Pick-to: 6.2 6.3 Change-Id: I4acdd39dc1d9b75bed5c474667a43b4ad86e7f47 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Improve examples CMakeLists.txtKai Köhne2022-01-2413-142/+56
| | | | | | | | | | | | | | | | | | - 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>
* Scenegraph examples: Use suffix-less RHI constantsFriedemann Kleint2021-11-233-3/+3
| | | | | | | | Complements 23dbe3d6e0d3338812ad9f614028a6fdc5a54090. Pick-to: 6.2 Change-Id: Ic1bda49a888b0580ac483d650b879a9ae843129b Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Avoid unnecessary color format conversionJiDe Zhang2021-10-292-8/+4
| | | | | | | | | | | | If a color is not the rgb format, when QColor::red() QColor::blue() QColor::green() is used continuously to obtain the values of different channels, three times color conversions will occur. Therefore, use QColor::toRgb() before that to ensure that only one conversion is performed at most. Not only rgb, the conversion of other formats is the same. Change-Id: Ia969e1ca6f1524ad5d7e8dec915bcbc407875c66 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Replace 0 pointer constants with nullptrAllan Sandfeld Jensen2021-10-182-2/+2
| | | | | | | Replaced in most common patterns. Change-Id: Idcaff1f2e915f29922702d3600a2e5f1e2418a7a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix typo: alignment has an n in itEdward Welbourne2021-10-131-2/+2
| | | | | Change-Id: Ibe0ef16609a704042b964b4c29078c462820e602 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Migrate to fixed add_shaders prefix handlingLaszlo Agocs2021-08-302-2/+2
| | | | | Change-Id: I6c5b0680d32bc3650983c64cc4583f790774da88 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use add_shaders with CMake in some examplesLaszlo Agocs2021-08-243-49/+25
| | | | | | | | | | | | | | | | | | | | Take the most obvious candidates, to which users typically turn when getting started with ShaderEffect or QSGMaterial: shadereffects scenegraph/custommaterial scenegraph/twotextureproviders As with the parent patch that ports and updates embeddedinwidgets and quickwidget/qquickviewcomparison to use the proper CMake machinery, we still need to keep the .qsb files for the sake of qmake. compile.bat and similar scripts are however removed now. With CMake the .qsb files are not needed and are autogenerated at build time. Once qmake support disappears from the examples, the .qsb files can be removed as well. Pick-to: 6.2 Change-Id: I879354eef2e2179dcd268c9ae9f1402e1eaef379 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Update quick examples to new QML CMake APICraig Scott2021-08-2415-387/+128
| | | | | | | | | | | | 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>
* Raise cmake_minimum_required to VERSION 3.16 in examplesJoerg Bornemann2021-08-1712-12/+12
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-95636 Change-Id: I9f76b787533dad1c469fbb8c69df6c27b20a9aa3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use "= default" rather than empty bodies for ctors and dtorsUlf Hermann2021-07-011-3/+1
| | | | | Change-Id: Idef0ebaa0074e1e4b6b74d20bd6c70cb22a04f93 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
* Use "auto" as type when initializing using "new"Ulf Hermann2021-07-011-1/+1
| | | | | | | The type is immediately visible from the right hand side then. Change-Id: Ifc1a15e3eea9b5a91ff8647f759d207a0ee221b8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Initialize members in declaration rather than ctorUlf Hermann2021-06-301-4/+3
| | | | | | Change-Id: I084a6865ae37c6612fbcfd44a233234f05e38814 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Add missing "override" keywordsUlf Hermann2021-06-302-2/+2
| | | | | | | | 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>
* Do not call QGuiApplication::exec() on an instanceUlf Hermann2021-06-307-7/+7
| | | | | | | | It's a static method. It should be called statically. Change-Id: I15fc8948988b0a2c0a30f8699949e06c66d92fdf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Use nullptr rather than 0 for null pointersUlf Hermann2021-06-301-1/+1
| | | | | | | Change-Id: I2921298ad2e04001bdee8824c56f01c203efb7d6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Switch examples to build as isolated sub-buildsCraig Scott2021-05-271-12/+12
| | | | | | | Task-number: QTBUG-90820 Change-Id: Id9157526898ba72cb64ee8256639b37357f7bacf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Fix custommaterial example with OpenGLLaszlo Agocs2021-02-193-1/+1
| | | | | | | | | | | | | The member names in the "uniform block" (which is in practice mapped to a struct uniform with GLSL) must match between the vertex and fragment shaders, even if the member is not used in one of the shaders. This is because OpenGL/GLSL's interface matching rules, which would cause the shader program fail to link due to a mismatch in the structs in the two shaders. Pick-to: 6.1 6.0 Change-Id: I9a928b4b20fdff14530c16a93a52967ce6c328a3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix building the d3d11underqml example with MinGWFriedemann Kleint2020-11-261-9/+9
| | | | | | | | | | | Fix format mismatch qtdeclarative/examples/quick/scenegraph/d3d11underqml/d3d11squircle.cpp:369:16: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'HRESULT' {aka 'long int'} [-Werror=format=] qFatal("Failed to create buffer: 0x%x", hr); by casting to uint (as is done in an existing qWarning()). Pick-to: 6.0 Change-Id: I9bed3066936af8a1831b695a76d40989a834fde9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Doc: Fix documentation warnings for Qt QuickTopi Reinio2020-11-052-4/+2
| | | | | | | | | | | - Remove links to modules and examples that are not part of Qt 6. - Remove links to entities marked as \internal - Add missing enum value and QML property docs where it's trivial to do so. Task-number: QTBUG-88156 Change-Id: I10a1c7bcc5fe0e2354ea69eaf24930362edb7415 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* CMake: Regenerate examples to set the WIN32_EXECUTABLE propertyAlexandru Croitor2020-10-2614-0/+56
| | | | | | | | | 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>
* CMake: Regenerate examples to use qt_add_executableAlexandru Croitor2020-10-2014-14/+14
| | | | | | Task-number: QTBUG-87661 Change-Id: Ie5bba408000211b24694aa0143bdf79c4a298f42 Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
* Adapt to platform API renameTor Arne Vestbø2020-10-092-3/+3
| | | | | Change-Id: I1f2171e18ec3df71f7eaec1be0e0e0d1442a3860 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* examples: include QQuickWindow in squircle headersUlf Hermann2020-09-134-0/+4
| | | | | | | This is required because QQuickWindow is passed as a signal parameter. Change-Id: Ied10beded7253558d080af4806d1b95880bf2d98 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make twotextureproviders example functional againLaszlo Agocs2020-09-074-0/+42
| | | | | Change-Id: I6a317fc8628b902e535a31daf4a3886fc87d08bc Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Regenerate graph example shadersLaszlo Agocs2020-09-074-0/+0
| | | | | Change-Id: Id4fe4d0e177180fadd10f34b9ebad17c71e40314 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add CMake project file for custommaterial exampleLaszlo Agocs2020-09-074-6/+126
| | | | | | | | | The name conflicts with a Quick3D example so try to use the same approach as it was done for customgeometry. Task-number: QTBUG-86205 Change-Id: Ie01cd6c0118d512b2f45d4c6e782ec6639e052c6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove old GLSL code from fboitem exampleLaszlo Agocs2020-09-077-34/+18
| | | | | | | There is no OpenGL path anymore in Qt 6, no point using file selectors. Change-Id: I4b7afbbb193dfe1a6e912a909babab0aeb8dcdda Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Remove use of deprecated High-DPI application attributesTor Arne Vestbø2020-09-021-1/+0
| | | | | Change-Id: Ibfb50fdcbb51ba93d6e5d11f9e8ce0e7b3bfde79 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Doc: Capitalize "GUI" correctlySze Howe Koh2020-08-301-1/+1
| | | | | | Pick-to: 5.15 Change-Id: I2230e2dcb7bc2497b5dbe71a22c21d84176b5e57 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* CMake: Rename example conflicting with qtquick3dAlexandru Croitor2020-08-252-7/+63
| | | | | | Fixes: QTBUG-86205 Change-Id: I38992501abb86a4328527283ad8924ec886ea8c8 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Switch to MTLTexture protocol in QSGTexture native accessLaszlo Agocs2020-08-041-1/+1
| | | | | | | Now only available from ObjC code. Change-Id: I88df6c8839fc660ffd2b8e88a789ca73a9d4accd Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add type safe native texture accessorsLaszlo Agocs2020-08-032-8/+6
| | | | | | | | Following the pattern from QtGui. Task-number: QTBUG-85239 Change-Id: I07b4456028d0f45223ad10e55ce65f423bab6a9b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use QList instead of QVectorJarek Kobus2020-06-251-3/+3
| | | | | | Task-number: QTBUG-84469 Change-Id: I4c3353c00a566023503fbc178ba8454391dc334c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* New custom material examplePaul Olav Tvete2020-06-2413-3/+749
| | | | | | Fixes: QTBUG-78577 Change-Id: I280ffeda4bba1a9c170feb1ffa4b6c95eb0e6d28 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Rename setSceneGraphBackend to setGraphicsApiLaszlo Agocs2020-06-227-7/+7
| | | | | | | | | | | | | | | | ...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>
* Fix GL_ constant usage in examplesLaszlo Agocs2020-06-174-6/+6
| | | | | Change-Id: Iecfa47845edb78928b388d150a3229f8c7a93d5d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>