summaryrefslogtreecommitdiff
path: root/examples/quick
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve blur items sizingKaj Grönholm2022-12-203-6/+6
| | | | | | | | | | | | | | | | MultiEffect uses max 5 blur items. So to be able to divide first one 4 times without rounding, first one needs to be rounded up to next 2^4 = 16 (16,8,4,2,1). Make the first blurred item size half of the source size (plus the rounding). This increases the blur amount and performance and decreases texture memory usage and quality. Based on testing it seemes like a good compromize. Also resize bluritems only when needed. Pick-to: 6.5 Task-number: QTBUG-109490 Change-Id: I907b48904d3f9b0414704026cc1f07c02c49a8c7 Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
* Add PinchHandler.scaleAxis, rotationAxis; hold values in axesShawn Rutledge2022-12-101-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pointer Handlers that manipulate target item properties should now use QQuickDragAxis consistently to: - enforce minimum and maximum values - hold the persistent and active values - make those available via properties - emit a new activeValueChanged(delta) signal when the value changes, so that it's possible to incrementally update a target item property in JS (onValueDelta: target.property += delta) In the pinchHandler.qml example, you can use the PinchHandler to adjust 4 properties of one Rectangle independently (it requires coordination). m_boundedActiveValue controls whether m_activeValue will be kept between minimum and maximum. For rotation, tst_QQuickPinchHandler::scaleNativeGesture() expects it to be, although that seems questionable now, and may be addressed later. [ChangeLog][QtQuick][Event Handlers] PinchHandler now has scaleAxis and rotationAxis grouped properties, alongside the existing xAxis and yAxis; and all of these now have activeValue and persistentValue properties. The activeValueChanged signal includes a delta value, giving the incremental change since the previous activeValue. The persistentValue is settable, in case some target item property can be adjusted in multiple ways: the handler's stored value can then be synced up with the item property value after each external change. These features are also added to DragHandler's xAxis and yAxis properties. Task-number: QTBUG-68108 Task-number: QTBUG-76380 Task-number: QTBUG-76379 Task-number: QTBUG-94168 Change-Id: I78a5b43e9ba580448ef05054b6c4bc71b1834dd6 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Add QtQuick.Effects & MultiEffectKaj Grönholm2022-12-0756-1/+2714
| | | | | | | | | | | | | | | | | | | Add new QtQuick.Effects plugin for post-processing effects. The plan is to add essential effects directly into QtQuick, not to duplicate Qt Graphical Effects. Initially the plugin will contain MultiEffect which supports 7 different effects in a single ShaderEffect (brightness, contrast, saturation, colorize, blur, shadow, mask). Combining multiple effects into a single shader is more performant than chaining multiple effect items. Depending on used features, the most optimal shader gets selected. Includes two examples demonstrating the usage of MultiEffect. Task-number: QTBUG-106651 Change-Id: I35865030fd4b7a1f657146cee03b195451545bc6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix typo in rendercontrol_d3d11 exampleLaszlo Agocs2022-11-031-1/+1
| | | | | | | Clearly nobody has run this in recent history. Change-Id: I77aa8acc1de1346ded034ccd47682afaba2efe2b Reviewed-by: Andy Nichols <andy.nichols@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>
* GameOfLife example: Fix qmllint warningsFabian Kosmale2022-10-262-6/+3
| | | | | | | | | | | | | GameOfLifeModel is a QAIM, but qmllint does not know what QAIM is by default. Make it aware of it by explicitly depending on QtQml.Models. Then fix the Layout related warnings found by the Quick lint plugin: - remove the superfluous x and y values in the slider, - and remove the empty padding Item in lieu of setting Layout.rightMargin on the Button to achieve the same effect. Change-Id: I2ef6f9a1ffa276b66415ce3374eb41c34d8673b6 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix TypeError in dynamicview1 exampleSami Varanka2022-10-191-1/+7
| | | | | | | | | | | | Rectangle's parent was null when setting left and right anchors. Use pragma ComponentBehavior: Bound and required properties instead. Pick-to: 6.4 Fixes: QTBUG-106645 Change-Id: Ie5b8c3a20948799363fad1332113884612d18968 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add TapHandler.exclusiveSignals to enable single/double tap exclusivityShawn Rutledge2022-10-192-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If exclusiveSignals == NotExclusive (the default), behavior remains as it was: singleTapped() and doubleTapped() are emitted as the taps occur, so it's not very useful to react on singleTapped() if you mean to distinguish these two cases. If exclusiveSignals == SingleTap, the doubleTapped signal will not be emitted at all, and therefore singleTapped can be emitted immediately and unambiguously. If exclusiveSignals == DoubleTap, the singleTapped signal will not be emitted at all, and therefore doubleTapped can be emitted immediately and unambiguously. If exclusiveSignals == SingleTap | DoubleTap, we must wait qApp->styleHints()->mouseDoubleClickInterval() milliseconds after a tap is detected before emitting either signal, so that they are distinct and can be used to drive behavior that should not occur in other cases. A triple-tap will not trigger either signal. [ChangeLog][QtQuick][Event Handlers] TapHandler.exclusiveSignals now lets you make the singleTapped and doubleTapped signals exclusive. Task-number: QTBUG-65088 Fixes: QTBUG-107264 Change-Id: Ifb2c4b72759246c64b3bfa2f776c28266806b985 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Doc: Remove usages of the second argument of a "\page" commandLuca Di Sera2022-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The "\page" command for QDoc, used to construct a standalone documentation page in the output documentation of a project, was able to take a second argument, apart from the first argument representing the name for the generated documentation page, that roughly represented the type of the page that was to be generated. This second argument was not actually used by QDoc, such that it had no meaningful effect. QDoc was recently modified to not support this second argument, internally, and officially removed its use. For technical legacy reason, QDoc will still support the usage of a second argument for a "\page" command, albeit it will do nothing, as before. To avoid confusion for future readers who might not be aware of the history of the "\page" argument and that will not find an explanation in QDoc's documentation anymore, the usages of the second argument in "\page" commands are now removed. Change-Id: I0241ffa17d658245516f725e64048e332cbccd42 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Add live property to QQuickItem layerKristoffer Skau2022-09-0810-1/+190
| | | | | | | | | | | | QQuickItemLayer now has a live property that can be set to determine if its contents should change whenever the item updates. This enables variable refresh rate for quick items. [ChangeLog] Added live property to QQuickItem layer. Fixes: QTBUG-77343 Change-Id: I8bf7e7af4cfed6deef2253d346bb0b72d0fef66e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-09-0773-73/+73
| | | | | | | 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-31146-205/+205
| | | | | | | | 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>
* Examples: Actually fix the shadereffects exampleUlf Hermann2022-08-242-8/+8
| | | | | | | | | | | The paths need to be the same between CMake and qmake and you really should not use absolute qrc paths. Amends commit d270c51f812b5f0ffe6208b38c8ea0e898535e50 Amends commit e0ee63a06eeef2d6325a5cbf1a29bd11e5d7ac29 Change-Id: I9f6d3ac3fbf4483e0c0f2cad540f45c25192886e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix shadereffects example resourcesLaszlo Agocs2022-08-171-7/+7
| | | | | | | | | | | | | | Stuff cannot just magically move under a different prefix when shaders are referenced with relative paths. As the example uses the common main helper code, it is easier to switch to absolute paths than to use NO_RESOURCE_TARGET_PATH. Amends d270c51f812b5f0ffe6208b38c8ea0e898535e50 Change-Id: I527314725210e02675dc8c2f5fc5042dc5e1c478 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix the pointerhandlers exampleShawn Rutledge2022-07-111-0/+1
| | | | | | | Amends d270c51f812b5f0ffe6208b38c8ea0e898535e50 Change-Id: I616850c04facbcd7662c479d34b1a3f0a7220556 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add license headers to cmake filesLucie Gérard2022-07-0873-0/+219
| | | | | | | | | | | | 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>
* Adapt examples to AUTO_RESOURCE_PREFIXUlf Hermann2022-06-2494-52/+95
| | | | | | | | | | | Examples that don't explicitly set NO_RESOURCE_TARGET_PATH get the AUTO_RESOURCE_PREFIX now. Task-number: QTBUG-103452 Change-Id: I6b41e96ce5620079f60ca2f967b0a2e611c1f738 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-11467-21687/+934
| | | | | | | | | | | | 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>
* Examples: Add missing header files to the CMakeLists.txtUlf Hermann2022-06-074-6/+6
| | | | | | | | It's generally a good idea to state the headers. Let's teach our users to do so. Change-Id: I50b81d6724bce1f7e5aa6ed4491fcc63e21a0247 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Add missing "flipable" example to the build treeUlf Hermann2022-06-071-0/+1
| | | | | Change-Id: I6452ba667078cb8ad5dbf9cc8c6512c8dea9f933 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Sidebar example: nest content in MouseArea to restore hover propagationShawn Rutledge2022-03-281-5/+5
| | | | | | | | | | | | | After 499828b855d125ac236917f6ed01d8f1e7d88505 if you want a MouseArea underneath some other contents to receive propagated hover events, the content must be inside the MouseArea, not a sibling. HoverHandler still does not have this restriction (handlers cannot have items as children, and the handler is not considered a sibling: it's an event-handling facet added to the item in which it's declared). Pick-to: 6.3 6.2 Change-Id: I5ac31d982e429ac002cb0bd7ae9c071ab927032b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Replace paintedWidth/Height with contentWidth/HeightTasuku Suzuki2022-03-271-2/+2
| | | | | | | | | They were renamed in 51b7425329e0fa221c319e8d75595c19f664aedb Pick-to: 6.2 6.3 Task-number: QTBUG-15160 Change-Id: If30f69d47adf391d2d1c795caaf2bbe15f6bc32a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add improvements to object listmodel exampleJani Korteniemi2022-03-222-10/+29
| | | | | | | | | | | | Scaled to fit whole screen on android. Replaced items with Qt Module names. Randomized colors. Added scrollbar. Task-number: QTBUG-95438 Pick-to: 6.3 6.2 Change-Id: I1686aff4d4770d0d34399f20301c8fc393b8d778 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Make QQuickWidget QRhi-basedLaszlo Agocs2022-03-1826-367/+155
| | | | | | | | | | | | 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>
* Use QSGRendererInterface::OpenGL in documentation and examplesKai Köhne2022-02-1412-12/+12
| | | | | | | | | | | 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-2471-575/+234
| | | | | | | | | | | | | | | | | | - 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>
* Drag and Drop example: remove ParentChangeShawn Rutledge2022-01-041-2/+0
| | | | | | | | | | | Reparenting the tile doesn't seem to be needed; and behavior changed somehow in Qt 6. Pick-to: 6.2 Pick-to: 6.3 Task-number: QTBUG-99436 Change-Id: If860d62260a7904718eb33b857b339bc6c5557a8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Switch examples to build as isolated sub-buildsAlexandru Croitor2021-12-163-9/+9
| | | | | | | Pick-to: 6.2 6.3 Task-number: QTBUG-90820 Change-Id: I7fab73f63a22901ab2d4d4e57b5a25b433100de5 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Fix pointer handlers example build: include piemenu, qmake supportShawn Rutledge2021-12-123-3/+15
| | | | | | | | | | Amends e17bfffc075202ff9ee8fba0f378f95037514740 and 8503f884bbdb50c4bebc8f8a9fce05275b0612b1 : all qml files need to be listed in CMakeLists.txt, we need to keep qml.qrc updated too, and we decided to keep the qmake project files. Change-Id: Idaa4bbddabd59e79a0ae3b907319c6843d8a026a Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Instantiator: don't interfere with delegates that assign parentsShawn Rutledge2021-12-101-7/+4
| | | | | | | | | | | | [ChangeLog][QtQml][Instantiator] Instantiator now avoids re-assigning a delegate object's parent to itself if it was already set; thus, you can now declare a parent assignment. Task-number: QTBUG-64546 Task-number: QTBUG-84730 Change-Id: I7d95fa76e71c363b4cb5b7a512c2e984488c8af4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Pointer Handlers example: show mouse wheel feedbackShawn Rutledge2021-12-104-3/+27
| | | | | | | | MouseFeedbackSprite now shows a mouse wheel animating in the same direction as the physical mouse wheel is being rotated. Change-Id: I08709ead3b85065723d2320d17d49adb51a00f92 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add HoverHandler.blocking propertyShawn Rutledge2021-12-091-5/+21
| | | | | | | | | | | | | | | As with WheelHandler, sometimes users want to let the hover events propagate (which has been the default all along), but sometimes it's not appropriate to allow parents of nested items to show hover feedback. [ChangeLog][QtQuick][HoverHandler] HoverHandler now has a property called blocking, which is false by default; but if set to true, it prevents hover events from propagating to items "under" this handler's parent, and their HoverHandlers. Task-number: QTBUG-85926 Change-Id: I26f89482e294c7a6b30a55a7e23ac444a0d1ac7f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix toplevel Qt build (for real this time)Fabian Kosmale2021-12-061-5/+5
| | | | | | | | | | | reused_dir_targets takes a list of targets, not directories, so provide that one. Amends 953c1cf394613fd5977aa4068f45d9d4b6d39662 Fixes: QTBUG-98468 Change-Id: I44e811ff738c5a51845c4829e1e6928e5f2f06f1 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 00c352c4d4b61f8c7a6243768bc5375c3dca3e76) Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Fix toplevel Qt buildFabian Kosmale2021-12-061-0/+5
| | | | | | | | | | | | All targets using the "shared" approach need special handling in toplevel builds to ensure that AUTOMOC works. Amends aa4897e017c027c935cd349450bf787393ce5552. Fixes: QTBUG-98468 Change-Id: Ic0a6ee0ab43190e359ad7cfb7e7634d393ff0b03 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit 953c1cf394613fd5977aa4068f45d9d4b6d39662)
* Add TapHandler.gesturePolicy: DragWithinBounds enum value; examplesShawn Rutledge2021-12-024-7/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On a touchscreen, right-clicking is not directly possible; so sometimes a long-press gesture is used as a substitute. The next thing a UI designer would want would then be a way of showing feedback that a long-press is in progress, rather than simply waiting for the long-press to occur and then surprising the user with some instant action. For example, a menu might begin to open as the user holds down the touchpoint; but before the long-press gesture is complete, the user can simply release, to cancel the gesture and close the menu. The timeHeld property could drive the animation, to avoid needing a separate animation type; in fact the reason timeHeld exists is to make it easy to emulate this sort of touch-press animation, like one that occurs on touchscreens since Windows 7. But after the menu is open, the user would probably expect to be able to drag the finger to a menu item and release, to select the menu item. For such a purpose, the existing gesture policies weren't very useful: each of them resets the timeHeld property if the user drags beyond the drag threshold; so if the user expects to drag and release over a menu item, then the timeHeld property cannot drive the menu-opening animation, because the menu would disappear as soon as the user drags a little. So it makes more sense to have a gesturePolicy that acts like WithinBounds, but also applies the same policy to the timeHeld property and the longPressed signal. We don't care about the drag threshold: if the user is holding down a finger, it's considered to be a long-press-in-progress, regardless of how far it has moved since press (as long as it stays within the parent's bounds). An example of such a menu is added. The menu must have TapHandler as its root object, because it reacts to press-and-drag within some larger item, larger than the menu itself. For example such a menu could be used in a canvas-like application (drawing, diagramming, dragging things like photos or file icons, or something like that): dragging items on the canvas is possible, but long-pressing anywhere will open a context menu. But in this example so far, only the menu is implemented. It's a pie menu, because those are particularly touch-friendly; but perhaps for the mouse, a conventional context menu would be used. [ChangeLog][QtQuick][Event Handlers] TapHandler now has one more gesturePolicy value: DragWithinBounds; it is similar to WithinBounds, except that timeHeld is not reset during dragging, and the longPressed signal can be emitted regardless of the drag threshold. This is useful for implementing press-drag-release components such as menus, while using timeHeld to directly drive an "opening" animation. Change-Id: I298f8b1ad8f8d7d3c241ef4fdd68e7ec8d8b5bdd Reviewed-by: Mitch Curtis <mitch.curtis@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>
* Rendercontrol example: use new cmake apiOliver Eftevaag2021-11-154-58/+28
| | | | | | | | | | | Updating the CMakeLists.txt files in the d3d11 and opengl version of the example to use the new qt_add_qml_module() function instead of the old qt_add_resources() Task-number: QTBUG-98130 Pick-to: 6.2 Change-Id: Ida43e4b0c875951a85d754b3a96f88366b580e24 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Model examples: use new cmake apiOliver Eftevaag2021-11-1213-79/+43
| | | | | | | | | | | | | | | | | The models directory contains 3 subdirectories with an example project in each. This patch updates the CMakeLists.txt files to use qt_add_qml_module() instead of the old qt_add_resources(). In order to achieve intercompatibility with both cmake and qmake, I had to do some slight modifications to both the .qrc files and the url path used to set the source to the QQuickView. Task-number: QTBUG-98130 Pick-to: 6.2 Change-Id: I13d1c01a0eda181823f394bc2a4259ce98abd4f8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* painteditem: better error message when running cmake on textballoonOliver Eftevaag2021-11-111-0/+4
| | | | | | | | | | | | | | | | | | | | | Building the TextBalloon in isolation doesn't make any sense. Its purpose is to implement a delegate, for the painteditem example to use, and should therefore only be built as part of the painteditem project. To build the example, cmake should be invoked with examples/quick/customitems/painteditem/CMakeLists.txt as its source path. The CMakeLists.txt in examples/quick/customitems/painteditem/TextBalloon should only be used from another CMakeLists.txt file via the add_subdirectory() command. If invoked directly it makes sense to print an error message and stop processing. Task-number: QTBUG-96806 Pick-to: 6.2 Change-Id: I1ebd2157790afbf7307498a4fb64049794ae6c5b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Embeddedinwidgets example: use qt_add_qml_module()Oliver Eftevaag2021-11-111-33/+11
| | | | | | | | | We want to use the new cmake api, rather than qt6_add_resources() Task-number: QTBUG-98130 Pick-to: 6.2 Change-Id: I567aec77b963adce03fb683c244d758880891ce5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Keyinteraction example: use qt_add_qml_module() in CMakeLists.txtOliver Eftevaag2021-11-1111-60/+44
| | | | | | | | | | We want to use the new cmake api instead of qt6_add_resources() The file structure has also been flattened a bit. Task-number: QTBUG-98130 Pick-to: 6.2 Change-Id: I1651d25e2902bf6932b78c2224ee4ffe454b658d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* MouseArea example: use qt_add_qml_module() and update a signal handlerOliver Eftevaag2021-11-113-30/+15
| | | | | | | | | | | | | | Thing patch updates the CMakeLists.txt file to use qt_add_qml_module() instead of qt6_add_resource(). Additionally, it changes a signal handler, which was previously a plain statement, into a js function, which is the preferred way to write signal handlers. Task-number: QTBUG-98130 Pick-to: 6.2 Change-Id: I1b08dcd3eae370d78587aa3d37d9456437b54b42 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Particle examples: use new cmake apiOliver Eftevaag2021-11-1199-1206/+416
| | | | | | | | | | | | | | | | | | | | | | | | | The particles directory contains 5 different examples and a shared directory with some images files. This patch changes the examples to use qt_add_qml_module() in the CMakeLists.txt project files, and changes the .qrc files to directory reference the files needed by the individual projects, which removes the need for images.qrc. (The .pro files still reference the shared.qrc file) The "content" directories located in the different example projects, have been removed, and the containing files have simply been moved to the parent directories instead. Some unused files in the itemparticle example have also been deleted. This example looks very outdated and should ideally be improved, or perhaps simply removed, but I decided to leave it for now. Task-number: QTBUG-98130 Pick-to: 6.2 Change-Id: If05986b4347814715bca50b8d3f6a5cddbf9ced4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Update examples to use new PropertyChangesUlf Hermann2021-11-0326-121/+228
| | | | | | | | Also, prefer the multi-line syntax over ';'-separated bindings for readability. Change-Id: I3d6eb854e514ee257ca83773a11e6e9e10770bff Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* rendercontrol_d3d11: Explicitly include qt_windows.hAndrei Golubev2021-10-291-0/+1
| | | | | | | | | Prevent accidental inclusion of windows.h through d3d11_1.h where max/min are defined as macro. That causes the subtle error elsewhere within the example Change-Id: I527c53ecbc82204a1f087719f5b0b4736d8c3447 Reviewed-by: Ulf Hermann <ulf.hermann@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>
* Fix indentation in positioners exampleIvan Tkachenko2021-10-281-14/+14
| | | | | | Pick-to: 6.2 5.15 Change-Id: I5a39ba9361503cd5d7ce2e6da59d7807d540bee5 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Remove import versions from qml files in the pointerhandlers exampleShawn Rutledge2021-10-2715-17/+17
| | | | | | | | | | | Many of these are portable to Qt 5; but we don't need the version numbers in Qt 6, and the components that use "palette" refer to Item.palette, which was added in Qt 6. Pick-to: 6.2 Change-Id: Ic799fba5dd66db51a8808c52dce01d27c6da62bb Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix pointerhandlers/fakeFlickable exampleShawn Rutledge2021-10-261-4/+4
| | | | | | | | | TapHandlerButton is not in this example: we just call it Button. Amends 8503f884bbdb50c4bebc8f8a9fce05275b0612b1 Pick-to: 6.2 Change-Id: I49bc6081f05642cd938a257c14c10497bfafb8a8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Pointerhandlers example: fix CMakeLists.txt linking errorOliver Eftevaag2021-10-261-5/+6
| | | | | | | | Fixes: QTBUG-97466 Pick-to: 6.2 Change-Id: I9bb0b79b12cbd43209f56137bbdb67ca2457ca6c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>