aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick
Commit message (Collapse)AuthorAgeFilesLines
...
* twotextureproviders example: Remove out-of-date todo commentLaszlo Agocs2024-08-301-2/+0
| | | | | | Pick-to: 6.8 Change-Id: I795e63e8823b2c57cef87728373732d8969b1643 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Introduce example that shows advanced text featuresEskil Abrahamsen Blomfeldt2024-08-2910-0/+256
| | | | | | | | | | | | This example demonstrates how to use variable axis support in Qt to make text fit in a pre-defined layout. The example is given a non-specific name so that it can easily be expanded to show additional font features later. Pick-to: 6.8 Change-Id: Ic18b177f02a21fa9e7726bb35e94ed6ecc93bafd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* VectorImage: Allow root items to be path containersEskil Abrahamsen Blomfeldt2024-08-287-152/+0
| | | | | | | | | | | | | | | | | When the generators were refactored to add special-handling of the root node, the path container logic from the structure node handling was not included there, causing some SVGs to get a lot of Shape items instead of combining them. This re-introduces the logic by adding a Shape item inside the root item if we see that we can make a root path container. (This is slightly different from structure nodes, where the structure node itself can be the Shape item. Since the root node has special requirements, we keep it and just add a new Shape level inside.) Pick-to: 6.8 Fixes: QTBUG-126716 Change-Id: If05fd38bad08749cf5c4b338ead104aa01672e49 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Update generated assets in weather forecast exampleEskil Abrahamsen Blomfeldt2024-07-2214-1146/+1433
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This have been regenerated with an updated svgtoqml. One change was needed in the example: The generator would previously added a subitem inside the main item which was transformed to fit the item to the requested size: Item { implicitWidth: foo; implicitHeight: bar Item { transform: ... Shape { ... } } } This was since removed, likely because it's dead weight (and removes the possibility of overriding it), so now the transform is set directly on the generated root object. But the weather forecast example had made the map labels children of the generated item, which means the scale was now also applied to them. This was easy to fix in the example, by creating the extra item ourselves in the case where it's needed. This patch also takes the liberty of fixing some minor whitespace issues etc. Pick-to: 6.8 Change-Id: Ic324815c71f990bb7e8e7caed659c14267b1777a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add Expanding size policy to some controls and itemsJan Arve Sæther2024-07-172-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Applies to the following Quick items: * TextEdit * TextInput * Flickable and Qt Quick Controls: * ProgressBar * Slider * RangeSlider It follows the same Expanding size policies as the corresponding widgets Also enable size policies the following examples (and thus remove several lines of Layout.fill.*): * quick/layouts * quickcontrols/ios/todolist Task-number: QTBUG-117597 Pick-to: 6.8 Change-Id: Id4f552aa4c8e85a65b00ff1cf06f34dd7ddeb9fa Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
* Use best practices in the Quick Shapes exampleEirik Aavitsland2024-07-039-91/+39
| | | | | | | | | | | | | | | | Circles and ellipses can now be expressed simpler with a single PathAngleArc object, instead of two PathArcs. Similarly, use PathRectangle instead of four PathLines. Also fixes various minor qml issues flagged by qmllint. As a drive-by, improves the doc of the new fillTransform property with example code that matches one of the gallery examples. Pick-to: 6.8 Change-Id: I4529cca08c0cffc51d495f8ce815b50c053e4aa3 Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* examples: Consistently require Qt 6.8Fabian Kosmale2024-07-0349-49/+49
| | | | | | | | | | | | 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>
* wasm: Move OpenGLUnderQml to VertexBufferObject to satisfy WebGLEven Oscar Andersen2024-06-112-16/+16
| | | | | | | To make the example work under webassembly also Change-Id: I9eb7ab4503efcffa68d4de3008c8275f723ec659 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Texture fill for shapesEskil Abrahamsen Blomfeldt2024-05-273-0/+55
| | | | | | | | | | | This introduces a "fillItem" property to ShapePath. Similar to gradient, this enables filling a shape with any texture provider item, such as an image, a ShaderEffectSource or a layer-enabled item. Fixes: QTBUG-104121 Change-Id: I8748a90c825e8eb4655a4ac90648c6ae74420527 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* graph example: Do not use GLSL functions as uniform namesLaszlo Agocs2024-05-274-3/+3
| | | | | | | | | | | | | | | | | 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>
* Add PathRectangle, a PathElement for optionally rounded rectanglesEirik Aavitsland2024-05-265-6/+64
| | | | | | | | | | | | This new path element type is particularly useful for QuickShapes, where it can be used to mimic a Rectangle item. It provides the same API for specifying common and/or individual corner radii. [ChangeLog][QtQuick] Add PathRectangle, a PathElement for optionally rounded rectangles Fixes: QTBUG-123913 Change-Id: Ia0de252f70c665bd70f63aa31e3010584cc9cd8c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add fillTransform property to ShapePathEirik Aavitsland2024-05-144-0/+57
| | | | | | | This adds functionality corresponding to QBrush transform to QuickShapes. Change-Id: I2b5903f8c228adec65a6f5be64e3816143879302 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Doc: Fix mentioning of QQW::createTextureFromNativeObject in exampleKai Köhne2024-04-191-3/+2
| | | | | | | | | | | | | The method got removed in Qt 6.0, and the example code was adjusted accordingly (commit fb96109bbc2ec5d). 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>
* Set correct shader version for CustomRenderNode exampleEven Oscar Andersen2024-04-191-0/+2
| | | | | | | | | | 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>
* wasm: CustomMaterial: Change shader program so that it is accepted by WebGLEven Oscar Andersen2024-04-183-5/+14
| | | | | | | | | | 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>
* CMake: Add deployment API to our examplesAlexandru Croitor2024-03-2766-647/+723
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Use new Qt configure feature for MetalTor Arne Vestbø2024-03-251-1/+1
| | | | | Change-Id: I603018d3f4c6a49c39f7daed25101c24edbbfc02 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Correct license for examples filesLucie Gérard2024-03-2175-75/+75
| | | | | | | | | | | | | 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>
* Correct a typo in the view list. Modify "a Object" to "an Object"Frédéric Lefebvre2024-03-181-1/+1
| | | | | | | | | Correct a typo in the view list. Modify "a ObjectModel" for "an ObjectModel" Task-number: QTBUG-119689 Change-Id: I96328df0d20bf264810ad9759c085d558ff600fc Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* wasm: rendercontrol example -background colorEven Oscar Andersen2024-03-161-1/+1
| | | | | | | | | | | | This fixes the background color of the rendercontrol example. Essentially we cannot assume the OpenGL background color is stored in the state, and need to set it every frame Change-Id: I5bb14f10c4049ca2e5657cceb4550e23fbf4d968 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
* Fix duplicate HighScore when replaying SameGame ExampleWladimir Leuschner2024-03-121-4/+7
| | | | | | | | | | | | | | | | | The onClosed slot invokes SameGame.saveHighscore function in samegame.js. Also the startNewGame function in samegame.js is triggering the SameGame.saveHighscore function by calling Dialog.hide, which in turn calls the onClosed slot. This leads to duplicate highscore entries. Moving the closing of the dialog after the clearing of the board/score and additionally adding a condition that if the score is 0, no highscores are saved, the duplication is avoided. Fixes: QTBUG-119812 Pick-to: 6.7 6.6 Change-Id: I6aa433789f197a0d1e70abc82baf893934e53be5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Use scoped enum for format in rhitextureitem exampleLaszlo Agocs2024-03-051-4/+4
| | | | | | Pick-to: 6.7 Change-Id: I2add2eb838cf7087902fbb264cef5e849435ab6e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Follow QQuickRhiItem property rename in exampleLaszlo Agocs2024-03-051-1/+1
| | | | | | | | The example was not updated. Pick-to: 6.7 Change-Id: Ib9afde58b3f48639cf77848e36ee503df78bdd53 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* quickwidget example: Avoid potential for crash on closeEirik Aavitsland2024-02-291-2/+5
| | | | | | | | | | | | | 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>
* Doc: Fix broken linkVenugopal Shivashankar2024-02-231-9/+9
| | | | | | | | | | | | | | Fixed the following qdoc warnings: - src/quick/items/qquickitem.cpp:[7966,7974]: (qdoc) warning: Can't link to 'QQuickControl' - src/quick/items/context2d/qquickcontext2d.cpp:3412: (qdoc) warning: Undocumented parameter 'imageData' in Context2D::createImageData() - src/quick/items/qquicktableview.cpp:1230: (qdoc) warning: Undocumented parameter 'cell' in TableView::modelIndex() - examples/quick/quickshapes/weatherforecast/doc/src/weatherforecast.qdoc:[13,21,27,45,78,83,93,102,105]: (qdoc) warning: Can't link to 'Qt Quick Shapes' Fixes: QTBUG-122230 Pick-to: 6.7 Change-Id: I4f533ed95c13a99d649568d7b773437712b5b2d1 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Update manual tests and examples for change in default size policySanthosh Kumar2024-02-216-0/+22
| | | | | | | | | | | 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>
* examples: fix unused parameter warningTim Blechmann2024-02-141-1/+1
| | | | | | Change-Id: I6ca097113fb2b3ba0a7ddde251f9068538af986c Pick-to: 6.7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Weather forecast example: Clean up assets and attributionPaul Olav Tvete2024-02-0619-54/+79
| | | | | | | | | | Add licenses for third party assets and a qt_attribution.json file for these. Also removes some assets + the mention of some assets which were no longer used. Pick-to: 6.7 Change-Id: Id426422b387e6d4dc63afef58c1a17b76ee92e4a Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Move Qt Quick Shapes examples back under Qt QuickEskil Abrahamsen Blomfeldt2024-02-0191-1/+9958
| | | | | | | | | | | | | | In order to be accessible from Qt Creator, the modules either has to have a separate landing page and qdocconf, or we need it under the same subdirectory as everything else. We currently want Qt Quick Shapes to be like Qt Quick Particles and be documented as part of Qt Quick, so the examples move back into a quickshapes/ subdirectory of examples/quick (like with examples/quick/particles/) Pick-to: 6.7 Change-Id: Ib7aaa75da7c4c9eeca6edb5ede7952598f37df89 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QQuickRhiItem API cleanupLaszlo Agocs2024-01-221-4/+4
| | | | | | | | | | 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>
* Make PieMenu in pointer handlers example work with mouse right-clickShawn Rutledge2024-01-171-1/+5
| | | | | | | | | It opens instantly with right-click; whereas it animates open with a finger or stylus, to avoid accidental activation, as before. Pick-to: 6.5 6.6 6.7 Change-Id: I6f530fb6da67c735fe3aae4545c8040f49e8dc05 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Doc: Create separate Graphics and Multimedia example categoriesJaishree Vyas2024-01-1741-41/+41
| | | | | | | Fixes: QTBUG-117884 Pick-to: 6.6 6.7 Change-Id: Ib0bb6217c29795fe50efdf827aa9902bbd572032 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* PieMenu in pointer handlers example: set preferredRendererTypeShawn Rutledge2024-01-151-0/+1
| | | | | | | | We need antialiasing for those menu sector shapes to look good. Pick-to: 6.7 Change-Id: I0dac2f5b65bf3e8e62387e5189d147de63ef0d7a Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Change the way tests and examples query the qmldir file from QML plugin targetsAlexey Edelev2024-01-153-12/+11
| | | | | | | | | | | Use qt6_query_qml_module to get path to qmldir, but not TARGET_FILE_DIR. This is more accurate way. Pick-to: 6.5 6.6 6.7 Fixes: QTBUG-120479 Change-Id: I4b7f7bf3b7f69c15871e400af3e7ae945a9bfdf0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move Qt Quick Shapes exampleEskil Abrahamsen Blomfeldt2024-01-0632-6065/+0
| | | | | | | | | | | | | Usually, we have separate top-level example directories for different modules, but since Qt Quick Shapes only had a single example, it was categorized under examples/quick. We now plan to add more, so to prepare for that, this sets up the normal structure with an examples/quickshapes directory. Pick-to: 6.7 Change-Id: I50016358b674c18bb2930459d4e0111862ddcedb Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Doc: Fix linking issues and missing QDoc commandsTopi Reinio2024-01-061-4/+4
| | | | | | | | | | | | | | | 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>
* Avoid crashing in the quickwidgets example after closing the subwindowShawn Rutledge2024-01-051-3/+15
| | | | | | | | | | 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>
* examples: Increase hit area of LauncherList buttons; simplifyTor Arne Vestbø2023-12-122-51/+36
| | | | | | | Pick-to: 6.5 6.6 6.7 Change-Id: Ife040f9c7e01fd8b8ce80595c2179d6b78648c6e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Doc: Move Flipable, Dial Control example to UI Components categoryKai Köhne2023-12-112-2/+2
| | | | | | | | Arguably fits better than Graphics & Multimedia. Pick-to: 6.6 6.7 Change-Id: I2604d5f43621a73ad28d01532e6ad8ec121a2e29 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* embeddedinwidgets: Use modern loadFromModule APIFabian Kosmale2023-12-066-13/+14
| | | | | | | | | | Replaces 4f4a915ded1ddfb91ed0062d7079f5566400f422 Fixes: QTBUG-119318 Change-Id: I3c508a8b5b7f060cdb2b0eac087c24dab0f552e2 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Update Responsive Layouts ExampleMatthias Rauter2023-12-037-42/+69
| | | | | | Fixes: QTBUG-119388 Change-Id: I66c7bf0e0aaba13a04b9cc7e6f042ded47e0b0b1 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Doc: Add CMake section to Scene Graph exampleAndreas Eliasson2023-12-011-8/+25
| | | | | | | | | | 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>
* Change Cumquat to Kumquat in exampleShawn Rutledge2023-11-291-1/+1
| | | | | | | | Cumquat is Australian English apparently, and looks vaguely dirty to the rest of us. https://en.wikipedia.org/wiki/Kumquat Change-Id: Iee3f97f7bda526791fc7ec07395152efff5e116f Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* doc: Mention the Draggable Selection exampleShawn Rutledge2023-11-292-3/+10
| | | | | | | | | | | As long as we are not deprecating Package, we should keep showing how to use it the way that the docs already describe: to aggregate Items by giving the selection a name. Also a drive-by grammar correction. Change-Id: I373269d5e2e103ca83b724e3a553c37a60bafbde Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Move undocumented quick examples to manual testsLucie Gérard2023-11-2842-1196/+2
| | | | | | | | | | | | | | | | | | - maskedmousearea ought to be redone with input handlers - delegatechooser needs a realistic use case, not so ugly - itemparticle hasn't been in working condition for some time, due to its use of flickr API - keep FlickrRssModel only in manual tests (broken for now) - remove bogus copies of flipable example files from the delegatemodel example which were added in 1fef24732bb5114392626a7fef956625a6cc66ac - copy shared components that examples tend to depend on into a shared directory for manual tests Task-number: QTBUG-88470 Task-number: QTBUG-119117 Change-Id: Ide1918f5e1b6fcc3efd939825892bfd270cef586 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix embeddedinwidgets resource prefix in qmake projectTor Arne Vestbø2023-11-241-1/+1
| | | | | | Pick-to: 6.6 6.5 Change-Id: I151cb5dce9dfbed9914bce09397a21cd704ffe0c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix corrupt rendering when toggling rendernode-based itemsLaszlo Agocs2023-11-241-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Disable TapHandler.longPressed signal if longPressThreshold == 0Shawn Rutledge2023-11-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | There needs to be a way to disable the long-press feature, because it's exclusive: if we emit longPressed(), we do not emit tapped(). But we should also be able to accommodate slow users who pause for too long unintentionally, or while simply observing the behavior. Also clarify that resetting longPressThreshold reverts to the default. Add more exhaustive test coverage, verify that longPressed and tapped are mutually exclusive, and verify the effects of violating the gesturePolicy. Change longPressThreshold on LauncherList's back button so that it always triggers, regardless whether the user pauses on it for a while. [ChangeLog][QtQuick][Event Handlers] TapHandler.longPressThreshold can now be set to 0 to disable its press-and-hold feature, and can be reset to undefined to restore the platform default. Fixes: QTBUG-119132 Task-number: QTBUG-105810 Pick-to: 6.5 6.6 Change-Id: Id5fd7e51c70fdb0cb6c4beb5615717a222aec871 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Make TapHandler longPressed/tapped exclusive and reliable; fix exampleShawn Rutledge2023-11-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The back button in the examples' LauncherList.qml has been flaky. As described in the docs, a TapHandler used to implement a Button should have `gesturePolicy: TapHandler.ReleaseWithinBounds` to get the common behavior that you can drag out of the button to cancel the click, and you can also drag back into the button to change your mind and let it click after all. But when trying to test this behavior, another problem became evident: if you spend a longer time than longPressThreshold for the whole gesture, then at the time of release you could see the debug output "long press threshold exceeded" and the tapped signal was not emitted. Our intention was that if you are dragging around, the TapHandler is not eligible to emit the longPressed signal; it follows that it should not become ineligible to emit tapped, either (tapped can be emitted if other constraints are satisfied). The intention of the ReleaseWithinBounds policy is that it doesn't matter how much you drag, as long as the point is within the bounds of the parent at the time of release. So we begin keeping track of whether we have actually emitted the longPressed signal, rather than merely looking at the time difference. This changed behavior in tst_qquickdeliveryagent::passiveGrabberOrder: 1 second is more than enough time for long press with the default longPressThreshold, and now the tapped signals are no longer emitted after longPressed. So we just wait for pressed state rather than waiting so long. qWaits in tests are best avoided anyway (although I think the intention in 152e12dc22cc0fd07cf90bcd35ae0e05b8b46fa0 might have been to wait long enough to ensure that nothing undesired would occur, rather than waiting for something specific to occur). Task-number: QTBUG-65012 Task-number: QTBUG-105810 Pick-to: 6.5 6.6 Change-Id: If6a86d955e19810cb06de659f5e39b50a72fa762 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Add doc page for the threadedanimation exampleLaszlo Agocs2023-11-172-0/+33
| | | | | | Change-Id: I8907c8532bf7abdc573d2e878374e3f26618f8d9 Reviewed-by: Christian Strømme <christian.stromme@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>