aboutsummaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* 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. Change-Id: I9a928b4b20fdff14530c16a93a52967ce6c328a3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 21d9cd844e5c572b03b73400c110adc6fc78ae75) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Regenerate projects using pro2cmake one last timeAlexandru Croitor2020-12-101-0/+144
| | | | | | | | | | And fix up some incorrect qmake project files Change-Id: Ia6d27ac68195635021fe7c4a5f06386a60f3f323 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit c1c4a874e31ba108a3600fbbb0aee7fc0bf34601) Reviewed-by: Cristian Adam <cristian.adam@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()). Change-Id: I9bed3066936af8a1831b695a76d40989a834fde9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 203acb1955c889b51b760c3f1410558b524c53d2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmlfunctions.qdoc: Add clarification to QML_FOREIGNMaximilian Goldstein2020-11-231-0/+4
| | | | | | | | Fixes: QTBUG-87150 Change-Id: If99a06a07892bdfef7b6b1e8fa737480750992fe Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 56f428c360191230b571969a2651e85380030afa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make text example work in static CMake buildsFabian Kosmale2020-11-111-0/+2
| | | | | | | | Task-number: QTBUG-87702 Task-number: QTBUG-86947 Change-Id: I9dd1b6ca633be60977109acf6b00123d4492b726 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QQmlListProperty: Use qsizetype rather than int for sizesUlf Hermann2020-11-092-12/+12
| | | | | | | | | | [ChangeLog][QtQml] The QQmlListProperty callback functions use qsizetype now as type for the size of a list. This is in line with the containers that you might use to back the list. Fixes: QTBUG-88269 Change-Id: Ia38403cb32f241e6c70e1a580dbeff1d6d694331 Reviewed-by: Fabian Kosmale <fabian.kosmale@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>
* Fix CustomAffector exampleKaj Grönholm2020-11-051-23/+2
| | | | | | | | | Don't use particle.r which doesn't exist since the CustomParticle removal. Make example a bit simpler without this. Task-number: QTBUG-88173 Change-Id: Id994a9a58796e8194fdccd63c6439d4c19681a45 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add #include <QPainter> in textballoon exampleShawn Rutledge2020-10-311-0/+1
| | | | | | | | | It is not building in namespaced builds without this. Others also needed this include, such as qml/tutorials/extending-qml/chapter2-methods/piechart.cpp Change-Id: Ifbb0557655d247b146ca2eddb07ea6813d9ffacb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* CMake: Regenerate examples to set the WIN32_EXECUTABLE propertyAlexandru Croitor2020-10-2679-0/+340
| | | | | | | | | 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>
* Fix up shadereffect example docsLaszlo Agocs2020-10-232-7/+8
| | | | | | | | The screenshot has been out of date for years now. Update it as well. Change-Id: I2b9ae3b0c24b0de7f0cd8a2284d67023237f0944 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* CMake: Regenerate examples to use qt_add_executableAlexandru Croitor2020-10-2074-74/+74
| | | | | | 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>
* Fix lineedit exampleUlf Hermann2020-10-051-1/+1
| | | | | | | | | | The default name created by QML_ELEMENT is the name of the local type, not the one of the foreign type. Pick-to: 5.15 Task-number: QTBUG-87150 Change-Id: I2b5dfcea3e835d4e69d5fa4df179333a37ee1d6e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix additional warnings from usage of deprecated APIsVolker Hilsheimer2020-09-162-5/+5
| | | | | | | | | | Replace more QLibaryInfo::location with QLibraryInfo::path Replace old event accessors APIs, including relevant comments. Change-Id: Ie205fc93b6e1c0dfb3dca9100fbde417ab68fc9f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix additional warnings from usage of deprecated APIsVolker Hilsheimer2020-09-161-1/+0
| | | | | | | | Replace QLibaryInfo::location with QLibraryInfo::path, and remove usage of Qt::AA_EnableHighDpiScaling, which doesn't have any effect anymore. Change-Id: I347e8a83e0f4c2b4405f2512e569ad3234f05a98 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* shadereffect example: remove unused legacy shader codeLaszlo Agocs2020-09-1328-239/+137
| | | | | | | | No point in exercising the file selector magic when there is only one possible path in Qt 6. Change-Id: I3b49b19d57a89855063e983ab0add13335840fb9 Reviewed-by: Andy Nichols <andy.nichols@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-024-4/+0
| | | | | Change-Id: Ibfb50fdcbb51ba93d6e5d11f9e8ce0e7b3bfde79 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Example: Pass QDate, QTime by value, not by const referenceEdward Welbourne2020-09-018-11/+11
| | | | | | | They're value types, packaging qint64 and int, repsectively. Change-Id: Icf18794466cd140e1384d6dd0de736fbb2c05a48 Reviewed-by: Fabian Kosmale <fabian.kosmale@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>
* Doc: Fix minor typosSze Howe Koh2020-08-301-1/+1
| | | | | | Pick-to: 5.15 Change-Id: I4c51c40697e410d56b6a2d2446ed9f8ae218576d 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>
* Replace Qt's MidButton with MiddleButtonEdward Welbourne2020-07-221-1/+1
| | | | | | | | | | The latter has been the preferred name since Qt 4.7.0. Added a comment on where the old name is exposed to QML that it's only for backwards compatibility. Pick-to: 5.15 Change-Id: I2c5088d597dd7327cc5899d06afb180d0ec2893e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* shadereffect example: change to relative file refsLaszlo Agocs2020-06-301-7/+7
| | | | | | | | Like with Image, this should work with ShaderEffect as well, and is the better default approach to promote to users. Change-Id: I9b8427297687db189045886fbaf17d2b4a517aba Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Follow QQuickGraphicsDevice changes in QQuickRenderTargetLaszlo Agocs2020-06-262-4/+4
| | | | | | | | | They are not strictly related of course, but the API pattern should be kept. We can also move away from the QSGTexture dependency which is good since that was never directly related. Change-Id: I9aedff5918443bda3d6e3ee1ea389071222d1ad7 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Use QList instead of QVectorJarek Kobus2020-06-253-7/+7
| | | | | | 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-2212-12/+12
| | | | | | | | | | | | | | | | ...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>
* Remove QtQuick.Window pluginUlf Hermann2020-06-154-8/+4
| | | | | | | | | | | | | | | | | We move all the types into QtQuick itself and retain QtQuick.Window only as alias to QtQuick. This requires support for qmldirs that consist of only an import statement. [ChangeLog][QtQuick][Important Behavior Changes] The contents of the QtQuick.Window QML module have been moved into the QtQuick module. QtQuick.Window is merely and alias for QtQuick now. An explicit import of QtQuick will override this alias. Therefore, if you import QtQuick with a different version than QtQuick.Window, you will get the QtQuick.Window types of the version given in the QtQuick import now. Task-number: QTBUG-84639 Change-Id: Ia82afab0ac2faba70cfdaf53dc8dfe4261e1113f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Anisotropic antialiasing for distance field textEskil Abrahamsen Blomfeldt2020-06-153-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For perspective transforms, we need to find the sample range in the glyph cache per pixel. We can do this by getting the gradient of the distance field at the specific pixel. This will ensure proper antialiasing with any projection, but has the limitation that when glyph contours become thinner than a pixel, they may disappear or become too emphasized, because the hardware-gradient - based on neighbouring fragments - is not reliable at that scale. So we should only default to this when we detect that the text is child of a 3D scene. To make this smooth, we need to know the mode of the renderer when creating the shader. So QSGMaterial::createShader() now takes a render mode that we can use to customize behavior based on whether it is rendering into a 2D or 3D scene. [ChangeLog][QtQuick] The QSGMaterial::createShader() virtual function has been extended to take a render mode argument, which can be used for any customizations needed in the case where the shader will be used in combination with 3D perspective transformations. Fixes: QTBUG-84695 Change-Id: I5a18a4edbdfa07e8f9d506c42bb20e8eb580927d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Move resetOpenGLState() to QQuickFboLaszlo Agocs2020-06-121-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | QQuickWindow should not have OpenGL specifics in its API in Qt 6. However, resetOpenGLState() is used by applications commonly in combination with QQuickFramebufferObject (not the least because the documentation recommends it!). This is no problem in practice because QQuickFramebufferObject remains an OpenGL-only feature. So to minimize the breaks, move the function into QQuickFramebufferObject::Renderer so any application that calls the function can continue to do so by just calling it on 'this' instead. The rendercontrol_opengl example used to call this function as well, but unnecessarily, it will still function the same way without it. Note that there is a chance that there are applications that call resetOpenGLState() in other contexts, for example in slots connected to before or afterRendering(). For these it will need to be determined if the call is necessary at all, and if it is, should be replaced by (re)setting the appropriate OpenGL state manually instead. Task-number: QTBUG-84523 Change-Id: I335599f77e8a84e347a44427eb1a1bf917796ee8 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* fboitem example: Request OpenGL explicitlyLaszlo Agocs2020-06-121-0/+2
| | | | | | | It wouldn't render otherwise. Change-Id: I185459f2eccdffac4f7d7968e48aab4141e0908c Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Replace calls to deprecated QEvent accessor functionsShawn Rutledge2020-06-112-5/+5
| | | | | | | | | | | | | | | | | | | | Several event accessors were deprecated in qtbase/24e52c10deedbaef833c0e2c3ee7bee03eacc4f5. Replacements were generated by clazy using the new qevent-accessors check: $ export CLAZY_CHECKS=qevent-accessors $ export CLAZY_EXPORT_FIXES=1 $ ../qt6/configure -platform linux-clang -developer-build -debug -no-optimize-debug -opensource -confirm-license -no-pch QMAKE_CXX=clazy $ make $ cd ../../qt6/qtdeclarative $ find . -name "*.clazy.yaml" $ clang-apply-replacements . Task-number: QTBUG-20885 Task-number: QTBUG-84775 Change-Id: I1be5819506fd5039e86b4494223acbe193e6b0c9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* openglunderqml example: remove unnecessary resetOpenGLState callLaszlo Agocs2020-06-112-4/+2
| | | | | | | | | | | | | | | Also request the OpenGL RHI backend explicitly, like all the other similar examples (d3d11underqml, and so on) do. Calling resetOpenGLState() in this example is pointless because it happens before returning from the custom rendering function, and the endExternalCommands() call achieves the same internally, i.e. the rhi will know that cached state cannot be used anymore. There are other valid uses cases for resetOpenGLState() but this example does not have those. Change-Id: Ifa7861b80c29c174d02cfe37fe8ef8eed7344195 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Remove rendernode and opengltextureinthread examplesJonas Karlsson2020-06-1030-2526/+0
| | | | | | Task-Id: QTBUG-84623 Change-Id: I786a7a8ee256d8c395dd0e828213c5d137ba20dc Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Enable Metal-based scenegraph examplesLaszlo Agocs2020-06-101-3/+3
| | | | | Change-Id: Ib2734fb10feaac106bb6483a8a361c7b35af3348 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove winrtOliver Wolff2020-06-041-4/+0
| | | | | | | | | Task-number: QTBUG-84434 Change-Id: If8f57f00726868a3540c877d07fca761618e4f08 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix some bugs in the example that was introduced by moving over to QQC2Jan Arve Sæther2020-06-041-2/+12
| | | | | | | | | Most of the bugs was due to moving over to Qt Quick Controls 2, except from the binding we had to explicitly break now. That should probably have been done when we used Qt Quick Controls too. Change-Id: Ic558679802ea35e727eadc570cf299f9da4a3604 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Make QSGMaterialRhiShader become QSGMaterialShaderLaszlo Agocs2020-06-023-9/+3
| | | | | | | | | | | | | | | | After a symbiotic relationship in Qt 5.14 and 5.15, it is time for QSGMaterialRhiShader to devour its older sibling and take its place. This makes the direct OpenGL rendering path disfunctional. All QSGMaterial Qt 6 TODOs are solved, the API is clean and straightforward again: a QSGMaterial creates a QSGMaterialShader, no special flags and options needed. (it's just that QSGMaterialShader now has a slightly different API) Task-number: QTBUG-79268 Task-number: QTBUG-82997 Change-Id: I545ca8d796c5535e81957c706e7832133be15b7d Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Examples: Fix double installation of .qml filesKai Koehne2020-06-025-25/+5
| | | | | | | | | | qt_example_installs.prf already generates install rules for all example sources, including content of .qrc files. Pick-to: 5.15 Fixes: QTBUG-84301 Change-Id: I3454b19849af489c5819c51867781cc97f1eb285 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove CustomParticleEirik Aavitsland2020-06-0214-883/+0
| | | | | | | | | The implementation is intertwined with the direct GL path and not really portable to RHI. Fixes: QTBUG-78574 Change-Id: I6ac8707544c19a24661f07e0e6d2fc405e49cbff Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Enable rendercontrol_d3d11 example in CMake buildsLaszlo Agocs2020-05-292-2/+2
| | | | | Change-Id: Ifd1526da4a792e783e47fc7bb952bdb188a6e5c1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>