aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/tutorials
Commit message (Collapse)AuthorAgeFilesLines
* examples: Consistently require Qt 6.8Fabian Kosmale2024-07-038-8/+8
| | | | | | | | | | | | This prevents policy warnings in a few cases, and we want people to opt-in to new policies, so make our examples copy'n'paste friendly. Pick-to: 6.8 Task-number: QTBUG-126201 Task-number: QTBUG-126468 Change-Id: Iefa666b61c2d2f767da3583f0f6efd8e4a2169e5 Reviewed-by: Ulf Hermann <[email protected]> Reviewed-by: Olivier De Cannière <[email protected]>
* CMake: Add deployment API to our examplesAlexandru Croitor2024-03-278-72/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Projects were modified using the tool at: https://git.qt.io/alcroito/cmake_refactor A few examples had to be adapted manually, mostly those that build additional qml modules / plugins. The INSTALL_EXAMPLESDIR and INSTALL_EXAMPLEDIR assignments were removed, these are not needed anymore because example directory selection is handled by the qt_internal_add_example calls. The install(TARGETS) calls were modified according to our documentation snippets for qt_generate_deploy_qml_app_script. A qt_generate_deploy_qml_app_script call was added for each executable target. Note that the deployment step will be skipped in the CI for now, because: - we enable QT_DEPLOY_MINIMAL_EXAMPLES in the CI instructions and thus set QT_INTERNAL_SKIP_DEPLOYMENT to true - standalone examples feature is not yet enabled in the CI, which means we continue to build examples in-tree, and deployment is disabled for in-tree prefix builds. A small list of examples to deploy in the CI will be chosen in the future, to ensure deployment coverage, without slowing down overall CI times due to all the *deployqt invocations. Even if deployment is disabled in the CI, the install(TARGETS) calls for each example will still run, installing into an 'installed_examples' directory, which will not be archived by the CI. The QtBundleQmlModuleForMacOS and bundle_shared code was removed, because we can now depend on the MACOS_BUNDLE_POST_BUILD option of the deployment api, to ensure macOS bundle examples run properly in the build dir. This works even in prefix in-tree builds, when installation deployment is disabled. Finally, for all examples that build additional qml module libraries or plugins, the libraries / plugins must be installed into the bin dir of each project, along with a qmldir file. This is to support running the installed project for platforms that don't have deployment api yet, like boot2qt / yocto. If we want to have super clean install / deployment rules in the future, we won't be able to avoid adding ugly per-platform conditions. The current status quo is deemed an improvement over what we had before. Pick-to: 6.7 Task-number: QTBUG-101340 Task-number: QTBUG-102056 Task-number: QTBUG-102057 Change-Id: I843d934668c25dbcd1abca52495b393579633fc5 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Alexey Edelev <[email protected]>
* Correct license for examples filesLucie Gérard2024-03-2110-10/+10
| | | | | | | | | | | | | Example takes precedent over build system file type. According to QUIP-18 [1], all examples file should be LicenseRef-Qt-Commercial OR BSD-3-Clause [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 6.7.0 Task-number: QTBUG-121787 Change-Id: Ie8c2539e7659f53a1fd6b48f99ee883ee9aeb0a7 Reviewed-by: Kai Köhne <[email protected]>
* Fix duplicate HighScore when replaying SameGame ExampleWladimir Leuschner2024-03-121-4/+7
| | | | | | | | | | | | | | | | | The onClosed slot invokes SameGame.saveHighscore function in samegame.js. Also the startNewGame function in samegame.js is triggering the SameGame.saveHighscore function by calling Dialog.hide, which in turn calls the onClosed slot. This leads to duplicate highscore entries. Moving the closing of the dialog after the clearing of the board/score and additionally adding a condition that if the score is 0, no highscores are saved, the duplication is avoided. Fixes: QTBUG-119812 Pick-to: 6.7 6.6 Change-Id: I6aa433789f197a0d1e70abc82baf893934e53be5 Reviewed-by: Ulf Hermann <[email protected]> Reviewed-by: Oliver Wolff <[email protected]>
* Examples: Use versioned CMake targets for Qt modulesKai Köhne2023-05-028-32/+32
| | | | | | | | | | | | Use e.g. Qt6::Core instead of Qt::Core. This is better matching the find_package(Qt6 ...) call, and also avoids issues that the versionless targets have. Pick-to: 6.5 Task-number: QTBUG-113277 Change-Id: Ib80f885e9f73fb9ad54b9e9b22cae2318877dc07 Reviewed-by: Alexey Edelev <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* Dynamicview example: Update by coding conventions from official docBumjoon Park2023-03-209-173/+279
| | | | | | | | | | | - Fix qmllint warning. - Fix runtime warning. - string are translated. - JS statements no longer end with semi-colon. Pick-to: 6.5 6.5.0 Change-Id: I33958c414537aff32814f4ef2f04c73a03dc5295 Reviewed-by: Mitch Curtis <[email protected]>
* Replace AUTO_RESOURCE_PREFIX with Qt CMake Policy in examples, testsAmir Masoud Abdol2023-02-218-8/+16
| | | | | | | | | | | | | | | | Every instance of AUTO_RESOURCE_PREFIX has been replaced by either qt_standard_project_setup(REQUIRES 6.5) or with qt_policy(SET QTP0001 NEW), mainly in tests. In addition, I added a warning message for the case where AUTO_RESOURCE_PREFIX is used. Pick-to: 6.5 Task-number: QTBUG-96233 Change-Id: I323a15e9d0bb5fe6ba649365314af9fc2ad67bda Reviewed-by: Alexandru Croitor <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Oliver Eftevaag <[email protected]>
* CMake: Allow omitting the version of QML modulesUlf Hermann2023-01-278-8/+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 <[email protected]> Reviewed-by: Alexey Edelev <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Sami Shalayel <[email protected]>
* 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 <[email protected]>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-09-0710-10/+10
| | | | | | | Task-number: QTBUG-105718 Change-Id: Id89ed14990804a5024183e75382cc539d4293da1 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Jörg Bornemann <[email protected]>
* Examples: Do not use import version numbers anymoreKai Köhne2022-08-3127-30/+30
| | | | | | | | Pick-to: 6.4 Change-Id: I1f4d4920bb9d132a846ac2dbcfdb8b660759d540 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Ulf Hermann <[email protected]>
* Add license headers to cmake filesLucie Gérard2022-07-0810-0/+30
| | | | | | | | | | | | 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 <[email protected]>
* Adapt examples to AUTO_RESOURCE_PREFIXUlf Hermann2022-06-2416-8/+16
| | | | | | | | | | | 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 <[email protected]> Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Sami Shalayel <[email protected]>
* Use SPDX license identifiersLucie Gérard2022-06-1135-1715/+70
| | | | | | | | | | | | 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 <[email protected]>
* Improve examples CMakeLists.txtKai Köhne2022-01-248-64/+24
| | | | | | | | | | | | | | | | | | - 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 <[email protected]> Reviewed-by: Jörg Bornemann <[email protected]>
* Switch examples to build as isolated sub-buildsAlexandru Croitor2021-12-162-8/+8
| | | | | | | Pick-to: 6.2 6.3 Task-number: QTBUG-90820 Change-Id: I7fab73f63a22901ab2d4d4e57b5a25b433100de5 Reviewed-by: Alexey Edelev <[email protected]>
* Update examples to use new PropertyChangesUlf Hermann2021-11-032-3/+9
| | | | | | | | Also, prefer the multi-line syntax over ';'-separated bindings for readability. Change-Id: I3d6eb854e514ee257ca83773a11e6e9e10770bff Reviewed-by: Mitch Curtis <[email protected]>
* Convert dynamicview tutorial to use QML modulesUlf Hermann2021-08-3114-8/+203
| | | | | | Pick-to: 6.2 Change-Id: I98069eea1bd4492aba661e4672ffe297f0dcc4c8 Reviewed-by: Shawn Rutledge <[email protected]>
* 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. Pick-to: 6.2 Change-Id: Iaab67860123e926456c99b775449648f5d8e7c3c Reviewed-by: Mitch Curtis <[email protected]>
* 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. Pick-to: 6.2 Change-Id: Ifc45f48832596377c21bc6ef55e918ef487bc94e Reviewed-by: Andrei Golubev <[email protected]> Reviewed-by: Mitch Curtis <[email protected]> Reviewed-by: Shawn Rutledge <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* examples: samegame4/BoomBlock.qml: Do not use unqualified accessMaximilian Goldstein2021-04-301-7/+7
| | | | | Change-Id: I6e7d6b82605271478bfba9ff614f5748b58fffb7 Reviewed-by: Fabian Kosmale <[email protected]>
* Use functions as signal handlers when accessing parametersUlf Hermann2021-02-124-4/+5
| | | | | | | | | Injected signal handlers are bad practice because they aren't declared. Pick-to: 6.1 Task-number: QTBUG-89943 Change-Id: I3a691f68342a199bd63034637aa7ed438e3a037b Reviewed-by: Fabian Kosmale <[email protected]>
* Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-1225-0/+561
|\ | | | | | | | | | | | | | | Conflicts: dependencies.yaml src/qml/qml/qqmlengine.cpp Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
| * Examples: Add *.pro projects for existing *.qmlprojectAssam Boudjelthia2020-03-0425-0/+561
| | | | | | | | | | | | | | | | | | The *.qmlproject won't deploy and run on Android, thus adding normal .pro projects to allow deploying to Android. Task-number: QTBUG-80717 Change-Id: I8a79a56bec57add315c08088a2fca5995df76912 Reviewed-by: Ulf Hermann <[email protected]>
* | Convert ExamplesLeander Beernaert2019-08-231-0/+2
|/ | | | | | | | This patch converts all examples in qtdeclarative except for a few exceptions which require a public facing qml plugin api. Change-Id: I2cd2b1bb455be8b48796893a8235dea7f8b35aa2 Reviewed-by: Alexandru Croitor <[email protected]>
* Fix docs to explain the new type syntax for QML methodsSimon Hausmann2019-07-101-1/+1
| | | | | | | | | | | | | | [ChangeLog][QtQml] It is now possible to specify types for method parameters and their return value in QML (basic and object types), using TypeScript-like syntax with a colon separator. The syntax for QML declared signals supports the same style. This change also adapts the remaining snippets and docs to the "fresher" qml signal parameter syntax. Change-Id: I601781f01f696276951b04785584adab39fedfd9 Reviewed-by: Shawn Rutledge <[email protected]> Reviewed-by: Ulf Hermann <[email protected]>
* Remove old 'Getting started with Qt Quick' exampleKai Koehne2018-10-1522-1785/+0
| | | | | | | | | | | The example is actually not very easy to build, and arguably too complex for a 'getting started' example. qtdoc commit 1df7011858 therefore replaced it by the alarms example in the documentation. Task-number: QTBUG-66064 Change-Id: I2f2776c649410575aef71948f64b358d60233022 Reviewed-by: Mitch Curtis <[email protected]> Reviewed-by: Nico Vertriest <[email protected]>
* Replace more vestiges of VisualDataModel, *Group and VisualItemModelShawn Rutledge2018-10-031-1/+1
| | | | | | | | | | | | VisualDataModel, VisualDataGroup, and VisualItemModel are replaced with DelegateModel, DelegateModelGroup, and ObjectModel respectively (since 7cad0e52c5a020bd29635e9912fd8946a6b48124), so shouldn't be mentioned anymore, in preparation for removal. Task-number: QTBUG-37725 Change-Id: I9a01ec8db748f817efca638383b7a278c7b562cd Reviewed-by: Mitch Curtis <[email protected]> Reviewed-by: Venugopal Shivashankar <[email protected]>
* Fix outdated BSD license headerKai Koehne2017-10-1740-120/+520
| | | | | Change-Id: Icc08925454445fc9497fb3bfd2c26efe90605983 Reviewed-by: Jani Heikkinen <[email protected]>
* actually build and install the qml tutorialsOswald Buddenhagen2016-05-132-1/+4
| | | | | | Change-Id: Idf81981140e210b29239e91ff5b6b7c40e2f36de Reviewed-by: Topi Reiniö <[email protected]> Reviewed-by: Simon Hausmann <[email protected]>
* make use of COPIESOswald Buddenhagen2016-05-131-2/+3
| | | | | Change-Id: I479c9523a89be1d64364e8205daa5860e16882cc Reviewed-by: Simon Hausmann <[email protected]>
* Purge sRGB chunks from PNGs in examples.Edward Welbourne2016-03-244-0/+0
| | | | | | | | | | | | Subjects each *.png file that matched grep -law "sRGB" to: pngcrush -ow -brute -rem allb -reduce Various tools grumble about sRGB tables in PNG images; and our handling of them doesn't pay attention to these, so purging them makes the images smaller with no loss to the images. Change-Id: If3baf60fb7c0045446ddfddecef96374845e739e Reviewed-by: Topi Reiniö <[email protected]>
* Purge spurious execute permissions.Edward Welbourne2015-09-301-0/+0
| | | | | | | | JavaScript, README and QML are not meant to be run from the shell. Change-Id: Ia1ddf621e2e341639daac651e2b4954364407574 Reviewed-by: Frederik Gladhorn <[email protected]> Reviewed-by: Simon Hausmann <[email protected]>
* Fixed license headersJani Heikkinen2015-02-1740-120/+120
| | | | | Change-Id: I4d5640ff95e1361ec7e65fb3e87d7726d8185ff5 Reviewed-by: Sergio Ahumada <[email protected]>
* Update copyright headersJani Heikkinen2015-02-1240-200/+200
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <[email protected]>
* Fix permissions of filesKai Koehne2014-12-023-0/+0
| | | | | Change-Id: I22958892d846da348325ba608084f8d9a05473d4 Reviewed-by: Simon Hausmann <[email protected]>
* fix copying of qmldir file to build dirOswald Buddenhagen2014-05-051-10/+2
| | | | | | Task-number: QTBUG-36252 Change-Id: Icbd956daf707105a5616d057c11b9aa1f55ff5d2 Reviewed-by: Alan Alpert <[email protected]>
* Change slashes depending on host in tutorial gettingStartedQml.Friedemann Kleint2014-04-151-1/+1
| | | | | | Task-number: QTBUG-38224 Change-Id: Ib2c14b88bd86f2c1254be716a9fa4f93143bbd0a Reviewed-by: Oswald Buddenhagen <[email protected]>
* fix whitespaceOswald Buddenhagen2014-01-225-7/+7
| | | | | | | remove trailing spaces and expand tabs Change-Id: Ieacb9d096b612c45d1a64700044c114d1f7522bc Reviewed-by: Simon Hausmann <[email protected]>
* Doc: Update example used for QML getting started tutorialTopi Reinio2013-08-0916-268/+353
| | | | | | | | | | | | | | | Update the example project referred to in Getting Started with Qt Quick tutorial. - Fix coding/comment style issues - Change plugin TARGET name, Use /imports as the destination directory - Fix qmldir with proper module info, delete unused qmldir from /core - Add a .qmlproject file Change-Id: If269e61fb76399faae753469dc251d07cc219139 Reviewed-by: Jerome Pasion <[email protected]>
* Doc: Remove unused /parts directory from QML getting started exampleTopi Reinio2013-08-0256-3718/+0
| | | | | | | | | | | | The example code for getting started with QML doc has six smaller projects under /parts - these out of sync with the main example code in its parent directory, they are undocumented and not referred to in any other documentation. The QML getting started guide itself uses \code blocks to present the code snippets. Change-Id: I3b9c83a60fdeb9fa13f364b04c38943222c682cb Reviewed-by: Alan Alpert <[email protected]> Reviewed-by: Jerome Pasion <[email protected]>
* Doc: Move example docs related to QtQml under the correct moduleTopi Reinio2013-05-0339-2239/+0
| | | | | | | | | | | This change moves 'Extending QML' qdoc file and the tutorials from examples/quick to examples/qml, which is the correct location for them. Change-Id: I24bd9dfa75baaab7bc8efe08489f09a7b65d98a6 Reviewed-by: Jerome Pasion <[email protected]> Reviewed-by: Sze Howe Koh <[email protected]> Reviewed-by: Alan Alpert <[email protected]>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-03-141-5/+5
|\ | | | | | | | | | | | | Conflicts: tests/auto/qml/debugger/qv8profilerservice/qv8profilerservice.pro Change-Id: I2fd99ed8bd03302b9bbf31e6f21990f6455c4f1c
| * Fixed tutorial gettingStartedQml part5.Libor Tomsik2013-03-131-5/+5
| | | | | | | | | | | | | | In FileDialog.qml the selector GridView.view.currentIndex does not work, replaced with dirView.currentIndex Change-Id: I7c1893ce3872c41fc4f0fd63bad0e6a2cff2b207 Reviewed-by: Jerome Pasion <[email protected]>
* | Add QtQml.Models moduleAlan Alpert2013-03-127-11/+18
|/ | | | | | | | | | | The moved Model classes can now be exposed in a QtQml import. To keep the QtQml import resticted to more core functionality, they are being exposed in a plugin module. Change-Id: I0a84642a72c7c9bbf9b6ffd2a6c33549f8e61c29 Reviewed-by: Alan Alpert <[email protected]> Reviewed-by: Lars Knoll <[email protected]>
* Doc: Fix paths and add missing project files for QML and Quick examplesTopi Reinio2013-02-204-0/+64
| | | | | | | | | | This change fixes a number of 'example path does not exist' warnings from qdoc, and adds .qmlproject files for pure qml examples so they'll appear correctly in the example manifest files. Change-Id: Id0a424c4826fb5d8ebe6c3309bf33b976ff8477c Reviewed-by: Geir Vattekar <[email protected]> Reviewed-by: Jerome Pasion <[email protected]>
* Fix extending example.Gunnar Sletta2013-02-128-15/+14
| | | | | | | | The antialiasing was broken due to wrong flag being used and that the bounds were outside the texture and chapter 5 and 6 did not compile. Change-Id: Ib7c4d8c276a3cc5583ff794e10ff539720857e0c Reviewed-by: Samuel Rødal <[email protected]>
* Merge branch 'release' into stableSergio Ahumada2013-01-312-4/+1
|\ | | | | | | Change-Id: Ic270f7814489b2c7df7e0f1ecb46cd516802cac5
| * Remove outdated macro usageChristian Stenger2013-01-242-4/+1
| | | | | | | | | | | | Change-Id: I4b58f3d74d7dec9a95a07b907c500990630e7762 Reviewed-by: Jerome Pasion <[email protected]> Reviewed-by: Kai Koehne <[email protected]>
* | Update copyright year in Digia's license headersSergio Ahumada2013-01-10106-106/+106
|/ | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <[email protected]> Reviewed-by: Sergio Ahumada <[email protected]>