summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
...
* Simplify dragNDrop example and remove unneeded aliasThomas Zander2023-02-211-11/+1
| | | | | | Pick-to: 6.2 6.4 6.5 Change-Id: Ia0e5d5dc46a60b6d88864b3250f8cf91b03b897f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Use SequentialAnimation.loops in FlashAnimation in handlers exampleShawn Rutledge2023-02-211-7/+1
| | | | | | | | It looks less tedious. Amends 8503f884bbdb50c4bebc8f8a9fce05275b0612b1 Pick-to: 6.2 6.4 6.5 Change-Id: I85690e6a8ceac4ebec1c00bcbbf6a81108096e6c Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* Update the custom MultiEffectKaj Grönholm2023-02-163-44/+49
| | | | | | | | | | Re-export the example custom MultiEffect component with the latest QQEM version. Also add copyright headings into the project. Task-number: QTBUG-111150 Pick-to: 6.5 Change-Id: I27f6ad2edc220a7f5f625f6dae23159318fa20e2 Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
* Chat tutorial: Fix deprecation warningFriedemann Kleint2023-02-162-2/+2
| | | | | | | | | | | Adapt to qtbase/14f9f00fdb2dc428610c08e3d9d03e38e9602166, fixing: sqlcontactmodel.cpp:40:13: warning: void QSqlQueryModel::setQuery(const QSqlQuery&) is deprecated: QSqlQuery is not meant to be copied. Pass it by move instead. [-Wdeprecated-declarations] Pick-to: 6.5 6.4 6.2 Change-Id: I88d7f30247876f55b0114785efcf4ce580de0ab8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add File System Explorer exampleDennis Oberst2023-02-1428-0/+1368
| | | | | | | | | | This example shows the customization of Qt Quick Controls by implementing a simple file system explorer. Using a C++ model, entries are visualized in a TreeView, and text files can be read. Fixes: QTBUG-108289 Change-Id: I966dcf65e40d3b727889dc14c65edd0ffcc1b878 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* CMake: Fix configuration errors in quickcontrols chat tutorialJoerg Bornemann2023-02-141-2/+6
| | | | | | | | | Amends 32dac75fb47cc21626e9d8a3f9b07889cb3dad37. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I4fb2ca6d7ce29f6495c7f2bacaeb3596d1fd8e08 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix locale exampleFabian Kosmale2023-02-131-14/+15
| | | | | | | | | | | | | Instead of fetching data from the view, we should rather fetch it from the model, which avoids a bug with casting when the currentItem is null. Use the opportunity to use a typed list for the model instead of a plain JS array. Original-patch-by: Kai Köhne <kai.koehne@qt.io> Pick-to: 6.4 6.5 Change-Id: Ib23fb31b3d0a2c309c98bf762cea1a8c05080c38 Reviewed-by: Kai Köhne <kai.koehne@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Adapt to Qt::Appearance to Qt::ColorScheme renameTor Arne Vestbø2023-02-133-3/+3
| | | | | | Pick-to: 6.5 Change-Id: I5830af713e024fa9a7086e8c56e6808ff8593394 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove unused code in attachedstyleproperties exampleMitch Curtis2023-02-131-2/+0
| | | | | | | | Amends 49b9f1f1e85ce9aee960b1384fb542daacd8b7a7. Pick-to: 6.5 Change-Id: Ia0ab5ab01397c2a60ee119823936d68383ccc8b6 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Examples: Exclude tutorials from CMake Unity (Jumbo) buildsFriedemann Kleint2023-02-101-0/+2
| | | | | | | | | | | They don't build due to clashing static helper functions. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I57e407ce4ac3342ec0dbd52b5cf958f44a18e4ae Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
* Add custom MultiEffect into testbed exampleKaj Grönholm2023-02-0813-3/+602
| | | | | | | | | | | Add CustomMultiEffect QQEM project and the effect exported from it into the MultiEffect testbed example. This can be used to validate the QQEM MultiEffect node compatibility with the Qt Quick MultiEffect. Task-number: QTBUG-109740 Pick-to: 6.5 Change-Id: I596bf54316ab70b85b1ace33a433a4109c43b239 Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
* Examples: Add missing include guardsFriedemann Kleint2023-02-031-1/+5
| | | | | | | Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I968865958770f6282ab6f79dc9b2becf4f7795af Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Don't auto-close popup in Attached Style Properties ExampleSze Howe Koh2023-02-031-2/+2
| | | | | | | | So that users can see the theme change while the popup is open Change-Id: I9cac09badc04c5dcace45dadaa9282900b093e17 Pick-to: 6.5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: Fix compile-time warnings in Attached Style Properties ExampleSze Howe Koh2023-02-032-3/+3
| | | | | | | Fixes: QTBUG-110831 Pick-to: 6.5 Change-Id: Iee931d5595cab1c6fb40b5ddff0596ce6195788a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qt_add_qml_module: Make usage of AUTO_RESOURCE_PREFIX a policyFabian Kosmale2023-02-0117-13/+17
| | | | | | | | | | | | | | | | Writing AUTO_RESOURCE_PREFIX in every qt_add_qml_module call seems rather pointless. In addition: - Add documentation for QTP0001. - Adjust some of the examples to use QTP0001 policy. - Improved the error message. Pick-to: 6.5 Task-number: QTBUG-96233 Change-Id: I6e19a491acba97493893bf1953fca3462296c1ea Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* CMake: Allow omitting the version of QML modulesUlf Hermann2023-01-27107-107/+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>
* Adjust the MultiEffect APIKaj Grönholm2023-01-268-77/+77
| | | | | | | | | | | | Based on the API review, adjust the MultiEffect API. - Change mask threshold Low/Up to Min/Max and for spread AtMin/AtMax. - Change colorize to colorization so it is more symmetric with brightness, saturation etc. Task-number: QTBUG-109557 Pick-to: 6.5 Change-Id: I96ff2a13e20405998c5ed0cb38ad3b5911daf94c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Doc: Update QML I18N example docsLeena Miettinen2023-01-181-19/+47
| | | | | | | | | Describe the use of qsTr() and QQmlApplicationEngine, as well as the CMake qt_add_translations command. Task-number: QTBUG-110009 Change-Id: I7d2244a772fdb132acdb5f9f66294a7d772e0d36 Reviewed-by: Jörg Bornemann <joerg.bornemann@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>
* Remove forgotten examples in the 'customitems' dirOliver Eftevaag2023-01-1746-1741/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the following examples in particular: - progressbar - scrollbar - searchbox - slideswitch - spinner - tabwidget The reason for removing them is that they've clearly been forgotten, and no longer serve a purpose. They can only be built with qmake, since they're missing a CMakeLists.txt file, and even if you try to build them, the build will fail since the DECLARATIVE_EXAMPLE_MAIN macro in shared.h were at some point updated to prepend the resource patch to have the same prefix that the AUTO_RESOURCE_PREFIX cmake flag provides. Which had the side effect of causing these examples to no longer build out of the box. The purpose of the examples has been to demonstrate how to make custom controls. Today we recommend users to instead make custom styles for QQC2, which the flatstyle example demonstrate how to do. Pick-to: 6.5 Change-Id: I26af18ecaef836495f0c2a7e376268b1f956b1a9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Quick examples: Modernize cmake files according to our guidelinesOliver Eftevaag2023-01-1645-248/+170
| | | | | | | | | | | | | | | | 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>
* Fix layouts and localstorage examplesOliver Eftevaag2023-01-112-4/+4
| | | | | | | | | | The layouts and localstorage examples wouldn't work properly, since the path to the initial qml file given to the engine didn't start with "qrc:/qt/qml" Pick-to: 6.5 Change-Id: I26b5bbf3f6e7078c4f4aba6bab6fc06451b49082 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Make quick examples that rely on the shared files build with qmake againOliver Eftevaag2023-01-111-1/+1
| | | | | | | | | | | | | | | In d270c51f812b5f0ffe6208b38c8ea0e898535e50 the DECLARATIVE_EXAMPLE_MAIN macro was modified to prepend the "qrc:/qt/qml" prefix to file paths that should be loaded by the engine. But the patch forgot to update the shared.qrc prefix, which means that the examples that relied on the shared module, would no longer build out-of-the-box with qmake. This patch solve the issue, so that the examples work with qmake once again. Pick-to: 6.5 Change-Id: I677c1e61423cf98c6a1030ce591707888456ef19 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* TextEditor example: Avoid deprecation warningUlf Hermann2023-01-111-1/+1
| | | | | | | | | | What we want there is intercept the URL through the QML engine. No need to dig out the specific QQmlFileSelector for that. Pick-to: 6.5 Fixes: QTBUG-102777 Change-Id: I5ca59316a2434013f91afdf92d3e397ea2711128 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Use inline component in sidebar example rather than LoaderShawn Rutledge2023-01-051-64/+57
| | | | | | | | | | | Originally in ca9e2a0d7488cbbb94d8343c43eb49c6ee5f6519 I used Loader as a way of reusing some content in two places in one QML file, not necessarily to test hover behavior with Loader. Inline components are a little cleaner. Pick-to: 6.2 6.4 6.5 Change-Id: Ib064bdb460704bec0c714550d8935dcef8af0637 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
* 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>
* map example: don't restrict pinch-zoom to centerShawn Rutledge2023-01-021-2/+0
| | | | | | | | | | A big advantage of PinchHandler over PinchArea is the ability to zoom into a particular location in the target Item, so let's not fail to show that off. Pick-to: 6.2 6.4 6.5 Change-Id: I0f22abff99bdc60bac27e72fd5f66be4796794df Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* 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>
* qmake: Fix build of quickcontrols examplesJoerg Bornemann2022-12-142-1/+1
| | | | | | | | | | | | | | | The QuickControls2 module has been moved to src/quickcontrols. Its examples are in examples/quickcontrols. Adjust the .pro file name in examples/quickcontrols and fix the SUBDIRS entry to it. This amends commit 4bd87b903b355b53e3105ba1ae7c154c4e55cdaf. Pick-to: 6.5 Task-number: QTBUG-109383 Change-Id: I9de70a773a11344398c01b3e84e557213268c935 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Replace hard-coded Qt version number with the \QtVersion macroTopi Reinio2022-12-121-2/+2
| | | | | | | Pick-to: 6.4 Task-number: QTBUG-108101 Change-Id: I868e9aaa313733af1676977c793186aa8c0aa0aa Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Docs: Add an animation of the app in actionNicholas Bennett2022-12-122-4/+6
| | | | | | | | Added a gif image. Fixes: QTBUG-108417 Change-Id: Ieeca1a8fd3d76e594581ff5732ebc771a4f367fb Reviewed-by: Ville Voutilainen <ville.voutilainen@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>
* Doc: remove "2" from Qt Quick Controls filesMitch Curtis2022-12-0180-84/+84
| | | | | | | | | | | | | Work on this was already started for the documentation in 1abdfe5d5a052f2298b7bf657513dfa7e0c66a56. The CMake target (docs_QuickControls2) probably can't be renamed until we rename the library, which won't happen until Qt 7. Task-number: QTBUG-95413 Change-Id: Ied20805a91286436606577c3de39671a447f27dd Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Remove "2" from Qt Quick Controls directoriesMitch Curtis2022-12-01754-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Qt Quick Controls 2 was named that way because it was a follow-up to Qt Quick Controls 1.x. Now that Qt Quick Controls 1 is no longer supported, we don't need to have "2" in the name. Work on this was already started for the documentation in 1abdfe5d5a052f2298b7bf657513dfa7e0c66a56. By doing this renaming a few weeks before feature freeze, it won't affect the release but still results in as little time possible spent manually fixing conflicts in cherry-picks from non-LTS releases as a result of the renaming. This patch does the following: - Renames directories. - Adapts CMakeLists.txt and other files to account for the new paths. A follow-up patch will handle documentation. It does not touch library names or other user-facing stuff, as that will have to be done in Qt 7. Task-number: QTBUG-95413 Change-Id: I170d8db19033ee71e495ff0c5c1a517a41ed7634 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QmlExamples: Add missing dependencies of QtQuick in CMakeListsSemih Yavuz2022-11-0715-19/+25
| | | | | | | | | | | | Running qmllint on extending-qml examples raises a plenty of warnings due to a missing dependency declaration to QtQuick. Simply add it. Also add FINAL to all properties exposed from C++ to disable (possible) property shadowings. Pick-to: 6.4 6.2 Fixes: QTBUG-106602 Change-Id: I7b12a804f8f3ca64bd8f2f312a9e53dfe02b0a4c Reviewed-by: Fabian Kosmale <fabian.kosmale@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>
* attachedstyleproperties: remove debug message from CMakeLists.txtMitch Curtis2022-10-261-2/+0
| | | | | | | Amends 49b9f1f1e85. Change-Id: If08e3e2b20d12e444c304c40fba23990fa5e2112 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* iOS Style: Make QQuickIOSStyle a singleton and private APIDoris Verria2022-10-213-6/+3
| | | | | | | | | | | | | | | | | | | | | | | We weren't really supporting an attached API for the iOS style, even though QQuickIOSStyle was a QQuickAttachedObject. The QQuickIOSStyle had two properties: theme and url. We were using the read-only IOS.theme property to select the source for the assets based on the theme (light/dark), but this is not needed anymore as we are now using the new Qt.styleHints.appearance property instead. The url property was also not configurable and the controls implementations were using it to access the path of the image assets. As both of these properties were not settable and propagatable, and we don't intend to make them as such, it doesn't make sense to have an attached API for this. So make the QQuickIOSStyle a QObject and a singleton. Remove the theme property. Since the API doesn't need to be public, move it to the private iOS.impl module. Change-Id: I197aadba2032a30d97a3d9a6698b74aa8709b6f9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix texteditor example for AndroidTomi Korpipaa2022-10-212-0/+85
| | | | | | | Pick-to: 6.2 6.4 Fixes: QTBUG-103939 Change-Id: I60237f8cc58ebb6781a4df272fb7da13467d6640 Reviewed-by: Mitch Curtis <mitch.curtis@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>
* Port away from deprecated _qs UDLMarc Mutz2022-10-181-1/+3
| | | | | | | | | | Use Qt::StringLiterals::_s instead. Also reflow lines because stricter /Zc options coming in from a qtbase update make MSVS barf on line-broken u"" ""_s expressions. Change-Id: I95a2a3d878d2ac506d9c54bbdeb734cf5d94bb8b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make QQuickAttachedPropertyPropagator publicMitch Curtis2022-10-1315-0/+659
| | | | | | | | | | | | | | | | | | | | | | | | This type has been used internally as QQuickAttachedObject by the Imagine, Material and Universal styles to enable propagation of colors, dark mode flags, etc. for a while now. Users would benefit from having access to it to create their own styles (although it's not just limited to that use case). This patch: - Makes the type public in quickcontrols2. - Adds documentation and an example. - Fixes the test_window test to ensure that propagation through child windows actually works. [ChangeLog][Controls] Added QQuickAttachedPropertyPropagator, which provides a way to propagate attached properties from parent objects to children. This is especially useful when creating your own style. Fixes: QTBUG-63267 Change-Id: I2f1794dc4a9f2be56fad2f5e5f39e2ab845157fa Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* SEO-enhance attached property documentationFabian Kosmale2022-10-121-0/+6
| | | | | | | | | | | | Currently, it's rather hard to find the documentation on how to write attached properties. The page that gets found first in most search engines seems to be the example - so link from it to the actual documentation pages. Pick-to: 6.2 6.4 Change-Id: I78c9949d62863b5c11ffcd97413084ab03b0bc33 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Move Settings out of Qt.labs moduleYuhang Zhao2022-09-293-5/+5
| | | | | | | | | | | | | | Move Settings from the Qt.labs module to the QtCore module. And deprecate the original one in Qt.labs. Also changed the fileName(QString) property to location(QUrl) to better fit the Qt API. Adjust the tests accordingly. Task-number: QTBUG-92806 Change-Id: I1cbad1315383a9f2963583fd4d00cf3612f99f1e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Automotive example: Use qt_add_qml_module()Oliver Eftevaag2022-09-261-158/+115
| | | | | | | Task-number: QTBUG-98130 Pick-to: 6.2 6.4 Change-Id: I18e45ab63e0cab8611b4274e2d312db12fc9775d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>