aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/snippets
Commit message (Collapse)AuthorAgeFilesLines
* Remove qml-i18n example in qtdeclarative repoAlexandru Croitor2025-10-311-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | The qml-i18n example and the qtdeclarative repo itself depend on the LinguistTools CMake package, which is not available while building qtdeclarative. This results in: - missing build coverage for the example - a cyclic dependency, because qtdeclarative depends on qttools (because of LinguistTools), and qttools depends on qtdeclarative (because of qdoc needs) - we try to find a module that will never be available, unless qtdeclarative is built together with qttools in a top-level build - in certain cases, if the top-level build fails early enough, the cyclic dependency causes reconfigurations to fail Remove the example, the lookup of LinguistTools, and the linguist doc references to avoid all these issues. Replace the qt_add_translations reference in the docs of the QQmlApplicationEngine class with a snippet copy. Pick-to: 6.8 6.10 Task-number: QTBUG-141465 Change-Id: Id88603a3753f53dfac9f350e981073effda15eb1 Reviewed-by: Masoud Jami <masoud.jami@qt.io>
* Doc: Remove misleading example about alias overridingUlf Hermann2025-09-301-25/+0
| | | | | | | | | | | Apparently the author wanted to show an alias overriding a property and still retain control over the property. This doesn't work and simply confuses any reader. Pick-to: 6.10 6.8 Change-Id: Id63708eb7623d4cd24a81135156b237d85f2ca74 Reviewed-by: Dmitrii Akshintsev <dmitrii.akshintsev@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Replace nokia.com logo URLs with something that works for nowShawn Rutledge2025-09-261-1/+1
| | | | | | | | | If only the qt.io website could be relied upon to have a Qt logo in the same path for eternity... Pick-to: 6.8 6.10 Change-Id: Ie221bd85152af42bdf36655083932ca8341c7d2a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Demonstrate finding some private modulesSze Howe Koh2025-08-161-0/+1
| | | | | | | | | | | | | | Explicitly finding a private module was not strictly required in Qt 6.9 and older. This patch adds a small demonstration to some snippets, to show how to find QmlPrivate/QuickPrivate. This might be helpful for users who're scratching their heads when their previously-working project now fails to build in Qt 6.10. Change-Id: Ia8a08d94ea65aa73a44c7a7610d28119582ebf0f Pick-to: 6.10 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* qmllint: Introduce UserContextPropertiesSami Shalayel2025-07-311-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Allow the user to specify context property names in .contextProperties.ini files so that they can disable all warnings or only the unqualified warning on their defined context properties by name. I remember some use cases where checking the .qmllint.ini into a users project repository is unwanted, so use a new setting file for the context properties that does not mess with global/system-wide .qmllint.ini files when checked into the repository. Create a new class called UserContextPropertiesSettings that is in charge of loading user context properties setting files, and use it inside of QQmlJSLinter. Introduce a ContextPropertyInfo class that contains both the heuristic information and the user-provided information. ContextPropertyInfo is used to pass the ContextProperty information down the type propagator. Also add some documentation for the new settings file. Task-number: QTBUG-138061 Task-number: QTBUG-128232 Change-Id: Icd700154dc89219f115fa3187c037d65451d0059 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* doc: qmllint: update settings fileSami Shalayel2025-07-111-7/+66
| | | | | | | | | The settings file in the docs looks quite old: replace it with a fresh version obtained by "qmllint --write-defaults". Pick-to: 6.10 Change-Id: I46b12f6b5164ea1880fb63b5408b4b3494eb2d93 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: Fix snippet comment markersDavid Boddie2025-07-011-2/+2
| | | | | Change-Id: I2aa3a54256423b1a191224f1bb7283d36b606c10 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add easingCurve value type and Easing singletonMitch Curtis2025-06-252-0/+84
| | | | | | | | | | | | | | This allows defining easing curves from QML, which is useful for e.g. FrameAnimation or use cases that require non-linear progression. [ChangeLog][QtQml] Added the easingCurve value type and Easing singleton. Fixes: QTBUG-137468 Change-Id: I2f9c4c2269c80c31a70700dd3a2475c53ba8a930 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: De-nokia-fy QML import documentation snippetJoerg Bornemann2025-04-101-1/+1
| | | | | | | | | | The text on the page "Identified Modules" has already been updated to use com.mycompany.qml.mymodule as example URI. The snippet that's included at the top of the page has been missed. Pick-to: 6.8 6.9 Change-Id: I05df857d8f9df24e70dafa6b8de3353736d268fb Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmltc: Add READ before WRITE in generated Q_PROPERTYsOlivier De Cannière2025-01-141-2/+2
| | | | | | | | | We currently have two orderings for the READ and WRITE elements of the macro depending on whether we compile a property or an alias. Make them uniform by having READ before WRITE in both cases. Change-Id: I1dd308c921b8948347029c603bc3bca2be87abda Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlPropertyMap: add an example of two argument constructorDheerendra Purohit2024-12-231-0/+32
| | | | | | | | | | | Add a code snippet to explain the use of protected two argument constructor when deriving a class from QQmlPropertyMap. [ChangeLog][Qml][QQmlPropertyMap] Added a code snippet to explain the use of protected two argument constructor of QQmlPropertyMap. Fixes: QTBUG-130592 Pick-to: 6.9 Change-Id: I85ec374e2b3067abf628af68fa5f692b3dd3a415 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* Doc: Add source string template code snippet for qsTrIdAndreas Eliasson2024-10-091-4/+13
| | | | | | | | | | | Add code snippet for how to supply source string templates to Qt::qsTrId using /*% <string> */. The /begincomment and /endcomment expand to /* and */, respectively. Fixes: QTBUG-127794 Pick-to: 6.8 6.7 6.5 6.2 Change-Id: I84b77179892eea6dba2c8816b658916d665e718e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Doc: Add snippet that shows how to use the n param in qsTr()Andreas Eliasson2024-10-021-1/+11
| | | | | | | Fixes: QTBUG-127795 Pick-to: 6.8 6.7 6.5 6.2 Change-Id: I4b9a958805b4bdcd0b06758e94aca5278847c314 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Docs: Snippet update for QMLTC documentationAlexei Cazacov2024-09-251-0/+4
| | | | | | | | | | This commit adds a comment with the info on when the snippet is applicable. Task-number: QTBUG-127443 Pick-to: 6.8 6.7 Change-Id: Ia89df2334c32e58795f976072ec18775a8c0d2e8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Tests: Fix various CMake warningsUlf Hermann2024-09-101-0/+1
| | | | | | | | | | | Add NO_GENERATE_EXTRA_QMLDIRS where applicable, make output directories and module URIs match, and avoid setting QTP0004 to OLD since that just generates a different warning. Also, explicitly include some .js files in the qmldir, even if that means re-evaluation on each import. Pick-to: 6.8 Change-Id: Ia03445ed7df85aa4d2032ba51675bab7501ad55b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QTP0004: Document resource file interactionFabian Kosmale2024-09-021-0/+1
| | | | | | | | | ...and fix the warning from the snippets file. Pick-to: 6.8 Task-number: QTBUG-127950 Change-Id: Ib5aad778674a3ba5004097512ac39ebd71d64cb4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Document that properties in functions used as bindings will be re-evaluatedMitch Curtis2024-06-211-0/+18
| | | | | | | | This was not obvious to me, so documenting it may help others out. Pick-to: 6.8 6.7 6.5 Change-Id: I11f985627d6168ad9a808c450c694de3ca72bcfb Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Correct doc snippet licenseLucie Gérard2024-03-224-4/+4
| | | | | | | | | | | | | | All file under doc/snippet should be license as Documentation snippets and according to QUIP-18 [1] thi is 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: Iee9bc9b8c2a81695c5825a36768b36db2726bd35 Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* qmltc: Allow setting initial values when creating a compiled typeLuca Di Sera2024-03-202-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `qmltc`-generated types currently do not allow setting any initial values for the property of a component during creation. For example, some component `Foo` with a property `bar`, will have no way to set `bar` to a specific value from the C++ side of the code before an instance of `Foo` is obtained by the user. This lack of control prohibits the user from interacting with certain processes that are part of the component creation. For example, if a component provides am `onCompleted` binding that depends on some of the values of its properties, the user is inhibited from varying the per-instance values that `onCompleted` depends on, as the user would be able to vary those values only after the component is created and the `onCompleted` signal is emitted. This differs, from example, from the `QQmlComponent` interface, where the user is able to provide some initialization values as part of the creation of an instance of the component. To allow the user to have more control in the initialization of the instance of a component, before it is fully created, `qmltc` generated code now allows the user to provide an initialization callback that is processed as part of the creation cycle of an instance of the component. The callback provides the user with a generated proxy object, `PropertyInitializer`, that only knows how to set the writable, non-private properties of the component. The generated code for the public constructor of a `qmltc`-generated type was modified to provide an optional `initializer` parameter that stores the callback. The private `QML_init` method that `qmltc` generates for each type, that performs the required setup to create an instance of a component, was modified to allow for the same optional parameter, which is passed on by the public constructor. The body of `QML_init` was modified to call the new parameter, after having performed the general set-up for the created instance but before the instance is completed and before setting up "complex bindings" such as an `onPropertyChanged` handler. The callback is called with an instance of the generated proxy object that is built on-site. The proxy-object keeps track of the properties that were actually initialized by the callback. This information is now passed down to `QML_setComplexBindings`, which avoids setting up any unnecessary bindings for the properties that were initialized. A representation for the proxy object was added to the internal IR that is used by `qmltc` when generating code. The representation for a compiled C++ type was modified to store an instance of the proxy object. The newly stored instance is now populated as part of the general compilation of a type, by the `compilePropertyInitializer` free-function in "qmltccompiler.cpp". The component responsible for the final code-generation, `QmltcCodeWriter`, was modified to be able to generate code for the new proxy object representation. The documentation for `QmltcCodeGenerator::generate_initCode`, which sets up the body for `QML_init`, was updated to reflect the new body. A pre-existing issue in the documentation of the method, which failed to enumerate all generated steps for the body, was fixed as part of the change. The preamble that `qmltc` generates for all generated header files was modified to include "QtCore/qxpfunction.h", to have access to `qxp::function_ref`, which is used to store the new callback parameter. A pre-existing snapshot test had its snapshot file, "src/qml/doc/snippets/qmltc/special/HelloWorld.qml.cpp", updated to reflect the changes to the generated code. A new basic, non-exhaustive test case was added to the available corpus of `qmltc` tests to test the basic workflow of providing an initialization callback. The documentation for `qmltc` was modified to mention the new parameter. Task-number: QTBUG-120700 Change-Id: I246c1c3634982580d66b31fd891382559a9cc3ae Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Remove confusing and wrong section about aliasesUlf Hermann2024-02-201-13/+2
| | | | | | | | | I cannot figure out what this was supposed to mean. Pick-to: 6.7 6.6 6.5 Fixes: QTBUG-119448 Change-Id: Iac8ede669d5b09c674abf115f13f977f854b7d96 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* doc: Move qmllint and qmlls docs out of qtquick folderSemih Yavuz2023-10-121-0/+19
| | | | | | | | | | | | The documentation for QML tools should live in qml/doc. As todo for next commit: Introduce qmltooling overview page and exhibit qml tools in categories like developer-tools, designer-tools, internal-tools etc. Task-number: QTBUG-116660 Change-Id: Ide3b0a306e34dd6c1466dfdfa836d073caf1c884 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: Remove unused snippet fileKai Köhne2023-06-301-24/+0
| | | | | Change-Id: Icdb5f01e9f3180fb398c100ba763b9a0ce8be2a1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: Don't use versioned Qt imports in QML snippetsKai Köhne2023-06-3059-66/+66
| | | | | | | | | | | We don't promote versioned imports anymore in Qt 6. Patch done by find . -path "*/snippets/*.qml" -exec perl -pi -e "s/import Qt([\.a-zA-Z]*) \d\.\d+/import Qt\\1/g" {} ; Pick-to: 6.5 6.6 Change-Id: I20a5bf52f7cdd99124626f85ce9794af74382977 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Convert XMLHttpRequest example to a snippet and add doc pageOliver Eftevaag2023-03-032-0/+108
| | | | | | | | | | | | | 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-031-0/+24
| | | | | | | Pick-to: 6.5 6.5.0 Fixes: QTBUG-110657 Change-Id: I063eb4ac25cbe226b5a996014042515d6ada5468 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove AUTO_RESOURCE_PREFIX, and refer to QTP0001 when possibleAmir Masoud Abdol2023-02-211-1/+2
| | | | | | | | Pick-to: 6.5 Task-number: QTBUG-96233 Change-Id: I4126760dddc9ec1b5c8850fb30a80730e19cb307 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Update QQmlContext documentation to discourage context propertiesUlf Hermann2023-02-084-0/+104
| | | | | | | | | | The snippets showing the use of setContextProperty() are intentionally removed. You should not do such a thing. Pick-to: 6.5 Fixes: QTBUG-106030 Change-Id: I1c5c217630aee8dd6e44f9f244b9ef2a8d2ef290 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qt_add_qml_module: Make usage of AUTO_RESOURCE_PREFIX a policyFabian Kosmale2023-02-011-1/+2
| | | | | | | | | | | | | | | | 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-272-2/+1
| | | | | | | | | | | | | | | | | 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>
* qmltc: generate code into namespacesSami Shalayel2023-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | Generate code into namespaces to avoid clashes between qmltc-generated and user code. Code generated by qmltc will by default be put in the URI_OF_MODULE namespace, and will generate subnamespaces to follow the module hierarchy if URI_OF_MODULE contains dots('.'). Also fix the test to use the new namespaces. [ChangeLog][Qml][qmltc] The type compiler will generate C++-code into a namespace by default. The new default namespace is inferred from the module's URI, where dots are interpreted as separating subnamespaces from each other, e.g., a type in module MyCompany.MyModule.Sub will be generated in the namespace MyCompany::MyModule::Sub. Fixes: QTBUG-109274 Change-Id: I3bfe2697b81e90bb63a079dc44c2810fc9925f97 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QQmlEngine: Add module + type based singletonInstance overloadFabian Kosmale2022-12-081-0/+7
| | | | | | | | | This makes it consistent with QQmlComponent::loadFromModule. It also avoids the issue the qmlTypeId does currently only work if the module has been imported; though that will be fixed in a separate commit. Change-Id: Id284f7ed2de7af461b782c5b5d71d9bfc0039844 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* qmltc: fix handlers for c++-signalsSami Shalayel2022-12-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow qmltc to generate handlers for c++-defined signals with const parameters by changing the safeguard to avoid type mismatch between slots and signals. First, remove the qOverload in the generated QObject::connect call to be able the connect slots and signals with different types (namely, pass by const references and pass by value should be interchangeable but is not allowed by qOverload). Second, save in QQmlJSMetaParameter when types are passed by pointer. Like this, qqmljsimportvisitor can check if a value type is indeed passed by value or const reference in a C++ signal. The same for reference types that need to be passed by (const and non-const) pointer. Print a message when an type is passed by argument in an incompatible way instead of letting qmltc generate uncompilable code, which makes the compiler print out cryptical messages. Third, add a qqmlcpptypehelpers template that decides if value types should be passed by value or reference, by letting the c++ compiler check if sizeof(T) > 3*sizeof(void*). Fixes: QTBUG-107625 Fixes: QTBUG-107622 Change-Id: I1a00532df591d10f74c1fd00dff5b7fccf40cb22 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-1/+1
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I601bf70f020f511019ed28731ba53b14b765dbf0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-09-074-4/+4
| | | | | | | 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>
* Add license headers to cmake filesLucie Gérard2022-07-084-0/+12
| | | | | | | | | | | | 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>
* Introduce a sane resource path to qt_add_qml_moduleUlf Hermann2022-06-232-1/+3
| | | | | | | | | | | | | | | | | | Since "/qt" is reserved, we can use "/qt/qml" as the default path for user QML modules. [ChangeLog][QtQml] The AUTO_RESOURCE_PREFIX option was added to qt_add_qml_module(). It places your QML modules in the otherwise reserved resource directory /qt/qml. This directory is also added to the default QML import path. By using it you don't have to specify custom import paths anymore. Specifying neither AUTO_RESOURCE_PREFIX nor an explicit RESOURCE_PREFIX will generate a warning now because such QML modules are likely invisible in the resource file system. Fixes: QTBUG-95145 Fixes: QTBUG-103452 Change-Id: Ie27dec5cbf34ea06258d55c659d202cdd61e54b2 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-11102-4982/+211
| | | | | | | | | | | | 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>
* Remove qmltc compilation command in favor of qt_add_qml_module()Andrei Golubev2022-05-311-6/+4
| | | | | | | | | | | | [ChangeLog][CMake] The qmltc compilation functionality provided by qt6_target_compile_qml_to_cpp() is merged into qt6_add_qml_module() command and is available through ENABLE_TYPE_COMPILER argument. The qt6_target_compile_qml_to_cpp() function does nothing and is left only to highlight that users must migrate away from it. Fixes: QTBUG-100215 Change-Id: Ie7d6b82564dff86176194fce35039ba0d93c0977 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Remove Integrating QML and C++ topicJaishree Vyas2022-05-112-149/+0
| | | | | | | | | Linked to creating projects in Qt creator from Integrating QML and C++ example. Fixes: QTBUG-102117 Change-Id: I39aac0e58bce7e2424b5d1b3633c0a213fbbee06 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Integrate with JS Values from C++Jaishree Vyas2022-05-093-0/+202
| | | | | | | | | Based on a Blog post Task-number: QTBUG-93490 Pick-to: 6.2 6.3 Change-Id: I7980e9790af3ceea58d73d043f868ad5c62c5a89 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Doc: Write QML ModulesJaishree Vyas2022-03-315-0/+76
| | | | | | | | | | Based on a Blog post Task-number: QTBUG-100450 Pick-to: 6.2 6.3 Change-Id: I42ade9906e8ba5ebeb1e78cfe3343ac9d89dcada Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* qmltc: Migrate to new object creation/querying mechanismAndrei Golubev2022-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Serves two things: a) Provides faster/more correct object creation model (long-term) b) Eliminates (more of) prototype's code generation (short-term) The whole object querying now works implicitly through the std::array<QObject *> that QQmltcObjectCreationBase provides. The creation logic is still rather recursive with regards to QML base types processing - unfortunately, we cannot simplify this part now as qmltc requires deeper introspection into the imported types (this in turn requires fiddling with QQmlJSTypeReader and QDeferredFactory<QQmlJSScope>::create()) Since we now use the new object creation pattern, prototype/codegenerator no longer needs high-level compilation methods. So replace prototype's code accordingly with qmltccompiler bits. We can also de-duplicate enum and property compilation (aliases are not touched for simplification) from prototype. Methods and bindings have to rely on prototype and QmlIR at present, their compilation is moved more-or-less unchanged Task-number: QTBUG-84368 Change-Id: I584ceb8f2e3c9f3f79530b02d1c88a4f6c2d06c9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove qmltc prototype code (2/N)Andrei Golubev2022-03-081-3/+3
| | | | | | | | | | | - Migrate to the newer output ir classes (with adjustments) - Deduplicate code writer and remove now-unused output helpers from the prototype version - Remove old output ir Change-Id: Ie7fe5e6d47e18477c65af02cabd89a890628442c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Disable failing declarative tests on Android - Part 2Assam Boudjelthia2022-03-021-0/+3
| | | | | | | | | | | | | | | | This allows us to enable testing on declarative for the module as a whole and have some sort of test verification for the mean time, and fix the fails over time. This also disable tests like qdom and qjsscope which are host tests. Pick-to: 6.2 6.3 Task-number: QTBUG-100991 Task-number: QTBUG-99194 Task-number: QTBUG-101005 Task-number: QTBUG-101006 Change-Id: Ie7ae5b8e0ccdf2f55ce3568091d513a073c48417 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tst_qmltc_examples: Fix a documentation leftover (FILES -> QML_FILES)Andrei Golubev2022-02-181-2/+2
| | | | | | | | Amends 97123dbe6755a787e93797f717f8ebf193352b85 Pick-to: 6.3 Change-Id: I0f13df4abff4ba2f0bb066480a157f6cfbefa3c2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_qmltc_examples: Set visible text to 0 by defaultAndrei Golubev2022-02-161-0/+1
| | | | | | | | This gives slightly nicer initial UI as a result Pick-to: 6.3 Change-Id: I112ed029d3735b7c960b7723d2aef0b6fc8e1777 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Fix docs and implementation of qt_generate_foreign_qml_typesAlexandru Croitor2022-02-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | Renamed doc file not to contain the version number like the rest of the doc files. Clarified description of what the function does. Adjusted doc page title and contents of the function. Fixed synopsis. Added Technical Preview note. Renamed function arguments for clarity. Fixed incorrect COMMENT and DEPENDS target usage. Added mention to QmlIntegration and qt_generate_foreign_qml_types on the Qml module page. Amends 96c1337aef41694c1af4863ad6f0d4d1f961363a Amends 3b1ae2f598d6013e5d262262002820d6eb76805b Pick-to: 6.3 Fixes: QTBUG-100216 Change-Id: I5c48616a7836c4ddb3f5ca36b7e82f1364995f2f Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Improve the structure of the output generated by qmltcAndrei Golubev2022-01-311-3/+4
| | | | | | | | | | | | | | Make an effort to separate user-visible APIs from internal code relevant to qmltc In the process of doing it, make tst_qmltc_examples::helloWorld() test less brittle by using QMap instead of QHash when dumping C++ member functions of the type. QHash does not guarantee that the keys are ordered while QMap does (via operator "<") Pick-to: 6.3 Change-Id: I1495e1755d3fd77950acb3820ad2b9c5e3cdee33 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmltc: Rename CMake command's argument FILES -> QML_FILESAndrei Golubev2022-01-261-1/+1
| | | | | | | | | This way we make it consistent with qt_add_qml_module() Fixes: QTBUG-100214 Pick-to: 6.3 Change-Id: I9f38a8ba3dec978ccdf4ea937ff662ae2449e582 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Document qmltc output formatAndrei Golubev2022-01-264-12/+241
| | | | | | | | | | | | Make understanding qmltc output easier by showing how it works on a trivial example. Add a paragraph on the generated code location as an addition Fixes: QTBUG-100051 Pick-to: 6.3 Change-Id: I0fa0f2c6c60fef7accbe855159275591d9e8bbc6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>