aboutsummaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* Gallery example: remove binding loop from TextArea pageOliver Eftevaag2021-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | | The width binding for the TextArea was didn't make a lot of sense. It used to be limited by the panes availableWidth / 3, but if the implicitWidth was less, the text would move towards the center, since the anchors are centering the TextArea horizontally. Setting the width to just always be the panes availableWidth / 3, simplifies the binding, removes the binding loop, and doesn't move the visible text towards the center when the implicitWidth is less than 1/3 of the panes availableWidth. Note that this doesn't directly fix QTBUG-91109, because QTBUG-91109 isn't really a bug to begin with. Fixes: QTBUG-91109 Change-Id: I5b6de8dfd11fd726e8ffdae0e46143c448985dc4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 9025ea98cad57696aeee41a614cf21e9938aa527) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix warnings/errors from changes to paths in chapter6-plugins exampleCraig Scott2021-09-101-2/+1
| | | | | | | | | Amends 2d2750efc3b5a97a5f1cf09b4265a26fcc393499 Change-Id: Iab27efb7359cfcea9274dcbbc7ac64b647d3e71b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 784af37650a77b30de01776262c1fe6727075615) Reviewed-by: Craig Scott <craig.scott@qt.io>
* 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>
* Fix dynamicscene example to use a QML moduleUlf Hermann2021-09-0417-66/+47
| | | | | | | Change-Id: I23b87b8ca98721cebc0dc948f0c9bbf741af6cd5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit be260ba5290f8e51519abb5430b85a142b408258) 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>
* Simplify the XmlHttpRequest exampleOliver Eftevaag2021-09-037-213/+61
| | | | | | | | | | | | | | | | | | The XmlHttpRequest example contains a lot of unnecessary code, and I felt that most of it could just be removed. The point of the example project is to showcase how to use the XMLHttpRequest javascript object to make requests. Which is why I felt that we could remove any outside dependencies for the project (like the LauncherList from the 'quick/shared' directory), and reduce the amount of components down to the minimum. Fixes: QTBUG-95734 Change-Id: I9b062f4d7e942db4a2669a8c65f7488aa4a54740 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 5d751f3ce6e2b5758dd0f1184d59e69370cdeb8a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Replace custom button component with QQC2 buttonsOliver Eftevaag2021-09-039-104/+85
| | | | | | | | | | | | | | | | | | Now that we've moved qtquickcontrols2 into the qtdeclarative submodule. We want our examples to simply use qqc2 controls, rather than custom made buttons and other controls. This example used a custom made button component, which this patch will replace with qqc2. It will also use qqc2 in other places where it makes sense, like replacing a TextEdit with a qqc2 TextArea, and Text components with qqc2 Labels. Task-number: QTBUG-95733 Change-Id: Ic733cd592cd10ef2cf45058aaf08a0f6b2f5bd2c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit dad9a15c9c5734334e6e3768eab096968515e36f) 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>
* Fix coding styleOliver Eftevaag2021-09-011-5/+5
| | | | | | | Change-Id: Icfcdcb306dbeb750c8ebad44b431c5364ef63c44 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 621e583f0587d3ed7d729958b2ab9bf3973af4e0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Convert dynamicview tutorial to use QML modulesUlf Hermann2021-08-3114-8/+203
| | | | | | | Change-Id: I98069eea1bd4492aba661e4672ffe297f0dcc4c8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit c10427bc040c6a8dd9d56f0c56175935d1230486) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix shadereffects example to use a QML moduleUlf Hermann2021-08-311-17/+13
| | | | | | | | | Change-Id: I3787fdfebfa1e376c2891f16f3fcf4f29f0e26d4 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 255d8a84b35d296febc5c81b193c8ab2984ae1a1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix samegame example to use QML modulesUlf Hermann2021-08-3147-60/+273
| | | | | | | | | | | | | | | | | | | | | | In this case it really makes no sense to use a shared directory because we want to show the progressive changes between the different versions. It's actually important to note that we're adding the pictures one by one. Therefore, the shared directory is dissolved and the pictures added duplicated into the respective versions of samegame. Furthermore, moving the code into a "content" directory is a bad idea because it complicates the import logic. We don't want to make the "content" directory its own QML module. We might move samegame.qml into the "content" directory, too, and apply some path wrangling to make it work, but it's really not worth it here. Change-Id: Ifc45f48832596377c21bc6ef55e918ef487bc94e Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit a3ea7a99381748c457336bfa8b9373070ebfa3ee) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* DynamicView4 tutorial: add forgotten file to qrcOliver Eftevaag2021-08-311-0/+1
| | | | | | | | | | | | The FileSelector.qml component for some reason were never added to the qrc file, which meant that it didn't exist in the eyes of qmake. It should now be possible to run the program. Change-Id: Iaab67860123e926456c99b775449648f5d8e7c3c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 71a781beb172c0c1e2653684e76cc51114b086f9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove .prev_CMakeLists.txtUlf Hermann2021-08-319-403/+0
| | | | | | | | | We don't need to use pro2cmake anymore here. Change-Id: Iba8bac70c1fe31e56bf9680608913cc2c336f946 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 405bbc1c0e12e888807ff458c6df600968420e83) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: qmake: Fix chapter6-plugins example to build in more configsAlexandru Croitor2021-08-313-30/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, I tested the following configurations / scenarios (1) shared Qt + qmake + macOS bundle -> works (2) shared Qt + CMake + macOS bundle -> broken (3) static Qt + qmake + macOS bundle -> broken (4) static Qt + CMake + macOS bundle -> works (2) was broken because the shared qml plugin is not located in the expected location (see below) (3) was broken because qmake needs a lot of error-prone boilerplate to ensure static qml plugin building and linking works. The change fixes the example to build and run successfully in case (2). Tested the following scenarios on macOS with the change shared Qt + qmake + macOS bundle -> works shared Qt + CMake + macOS bundle -> works shared Qt + qmake + no bundle -> works shared Qt + CMake + no bundle -> works static Qt + qmake -> still broken static Qt + CMake -> works To make shared qml plugins be found in a macOS bundle, we need to copy the qmldir and plugin under the bundle's PlugIns subfolder, because the application adds that as the expected qml import path for macOS. This basically mimics what the qmake project does with QMAKE_BUNDLE_DATA. The change also cleans up the CMake projects a bit so they don't link PUBLIC-ly against dependencies, install the plugin under a more sensible location and don't needlessly setup package finding and other boilerplate that's done in the parent project. The change also cleans up the qmake projects to adjust to not pollute the macos bundle dir with static plugin files. Amends 9e1d2a0eb15487f8f2acb4d91b281568897fb4e1 Change-Id: I45bb699a67adf598587350a03f778291fad3f850 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 9cbf4d2cc85723dadadadb5fe1ade9719dfeb2a6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update views example to use modulesUlf Hermann2021-08-306-89/+66
| | | | | | | | | | | The qmake and qmlproject files are adapted to use the "shared" module, too. Change-Id: I5fc4895416357ba202528b155581b1b5a880a68d Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit cb9cc7ca66ab7f901b4032ed3e8f5cea3ba9e469) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix touchinteraction example to use QML modulesUlf Hermann2021-08-3024-85/+55
| | | | | | | | | | Remove the "content" subdirectories. They just add noise. Change-Id: Iae6bf7d91b6804294673be8966e30b11caae0654 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 76a413bb11dd444239d3e0ae5fc86a3021d53409) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix the qtquick/window example to use QML modulesUlf Hermann2021-08-307-52/+143
| | | | | | | | | | | | | The shared code becomes its own module. Due to the ${PROJECT_NAME} trick it should be possible to include it multiple times, in different examples. Change-Id: I78cc3211f67fae9a713320fae4041898e6a397ed Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit 7b6eea37aeea55cdf1bcb1fd9c3091d6753f95e8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update the accessibility example to use QML modulesUlf Hermann2021-08-306-19/+12
| | | | | | | | Change-Id: Iec3dad42dd08ac230ffde15b422ae7f68d419e81 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> (cherry picked from commit 9cb0b528e34271ca5bfe4dea214e83bcb4c91da1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Shapes example: use qqc2 componentsOliver Eftevaag2021-08-2825-122/+134
| | | | | | | | | | Changing the example to use qt quick controls where it makes sense Task-number: QTBUG-95739 Change-Id: Id0df227657693234de4481c2316dc6c3e0545043 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 5ae40afa970731ce976323f1a912b46bdff325d0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* ShaderEffects example: replace custom slider with qqc2Oliver Eftevaag2021-08-284-108/+12
| | | | | | | | | | Replacing a custom made slider component with a qqc2 slider. Task-number: QTBUG-95738 Change-Id: I407307a3769a0c9821d311189ed40b0d48dab4d3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 9e38f4da96ce294194c497e76b001298fe557f2d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Migrate to fixed add_shaders prefix handlingLaszlo Agocs2021-08-273-3/+3
| | | | | | Change-Id: I6c5b0680d32bc3650983c64cc4583f790774da88 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove deprecation warning from QtQuickControls2 gallery exampleLuca Di Sera2021-08-261-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the "Delegates" page of the gallery example the user is allowed to swipe over the available `SwipeDelegateComponent`s to show a 'remove' button, which allows the removal of that item from the containing list when pressed. When this happens, an animation is played. In the code, the animation was attached to the signal handler, as follows: ``` ListView.onRemove: SequentialAnimation { ... } ``` This form of attachment has been deprecated as of Qt 6.1.0, in commit 6eb35df60e, in favor of creating a stand-alone object and calling the relevant slot from the signal handler, generating a series of warning when the attachment happens during the creation of the page. This patch updates the connection to the new format, avoiding the generation of the warnings. Fixes: QTBUG-95562 Change-Id: Ib67cb9b8703dad427c49475c00791fdd5d1b0669 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 6901fb779a750949e0c436ff2fbfc15d0aae6319) Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Use add_shaders with CMake in some examplesLaszlo Agocs2021-08-255-111/+41
| | | | | | | | | | | | | | | | | | | | | Take the most obvious candidates, to which users typically turn when getting started with ShaderEffect or QSGMaterial: shadereffects scenegraph/custommaterial scenegraph/twotextureproviders As with the parent patch that ports and updates embeddedinwidgets and quickwidget/qquickviewcomparison to use the proper CMake machinery, we still need to keep the .qsb files for the sake of qmake. compile.bat and similar scripts are however removed now. With CMake the .qsb files are not needed and are autogenerated at build time. Once qmake support disappears from the examples, the .qsb files can be removed as well. Change-Id: I879354eef2e2179dcd268c9ae9f1402e1eaef379 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 266b93c9f8e7054ec572e47a8c48752381851231) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Port leftover effects in some of the examplesLaszlo Agocs2021-08-2510-26/+67
| | | | | | | | | For qmake we have no choice but to ship the .qsb files, whereas with CMake we now rely on qt6_add_shaders. Change-Id: I9bb64a3ffd01cda84fca5a0f7def270975bf71aa Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit c7093e553c46bbd65a053a335bd27bec8ee5aca2)
* Update quick examples to new QML CMake APICraig Scott2021-08-2520-485/+166
| | | | | | | | | | | | | This is a pre-requisite to being able to make qt6_qml_type_registration() an internal rather than public command. Not all examples have been updated, only those that were using the qt6_qml_type_registration() command. Task-number: QTBUG-95093 Change-Id: I3f1814a29af608461daa90477eca0aa2304eb9d1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit a86fd709dd4d315cfe4fea77ea0bc730131fe840) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update qml examples for improved target path handlingCraig Scott2021-08-2532-416/+121
| | | | | | | | | | | | | Some examples were still using the old "add as ordinary resources" approach for QML modules, others needed adjustment to the subdirectory structure to better reflect the URI structure of the QML modules involved. Task-number: QTBUG-95144 Change-Id: Ie3399410cf6df491eb1e7b4a589ca26c577d82a0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 9e1d2a0eb15487f8f2acb4d91b281568897fb4e1)
* Use qEnvironmentVariableIntValue() instead of qgetenv().toInt()Shawn Rutledge2021-08-171-2/+2
| | | | | | | | | The docs tell us that it's faster. Change-Id: Ib828ed9a10bbb617670a61e7525cbbe25704815d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit ca89437d00aeb8916738a964a62aef3cff7dc5ab) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Raise cmake_minimum_required to VERSION 3.16 in examplesJoerg Bornemann2021-08-1789-89/+89
| | | | | | | | Task-number: QTBUG-95636 Change-Id: I9f76b787533dad1c469fbb8c69df6c27b20a9aa3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit b4ab58d791167329259f5403e52ce6c85b5f0074) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>