aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick
Commit message (Collapse)AuthorAgeFilesLines
* Fix toplevel Qt build (for real this time)Fabian Kosmale3 days1-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: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Scenegraph examples: Use suffix-less RHI constantsFriedemann Kleint3 days3-3/+3
| | | | | | | | | Complements 23dbe3d6e0d3338812ad9f614028a6fdc5a54090. Change-Id: Ic1bda49a888b0580ac483d650b879a9ae843129b Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 0b2311a62b25cbc34fd41bf0c9aef7e8327eb923) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix toplevel Qt buildFabian Kosmale5 days1-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) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Rendercontrol example: use new cmake apiOliver Eftevaag11 days4-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 Change-Id: Ida43e4b0c875951a85d754b3a96f88366b580e24 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 88dfbe0deaa780f1cb5793d644341367d02e3073) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 Change-Id: I13d1c01a0eda181823f394bc2a4259ce98abd4f8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit a155b3bc3ee161fbb7ff1760781577700b0aafce) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Keyinteraction example: use qt_add_qml_module() in CMakeLists.txtOliver Eftevaag2021-11-1211-76/+86
| | | | | | | | | | 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 Change-Id: I1651d25e2902bf6932b78c2224ee4ffe454b658d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 750e7d946ca8c059151e91c57da243bdc787ea6e)
* MouseArea example: use qt_add_qml_module() and update a signal handlerOliver Eftevaag2021-11-123-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 Change-Id: I1b08dcd3eae370d78587aa3d37d9456437b54b42 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 28bfd773cac84d228df9e6bdcc9bed84d79935c5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Particle examples: use new cmake apiOliver Eftevaag2021-11-1299-1196/+427
| | | | | | | | | | | | | | | | | | | | | | | | | 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 Change-Id: If05986b4347814715bca50b8d3f6a5cddbf9ced4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit aa4897e017c027c935cd349450bf787393ce5552)
* 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 Change-Id: I567aec77b963adce03fb683c244d758880891ce5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit fb264129529dc39cf94bc3e69ef14cc08d26df78) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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 Change-Id: I1ebd2157790afbf7307498a4fb64049794ae6c5b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit fe59c788a65579bbeeb550fcad96cf26443df77a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix indentation in positioners exampleIvan Tkachenko2021-10-281-14/+14
| | | | | | | Change-Id: I5a39ba9361503cd5d7ce2e6da59d7807d540bee5 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit e4308747d3a27a5b942c5b79fcbb77f7b327ae67) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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. Change-Id: Ic799fba5dd66db51a8808c52dce01d27c6da62bb Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit cc18223e0b7bb6677e649ffa42b043d327f9c7f3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Pointerhandlers example: fix CMakeLists.txt linking errorOliver Eftevaag2021-10-261-5/+6
| | | | | | | | | Fixes: QTBUG-97466 Change-Id: I9bb0b79b12cbd43209f56137bbdb67ca2457ca6c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit e2532e8773e0ee123d2b27e978026386b7ebc19d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* DragAndDrop example: Update CMakeLists.txtOliver Eftevaag2021-10-064-61/+31
| | | | | | | | | | This commit updates the drag and drop example to use qt_add_qml_module() in its CMakeLists.txt file. Change-Id: I47fd28a1a114fe70986f73d4f2d87265255652a0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit b128136f80d7e456d2c779750a4e39d4168cf204) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix wrongly copy-pasted dependency in exampleAlexandru Croitor2021-10-011-1/+1
| | | | | | | | | | Amends edc4357ae4893dd952ce1c07b180b4b334047606 Task-number: QTBUG-96805 Change-Id: Iedbf372cd94b1b04db55685a5d05daca491200fe Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit d5e8a697f8b33b3fb7671b97429c4e10ae345b91) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix textballoon example when using a shared Qt on macOSAlexandru Croitor2021-09-301-0/+8
| | | | | | | | | | | | | | | | Copy the qml plugin into the macOS app bundle just like we do for the examples that use the 'shared' project using the new add_qml_module_to_macos_app_bundle helper function. Amends 79cae5f6522bc259caa27b98031bfe84ef936744 Fixes: QTBUG-96805 Change-Id: Ib22131a15f0cd06a7888ec991f5ec9f79045d202 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 73d8a2c01667d1c1ac11d5bf0121b3a144ceb5f1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Refactor bundle_shared into a more reusable functionAlexandru Croitor2021-09-302-25/+37
| | | | | | | | | | | | | | | | | | | | Refactor the logic of bundle_shared into a more reusable add_qml_module_to_macos_app_bundle function that can be used in QtQuick examples that need to bundle the qml plugin on macOS, but don't use the 'shared' qml module plugin. The new function is placed in a QtBundleQmlModuleForMacOS.cmake file which can be included separately from the shared/CMakeLists.txt project. Amends 633a85cd39cdd294283439972cffebcff32ac0cb Task-number: QTBUG-96805 Change-Id: Iebb3f4734b9a6bd8a8316bf5ae01d9740c442645 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 7ab424a5cd7790dd87eabd68c294d38662aca8fe)
* CMake: Fix textballoon example when using a static QtAlexandru Croitor2021-09-302-2/+1
| | | | | | | | | | | | | | | | Don't pre-create a qml module backing library, don't link to it directly and instead rely on regular qml plugin loading. This avoids undefined linker errors. Amends 79cae5f6522bc259caa27b98031bfe84ef936744 Fixes: QTBUG-96805 Change-Id: I77acd086257e27e1933e9b36d7f0212765afceb3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit d73f98b1b560ce9776250f0a81c37682de0c8190) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix examples that use 'shared' project when using a static QtAlexandru Croitor2021-09-309-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using a static Qt, linking of examples that use the 'shared' Qml module would fail with the following error Undefined symbols for architecture x86_64: "qt_static_plugin_sharedPlugin()", referenced from: StaticsharedPluginPluginInstance::StaticsharedPluginPluginInstance() in window_shared_init.cpp.o This happened because the 'shared' project pre-created its plugin target with qt_add_library instead of qt_add_plugin. qt_add_plugin passes an additional QT_STATICPLUGIN compile definition when compiling the moc'ed file to ensure that the QT_MOC_EXPORT_PLUGIN macro creates a qt_plugin_instance_PLUGIN_NAME symbol. Unfortunately we can't use qt_add_plugin for shared Qt builds, because some of the projects link directly against the plugin target and it's not possible to link against a MODULE_LIBRARY target which qt_add_plugin creates in shared Qt build. We could try to conditionally switch between using qt_add_library for a shared Qt build and qt_add_plugin for a static Qt build, but that further complicates the build system code because it requires specifying a class name and plugin type explicitly. Remove the direct linkage against the libraries in the examples and instead rely on plugin loading. This simplifies the logic of not having to pre-create a target. Amends 7b6eea37aeea55cdf1bcb1fd9c3091d6753f95e8 Fixes: QTBUG-96805 Change-Id: I5b2f3992ccda29b59f1e99748005381c73daca69 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit edc4357ae4893dd952ce1c07b180b4b334047606) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Ensure proper dependencies in bundle_sharedAlexandru Croitor2021-09-301-0/+4
| | | | | | | | | | | | Ensure the shared qml module is built before it is bundled into the app's bundle dir on macOS. Change-Id: I0b93fc54d1caa86070335347f5d2735eafe6819a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 2a04bfaf3a2054222cc8a508ecd11727f2b2269b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix delegatechooser example to use QML modulesUlf Hermann2021-09-304-57/+22
| | | | | | | | | | | We need to rephrase the image source selection due to ListElement only accepting literals. We can't just poke into the qrc file system of the "shared" module without importing it. Change-Id: I54d3fa4daf304afc9a0a55ab8b590d9c5ad20aa2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 485416c9d57e8ff8fe4fc0f7f4a3c4fdeaf35e98) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* doc: Replace qmlscene with qmlShawn Rutledge2021-09-301-2/+3
| | | | | | | | | | | We deprecated qmlscene in a9c93e2716a097c637515aded49a3308e257204b so we should stop recommending it in docs, too. Task-number: QTBUG-53219 Change-Id: Ic729624a8ef849bd13f38087e20b5a410c5c5756 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 0c4851e12b9ec42fddbb64a9f86003a435644f80) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix ImageElements example to use a QML moduleOliver Eftevaag2021-09-2927-116/+81
| | | | | | | | | | | | Removed the 'content' directory, and placed all images into a 'pics' directory. CMakeLists.txt is now also using qt_add_qml_module() Change-Id: I673b7adea1832f304003f95e171118b0822b3c83 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 34bc389543c37b8439c9c0b48f471649b6529868) Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Move most of the pointer manual tests to a new pointerhandlers exampleShawn Rutledge2021-09-2946-0/+3263
| | | | | | | | | | | | | | | | | | | | | | | They were always meant to be examples eventually. Now they will be used for an example of how to implement custom controls using only basic items and handlers. Some components are very similar to those in the shared directory; but most examples will use Qt Quick Controls, so those shared components can be removed when we no longer use them. This example should remain as the one that shows how to build reusable controls "from scratch". Removed InputInspector because it's inefficient, has limited usefulness, tends to require building the manual test to be able to run it, and could be better built as a reusable Qt.labs component later on, providing a model with all known devices and taking advantage of the QPointingDevice::grabChanged signal to track the grab states rather than polling. Change-Id: I47ab6ebb2cecab07a69cf96e546ffd0db3026a60 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 8503f884bbdb50c4bebc8f8a9fce05275b0612b1)
* Use strict === equality for ScrollBar::orientationIvan Tkachenko2021-09-271-7/+7
| | | | | | | Change-Id: Icaf1bcda4a996cc3348911c87e43c4af2a246d73 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit f5fc1d556da8f225275490cd539795ad8bba9bf2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Shapes interactive example: use Controls canonically; architectureShawn Rutledge2021-09-271-259/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As long as we had the funcs array, it would have been nice to be able to directly get an index from whatever "tool" is selected. For example, TabBar has currentIndex; but TabBar is otherwise not a great fit here. But the funcs array wasn't so elegant anyway. So that prompts switching to the known OO design pattern in which drawing tools are objects containing functions that "do" the drawing, so that there's no conditional dispatch: just ask the tool to handle each mouse state change. I.e. here the DragHandler on the canvas uses the tool's shapeType Component to create the shape, but the DragHandler doesn't have to care which shape it is. Handles for moving the shapes' control points are also shape-agnostic: - a handle is a sort of template taking the path x and y properties to read and write - the handle initializes its position from those properties - the DragHandler inside gets to do what it does best: just drag the handle, nothing else (instead of needing to script the movement of both the handle and the control point, we don't script either one) - declarative bindings on the handle's position update the path properties whenever the handle moves And some styling: - Switch looks better than Button for toggling - use palette colors so that it looks good in dark mode too - fix handle colors getting stuck on yellow - borders on handles (yellow on white makes it hard to see the edge otherwise) - reorder curve types by mathematical order (line, quadratic, cubic) Change-Id: Iefd980f428601840deb55370aad9256748855f07 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit d5fb3c9a61d92bda7830ea3656fc44e83e7beae1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Shapes example: give each qml file's root item a default sizeShawn Rutledge2021-09-2317-2/+32
| | | | | | | | | | | | | | | | | Each square is resized anyway in shapegallery.qml; but for the sake of running individual examples on the command line with qml, the content being shown should be visible. Without this fix, each item had a 0,0 size by default; but the shapes themselves have their own sizes and are centered in the zero-size root item. But when a window is created, the window system does not allow it to have zero size, so it expands; and then the shape would be centered at the top-left corner, and you could only see part of it. Change-Id: I42a537421430aea8233106353e9c2033f5bc5774 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 38ac4b4ec2c08a6ea4ae693514e8c3520eb00c2a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix ExternalDragAndDrop example to use qt_add_qml_module()Oliver Eftevaag2021-09-091-18/+13
| | | | | | Change-Id: Ic368ce6e36ee41aff519a3ae106d18670c05bb54 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 9556a46743ef77c611658a18744815f78c9f980f)
* Examples: Fix top level buildFabian Kosmale2021-09-071-0/+1
| | | | | | | | | | | | | | Examples using the "shared" pattern need to be recorded in the list in examples/quick/CMakeLists.txt, so that we do the necessary AUTOMOC handling for them in a top level build. For details, see the commit which introduced that list. Amends 34bc389543c37b8439c9c0b48f471649b6529868. Change-Id: I6945b0c8445fe436da259dd240342e1c3b5cbf26 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Craig Scott <craig.scott@qt.io> (cherry picked from commit 011ee2dfec6b994430b9464f6c74d1c7246d508a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Clean up the painteditem exampleUlf Hermann2021-09-0714-85/+152
| | | | | | | | | | | | The way it was before it was unusable. Move the files that belong to the TextBalloon module into their own directory, and add a wrapper application that loads textballoons.qml with the right parameters to actually find the TextBalloon module. Make sure that the qmldir file is copied to the output directory. Change-Id: Ie7407a425a0a95a46de6486f9a28fd1aee07de9f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 79cae5f6522bc259caa27b98031bfe84ef936744)
* Fix top level builds failing with AUTOMOC-related missing moc exeCraig Scott2021-09-071-1/+7
| | | | | | | | | | | | | | | | | | | | | In top level builds, qt_autogen_tools() needs to be called on any target that enables AUTOMOC. A previous commit fixed that problem for the qt_target_qml_sources_example target, but missed also fixing it for the associated plugin target. Add that missed call here. More examples that use the common "shared" quick directory have also since been added, but the step that ensures qt_autogen_tools() was missed. Add them to the missing step. One of the existing steps also had a typo, which meant it wasn't handled either, so correct that as well. Amends 067253fb2f1aec3e03c577dd53ed2e6d903c28da Task-number: QTBUG-96118 Task-number: QTBUG-96159 Pick-to: dev Change-Id: I2fae5d9a1fd474b22e01ec51d5b1030237f3e08f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix layouts example to use a QML moduleOliver Eftevaag2021-09-062-28/+17
| | | | | | | | | Changing the CMakeLists.txt file to use qt_add_qml_module(). Change-Id: Icafe9359494136af6d5f3befaa9e767ab12deb30 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 2cd4391ba0c214d26ebf9298a0130b17c588a8c2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix positioners example to use a QML moduleOliver Eftevaag2021-09-064-61/+28
| | | | | | | | | | | | | | This fix changes the CMakeLists.txt file to use qt_add_qml_module(). It also updates copyright headers and changes import statements to remove version numbers. This causes the example to use qt quick controls 2, rather than qt quick controls 1, which is obsolete, and should no longer be used by any of our examples. Change-Id: I1e40990b3a184c73b67a2ab04b4ec555774b8a1b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 06e96fdcdeee76fc65569cb64e5da26850b19c00) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix righttoleft example to use a QML moduleOliver Eftevaag2021-09-065-62/+29
| | | | | | | | | | | Updated CMakeLists.txt to use qt_add_qml_module(). Copyright headers and import statements have also been updated. Change-Id: I8093d186f433293e63c6330def579f5589a938e6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 56b47052b875a065f577411541e57dd9c50ace57) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix the canvas example to use a QML moduleUlf Hermann2021-09-042-55/+27
| | | | | | | Change-Id: I84445909adafbd2cf0f5654fa78a005ed243536f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit a57d3a0bebbce31ab579f3739d453baf6cacc12d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix animation example to use a QML moduleUlf Hermann2021-09-043-61/+35
| | | | | | | Change-Id: Ic53194b43eb651438d3f89bbb5dfbb97aff8b606 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 65b2e46423120d139dde0741f1f8e7763c08ce92) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update text example to use QML modulesUlf Hermann2021-09-043-63/+35
| | | | | | | Change-Id: If1c8455aa823eb432f10586bdb31a65166ed915d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit e11c320029e9eedf93af2acb6d356aae4acb5d3c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix threading example to use QML modulesUlf Hermann2021-09-043-47/+20
| | | | | | | Change-Id: I973244a0546e668ba8c65e573747e08f60a506c0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 23ddc51e5e44646d5b54d46414c0a60895d880b5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Install the "shared" example module into macOS bundlesUlf Hermann2021-09-037-0/+40
| | | | | | | | | | | | | | | | If we build an application bundle we cannot rely on the relative path between the application's and the shared module's output directories. This is somewhat ugly, but as we don't have a comprehensive solution for building application bundles, yet, it's the best we can do right now. In order for the shared bundle to be loaded from the PlugIns directory, we need to add the PlugIns directory to the import path on macOS. Change-Id: I5b952420b4bb60af74886a140fa2c6a263d2f730 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 633a85cd39cdd294283439972cffebcff32ac0cb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Clean up flipable exampleOliver Eftevaag2021-09-038-14/+62
| | | | | | | | | | | | | | | | Turning the project structure to be inline with Ulf's ideas. Such as using qt_add_qml_module(). Previously the path to 5_heart.png and 9_club.png were broken. This patch updates the path in the qml file, in order to make sure that the resource is actually loaded. It also adds a CMakeLists.txt, since it didn't already have one. Change-Id: I4b2ffbfcfff7d2d63d7aab9fd7b40f77c1a1073c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 713bb3ce8f7f61c1d37c6842d1bb9b792e423b25) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix documentation warnings in qtdeclarativeTopi Reinio2021-09-031-1/+1
| | | | | | | | | | | | | | | | | | | * QtLabsPlatform has its own documentation project, but its source directory was pulled into QtQuick docs, causing duplicate generation and warnings. * Fix \snippet paths for files that were renamed/moved around. * Clean up .qdocconf files, use the {,} syntax to set identical values for multiple variables. * Fix incorrect \sa link. Fixes: QTBUG-96125 Change-Id: I4c83787ac23a5b40019c74d46ee87c968a8d4907 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> (cherry picked from commit 5e6777be1d793740c184b4f49536b12fd83735b1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix top level builds where AUTOMOC_EXECUTABLE was unset on some targetsCraig Scott2021-09-031-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The qt_example_build_end() command tries to recursively find all build system targets by descending into all source directories. Some sets of examples re-use the same source directory multiple times with different build directories, but this hides all but one of those re-used source directories from the recursive search. This resulted in some targets being missed, which in turn prevented qt_autogen_tools() from being called on them. In top level builds, this meant AUTOMOC_EXECUTABLE wasn't set, so CMake tried to verify the moc it wanted to use, which doesn't exist for the first configure of a top level build, resulting in a fatal error. Since we can't find all targets reliably with a recursive search, manually handle the ones that could be missed. There was a similar problem with qt_autogen_tools() not being called for a target created to compile a doc snippet. The error message is the same as the case above, the cause is again AUTOMOC_EXECUTABLE not being set, but for a different reason. Apply the same fix and call it manually, which should have been the case originally. Fixes: QTBUG-96118 Fixes: QTBUG-96159 Change-Id: I079c696cf74f77d7caa2c59e6263d3fb1c55d20e Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 920a5f727b02cade81fac0a5536e52bbb4c72d73) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix localstorage example to use a QML moduleOliver Eftevaag2021-09-0311-72/+56
| | | | | | | | | | | Removing the directory 'localstorage' that is inside the top-level 'localstorage' directory, and moving the content one level up in the file hierarchy. Change-Id: I97cf1ff92be9860d9a92bce66c88af927618e2b0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit b0e567e7e3927945c904e9a613af4b9064d70bc1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* ExternalDragAndDrop example: Use controls from Qt Quick Controls 2Oliver Eftevaag2021-09-034-40/+16
| | | | | | | | | | | | | | | This patch changes the external drag and drop example to use qqc2 checkboxes instead of a custom made component. It also changes the position of the checkbox in order to avoid having the label text overlap with it. Task-number: QTBUG-95736 Change-Id: If3e798ea0ccd64921138690c7599876ec0584038 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 8976c46f46e4559913948748148ce42c33a6c138) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* ImageElements example: Use QQC2 and update copyrightOliver Eftevaag2021-09-0313-50/+68
| | | | | | | | | | | Updating the example to use qt quick controls 2 where it makes sense, as well as copyright headers. Task-number: QTBUG-95737 Change-Id: Ie22ab8551926916abd0a478adc16d1d4daeb13ad Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit e771c12ae73d987f8bda8802e03694c425ef749c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* EmbeddedInWidgets example: Use QQC2 componentsOliver Eftevaag2021-09-036-106/+11
| | | | | | | | | | | Replaces the TextBox custom component with a qt quick controls 2 TextField. Task-number: QTBUG-95735 Change-Id: Ic1fb47c8e57cd2d805d4a9941df9bc02a5e7bc17 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 409019bc1185b605a6a3e1f1ab474117d5ce0055) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Rename shapes example qml files according to what they demonstrateShawn Rutledge2021-09-0119-48/+48
| | | | | | | | | | | | | The order they are shown in the grid is not important; but users should be able to run any of these qml files directly without building the example, and appropriate names make the "right one" easier to find. Task-number: QTBUG-95739 Change-Id: I9751b52ce80bc08e12919ca3396c9d428d700a04 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 270a6f9bba75478204dc6aadb348cf34a195a4da) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Disable quick examples currently breaking top level buildsCraig Scott2021-09-021-3/+3
| | | | | | | | | | | | The add_subdirectory("../shared" "shared") pattern used by these examples seems to somehow trigger an AUTOMOC-related generation error. The cause is not currently known, so this change temporarily disables those tests until a proper fix can be found. Task-number: QTBUG-96159 Pick-to: dev Change-Id: I2525b77d0a25c3e3191ae2956857acabc0aedbf5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Clean up shapes exampleUlf Hermann2021-09-0126-182/+61
| | | | | | | | | | | | | Drop the confusing alias mangling on all the QML files. Instead move them into the base "shapes" directory. Also, use a QML module in CMake and use the "shared" module as intended. Change-Id: I6a8fc3f2b2f86f58a54e188cf83ec7e2d4e8f468 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 66c011c5582de0565d85a77b282118a84aba51ad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix dialcontrol example to use a QML moduleUlf Hermann2021-09-0111-32/+26
| | | | | | | | | | | | Also move the QML files out of the "content" subdirectory in order to avoid the directory import. Change-Id: I84a1f5ef1a45e5098ec3213c6fbce06346f3606a Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 2dfb912058ecb865f2ed5becad04756b51bfbc7b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>