summaryrefslogtreecommitdiff
path: root/examples/qml
Commit message (Collapse)AuthorAgeFilesLines
* Examples: Move Qml plugin example to manual testsOlivier De Cannière2023-05-1217-375/+0
| | | | | | | | | Outdated documention has been removed. Task-number: QTBUG-111036 Change-Id: I8db138ff71615a6ed6ac4cebdb365c27252fa5ee Pick-to: 6.5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Examples: Add equality an operator to Extending Qml Advanced tutorialsOlivier De Cannière2023-05-048-4/+84
| | | | | | | | | | | | This allows for more meaningful checks for identical assignment in Person::setShoe(). Amends: 405bd4299819e39397cea0090a9442fd4b6ce911 Pick-to: 6.5 Change-Id: Id731f3f9163fb311ff9b04e2bbf4786a3022a11b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Examples: Use versioned CMake targets for Qt modulesKai Köhne2023-05-0221-65/+65
| | | | | | | | | | | | 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 <alexey.edelev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Doc: Revamp "Extending QML" examples into a tutorialOlivier De Cannière2023-03-30147-2659/+2157
| | | | | | | | | | | | | | | | | | | | | | | | The examples in the "Extending QML" series were often redundant with the information of the "Writing QML Extensions with C++" tutorial, had outdated code and sometimes had no documentation. The examples that covered topics not mentioned in the first tutorial were revamped into a second "advanced" tutorial extending the first one. The others were removed. The remaining examples were largely based on the same example code of a birthday party. This code was slightly adapted and separated into 7 states, each building upon the previous, with the code change illustrating the associated feature. A tutorial page, in the style of the first one, was added documenting the different QML features and the required code changes in the example project. Links in the documentation from and to the affected pages were update as best as possible. Pick-to: 6.5 Fixes: QTBUG-111033 Change-Id: I9d97e8b32b128c1624d67525996fa14d493909d3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove DomItem::loadFile code-duplication and use correct environmentsSami Shalayel2023-03-291-0/+4
| | | | | | | | | | | | | | | | | | The loadFile overload (in DomItem, DomEnvironment and DomUnivers) for different files (in-memory files and files that needs to be loaded from disk) are either copypasted or just calling the other overload. Encapsulate the file-related arguments of all loadFile overloads into a new struct called FileToLoad, such that the copypasted overloads can be removed. Use the static factory function FileToLoad::fromMemory and FileToLoad::fromFileSystem to create the FileToLoad struct. In addition, FileToLoad allows to specify the environment in which a file should be loaded. Prior this commit, myEnv.loadFile() was creating a new environment for each loaded file. Change-Id: I3b6acb681cb77faefdaa447d985bdfbe4f6a9ce2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* examples: Remove shell exampleFabian Kosmale2023-03-105-175/+1
| | | | | | | | | | | | | We did not document it anywhere, the code is rather dated, and if we want to promote QML as a scripting engine/an interpreter, we would need to invest quite a bit more effort into a showcase. Thus, remove the example for now. Pick-to: 6.5 Task-number: QTBUG-110649 Change-Id: Ie23b26379e7ea72271d793a6928a3757cde2cb12 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Convert XMLHttpRequest example to a snippet and add doc pageOliver Eftevaag2023-03-0312-199/+1
| | | | | | | | | | | | | The XmlHttpRequest is poorly documented, and should have its own documentation page, instead of being part of the qml global object page. The XmlHttpRequest example might as well be converted to a snippet, that can be present on the new doc page. Fixes: QTBUG-110003 Pick-to: 6.5 6.5.0 Change-Id: I0ffee43046d4fb71e64f04008b444e11dc8b21ff Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* NetworkAccessManagerFactory: Complete documentation page with snippetsOlivier De Cannière2023-03-039-199/+1
| | | | | | | Pick-to: 6.5 6.5.0 Fixes: QTBUG-110657 Change-Id: I063eb4ac25cbe226b5a996014042515d6ada5468 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmldom: link qmldomloadeditwrite example to non-standalone qmldomSami Shalayel2023-03-022-9/+7
| | | | | | | | | | | | | Instead of linking the example to a standalone build, link it directly to a normal (=non-standalone) Qt qmldom library. Link the qmldomloadeditwrite example to the qmldom library (instead of including the qmldom library as a subfolder in the CMakeLists.txt) and fix the includes to point to <QtQmlDom/private/<headers>_p.h>. Change-Id: I6f20ac51199d89b4b3ca03b34e090ac6e495715f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Replace AUTO_RESOURCE_PREFIX with Qt CMake Policy in examples, testsAmir Masoud Abdol2023-02-213-3/+6
| | | | | | | | | | | | | | | | 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 <alexandru.croitor@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@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>
* qt_add_qml_module: Make usage of AUTO_RESOURCE_PREFIX a policyFabian Kosmale2023-02-011-0/+1
| | | | | | | | | | | | | | | | 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-2723-23/+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>
* 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>
* 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>
* 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>
* 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>
* Fix signals in QML extended exampleJoni Poikelin2022-09-131-8/+20
| | | | | Change-Id: I03afea816e6935af7f32f38caf736f60e351d87a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-09-0729-29/+29
| | | | | | | Task-number: QTBUG-105718 Change-Id: Id89ed14990804a5024183e75382cc539d4293da1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Examples: Do not use import version numbers anymoreKai Köhne2022-08-3123-36/+36
| | | | | | | | Pick-to: 6.4 Change-Id: I1f4d4920bb9d132a846ac2dbcfdb8b660759d540 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* examples: deploy qmldir for plugin exampleSamuli Piippo2022-08-311-0/+2
| | | | | | | | We need to deploy qmldir to make the example work also for remote targets. Pick-to: 6.4 6.3 6.2 Change-Id: Id0b7bf4a48bd163ddf5e44a5a68ca3edbbcc008e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add license headers to cmake filesLucie Gérard2022-07-0829-0/+87
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I72c89a98c42bbc9234d8495e9e503bec81d11037 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Adapt examples to AUTO_RESOURCE_PREFIXUlf Hermann2022-06-246-3/+6
| | | | | | | | | | | Examples that don't explicitly set NO_RESOURCE_TARGET_PATH get the AUTO_RESOURCE_PREFIX now. Task-number: QTBUG-103452 Change-Id: I6b41e96ce5620079f60ca2f967b0a2e611c1f738 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-11124-5938/+248
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Examples: Replace qt-5 urlsKai Köhne2022-06-051-1/+1
| | | | | | Pick-to: 6.3 Change-Id: Ifec0960bfb3f179e2cf5ff5e7f11364b106a86e3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Doc: Rename snippet id to a unique identifierAndreas Eliasson2022-06-022-4/+3
| | | | | | | | | | The header file has two snippets with the same id. Rename to unique values and link to the correct snippet id from the qdoc file. Fixes: QTWEBSITE-1051 Pick-to: 6.3 Change-Id: I9003916f831898026f520fd86d60ab1c0230e6c4 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Fix URI of i18n exampleUlf Hermann2022-06-021-1/+1
| | | | | | | | It shouldn't be "dynamicscene" as that URI is already used by a different example. Change-Id: I35ac6b7ea70703f24304f640252f922d6a5b2371 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Add CMake sections to 'Creating C++ Plugins for QML' pageAndreas Eliasson2022-05-042-7/+36
| | | | | | | | | | | | - Revise grammar - Fix so that example project can be built from the command line using CMake - Add tabs on example page Pick-to: 6.3 Task-number: QTBUG-102330 Change-Id: Ic6bdcadec66850f5e811dcaac23a8cb59a6c3f94 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Doc: Add CMake documentation to 'Extending QML' exampleAndreas Eliasson2022-04-252-6/+6
| | | | | | | | Fixes: QTBUG-102085 Pick-to: 6.3 Change-Id: I8f79a00b9ef827f229a94bc840b1951c8f67e4a2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* qmldom: Fix standalone compilation against Qt 6.3.0Fawzi Mohamed2022-04-221-1/+1
| | | | | Change-Id: I402eeeab1cd6f5e02d5f49eedbd01010de39d05a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add VERBATIM option to add_custom_command callsAlexey Edelev2022-03-311-0/+1
| | | | | | | | | | | Use VERBATIM option to prepare the correct command line for the add_custom_command. This especially sensitive when using build directories with names containing special symbols, that cannot be handled by shell correctly. Change-Id: Ic6ea2a557fe4e7ccc1d2a0c5c4ab707223c0b91a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add cmake support for examplesFabian Kosmale2022-03-292-1/+48
| | | | | | | | | | | | | | qml-i18n needed to be ported to CMake first. It uses qt_add_translations introduced in 6.2 As a drive-by, move find_package calls from examples' CML to the top level CML, and make the QtSql dependency optional. Also make sure that we only add the dynamicscene example when the Quick target is available. Pick-to: 6.2 6.3 Fixes: QTBUG-90964 Change-Id: Id357eb14e4704753386e01393300966eb89b4e86 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Improve examples CMakeLists.txtKai Köhne2022-01-2427-222/+88
| | | | | | | | | | | | | | | | | | - Remove # generated from xyz.pro comment from pro2cmake - Remove "# special case" markers for pro2cmake - Remove automatic use of CMAKE_AUTORCC - Only opt into CMAKE_AUTOUIC if .ui files are involved - Remove explicit setting of CMAKE_INCLUDE_CURRENT_DIR - Combine multiple find_package(Qt6 ... calls) - use REQUIRED COMPONENTS - sort components alphabetically - Fix wrong indentations - Use (only) one empty line after multi-line commands Pick-to: 6.3 Change-Id: I0d6bfb06c4b25e9921d3d2bf31d977150f12b31b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Rename "Basic Types" to "Value Types"Ulf Hermann2022-01-211-1/+1
| | | | | | | | | | Internally they've been called "value types" all along. Now that we are adding the ability to define your own value types the "basic" name is not really fitting anymore. Value types can be quite complex. Change-Id: I5fb4abec1dd2f0bbf7fb7f08b02db0882490e983 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Switch examples to build as isolated sub-buildsAlexandru Croitor2021-12-161-1/+1
| | | | | | | Pick-to: 6.2 6.3 Task-number: QTBUG-90820 Change-Id: I7fab73f63a22901ab2d4d4e57b5a25b433100de5 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* qmldom: load and rewrite exampleFawzi Mohamed2021-12-072-0/+583
| | | | | | | | load and rewrite example using the standalone build of the dom and compiler libraries Change-Id: Ib7823712aea2164291c21b07956dcec734bc9542 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Polish the QML reference examplesFriedemann Kleint2021-11-0453-474/+285
| | | | | | | | | | | | | - Use member initialization, which allows for using constructors from the base classes - Use qsizetype for indexes - Use qInfo() instead of qWarning() for printing - Add spaces/fix formatting Pick-to: 6.2 Change-Id: Iebce1b810ce00f29395207d93303363b3b71e52e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Update examples to use new PropertyChangesUlf Hermann2021-11-031-3/+5
| | | | | | | | Also, prefer the multi-line syntax over ';'-separated bindings for readability. Change-Id: I3d6eb854e514ee257ca83773a11e6e9e10770bff Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* doc: Replace qmlscene with qmlShawn Rutledge2021-09-291-2/+2
| | | | | | | | | | We deprecated qmlscene in a9c93e2716a097c637515aded49a3308e257204b so we should stop recommending it in docs, too. Task-number: QTBUG-53219 Pick-to: 6.2 Change-Id: Ic729624a8ef849bd13f38087e20b5a410c5c5756 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix dynamicscene example to use a QML moduleUlf Hermann2021-09-0417-66/+47
| | | | | | Pick-to: 6.2 Change-Id: I23b87b8ca98721cebc0dc948f0c9bbf741af6cd5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* 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 Pick-to: 6.2 Change-Id: I9b062f4d7e942db4a2669a8c65f7488aa4a54740 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* 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 Pick-to: 6.2 Change-Id: I45bb699a67adf598587350a03f778291fad3f850 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix warnings/errors from changes to paths in chapter6-plugins exampleCraig Scott2021-08-311-2/+1
| | | | | | | Amends 2d2750efc3b5a97a5f1cf09b4265a26fcc393499 Change-Id: Iab27efb7359cfcea9274dcbbc7ac64b647d3e71b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Replace custom button component with QQC2 buttonsOliver Eftevaag2021-08-279-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 Pick-to: 6.2 Change-Id: Ic733cd592cd10ef2cf45058aaf08a0f6b2f5bd2c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Update qml examples for improved target path handlingCraig Scott2021-08-2432-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 Pick-to: 6.2 Change-Id: Ie3399410cf6df491eb1e7b4a589ca26c577d82a0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Raise cmake_minimum_required to VERSION 3.16 in examplesJoerg Bornemann2021-08-1722-22/+22
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-95636 Change-Id: I9f76b787533dad1c469fbb8c69df6c27b20a9aa3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Change the default of OUTPUT_DIRECTORY for qt6_add_qml_module()Craig Scott2021-07-203-2/+2
| | | | | | | | | | | | | | | | | | | | | | | The new default is now controlled via a new QT_QML_OUTPUT_DIRECTORY variable. If that isn't set, the fallback assumes the source directory structure follows the URI structure and uses ${CMAKE_CURRENT_BINARY_DIR} instead. This pattern means more projects will have working import paths for qmllint and possibly other tools out of the box. There should also be fewer cases where the OUTPUT_DIRECTORY option needs to be used in calls to qt6_add_qml_module(). The QT_QML_OUTPUT_DIRECTORY variable facilitates the scenario where QML modules might be distributed across different parts of the source directory hierarchy, but once collected under a common base point defined by QT_QML_OUTPUT_DIRECTORY, they form a coherent set of QML modules whose subdirectory structure below that base point follows their TARGET_PATH. Fixes: QTBUG-94164 Fixes: QTBUG-95081 Pick-to: 6.2 Change-Id: I82864c361a2b34f7f1484cdbda0d9b64b34b9950 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add missing "override" keywordsUlf Hermann2021-06-306-6/+6
| | | | | | | | Our examples should follow best practices. Change-Id: Ice90a818ae46e921b421e8d297806d8f7200294b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Do not call QGuiApplication::exec() on an instanceUlf Hermann2021-06-305-5/+5
| | | | | | | | It's a static method. It should be called statically. Change-Id: I15fc8948988b0a2c0a30f8699949e06c66d92fdf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Use nullptr rather than 0 for null pointersUlf Hermann2021-06-3010-10/+10
| | | | | | | Change-Id: I2921298ad2e04001bdee8824c56f01c203efb7d6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>