aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcachegen
Commit message (Collapse)AuthorAgeFilesLines
* Fix configure warningsUlf Hermann2025-10-291-0/+1
| | | | | | | | | | | | * Make nonstandard RESOURCE_PREFIXes explicit * Add TEST_PLUGIN to MockExtensionPlugin * Remove lint target from intentionally hidden module Also remove some useless VERSION statements and an ineffective QTP0001. Change-Id: Iadbacce55810bdbb2cbc6a1c7175303b96e06120 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_qmlcachegen: unify behavior for cross compiled testsSami Shalayel2025-07-071-51/+39
| | | | | | | | | | | | | Create a new macro that skips the test, and use it consistently around the tests, instead of sometimes skipping and sometimes failing the tests. Also add a macro that prints the same message and returns false for the generateCpp and generateCache helpers, to help in the case someone forgets to add the skipping macro to their new test. Change-Id: I91d35a32f345df1ebb0616046923a8c9b6b515e6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Specify the OUTPUT_DIRECTORY for tst_qmlcachegen_aotstatsAlexey Edelev2025-07-031-0/+1
| | | | | | | | | Ensure that we produce the correct directory structure for the QML module. This suppresses the tooling-related warning. Pick-to: 6.8 6.9 6.10 Change-Id: Ia391663806e4d3428ca3ae2a5bfa8dda95f833da Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* tst_qmlcachegen: Produce nicer failure messagesUlf Hermann2025-06-111-2/+2
| | | | | | Change-Id: I74b12066ba34f744958bb8170579197cbb915dee Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* qmlcachegen: fix crash on unresolved type with required propertySami Shalayel2025-06-062-0/+79
| | | | | | | | | | | | | | | | | | qmlcachegen can't resolve all types when importing QtQuick.Controls, so scopes from QtQuick.Controls might be unresolved. Check the scope before creating a fix suggesion when checking the required properties, and add a test that tests a file with required properties on an unresolved base type "Tumbler". This also fixes the crashes from QTBUG-137196 and QTBUG-136998 it seems. Pick-to: 6.10 6.9 6.8 6.5 Fixes: QTBUG-137411 Fixes: QTBUG-137196 Fixes: QTBUG-136998 Change-Id: Ibf461b54abf84ba13bff8c4833940c7359cf2d8e Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Re-run complete compilation pipeline on checksum mismatchUlf Hermann2025-05-261-1/+2
| | | | | | | | | | | | | | | We should not trust anything from the failed CU anymore. In particular, the string indices may be different in the new document created from source, and that will result in problems further down the line. Checksum mismatches shouldn't happen too often, and the previous code is clearly fragile. Pick-to: 6.9 6.8 6.5 Fixes: QTBUG-136810 Change-Id: I029e95cc4a52e8b1a528ca93ce594426b76be9d1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* Compiler: Skip bindings to properties of type QQmlScriptStringOlivier De Cannière2025-04-172-1/+9
| | | | | | | | | | | | | | There is nothing to do in the compiler. Setting the value of the property is already handled in by the object creator or the qobjectwrapper. Reading the value doesn't really makes sense and defeats its purpose . Fixes: QTBUG-134790 Pick-to: 6.9 6.8 Change-Id: I4576eb528e0dec273830b0244149a92ceb325bc9 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Compiler: Adapt AotStats to skipping functionsOlivier De Cannière2025-04-172-19/+72
| | | | | | | | | | | A revision was also added to the aotstats json format. Print a message asking the user to try again with a clean build if a missmatch in revision is found. Task-number: QTBUG-134790 Pick-to: 6.9 6.8 Change-Id: I0961bf841db17f280492ec787f404d9fe9b563f4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* tst_qmlcachegen: Rework aotstats_generation testOlivier De Cannière2025-04-176-35/+39
| | | | | | | | | | We don't have to call qmlcachegen manually and can simply rely on the build system to generate the required aotstats files for us. Task-number: QTBUG-134790 Pick-to: 6.9 6.8 Change-Id: I5a5d6189662b9eb1daeb7adb51e3dfc2c5a13b4e Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QtQml: Encapsulate QQmlComponentPrivateUlf Hermann2024-12-111-4/+4
| | | | | | | | Other types should not be able to recklessly hack into its internals. Change-Id: I3f98e11b303193d1c56a6e8e64de03909751030a Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Compiler: Make qqmljsscope::filePath hold the source location more oftenOlivier De Cannière2024-10-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Previously, it would hold the location of the copy in the build directory or in the resource file system. This should improve the accuracy of the information that we can report back. For example, the file location of files reported in aotstats will now be those in the source folder. The changes necessary for this patch were found through trial and error by asserting that the filePath respect a certain form and fixing what I could. There remain cases where the filePath still contains a location in the build directory. We would need some other change to report those accurately as well. Finally, sometimes the filePath is empty or does not contain a valid path at all but instead what seems to be the location of an included file. It can have the form "private/..._p.h" for example. Pick-to: 6.8 Change-Id: I77a2596f6c4a179580d924a6e9324e43dbb86c0c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add Qt::Qml before Qt::QmlPrivate to auto testsKarim Pinter2024-10-221-0/+1
| | | | | | | | | | The build for auto tests for VxWorks fails because Qt::Qml is not added before Qt::QmlPrivate resulting in many unresolved symbols from Qt::Qml library. When Qt::Qml is added before it solves this problem. Task-number: QTBUG-129113 Change-Id: I89d553ac1d6706e2e934665fed2f308e6b01ed78 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>
* Compiler: Record statistics about aot compilationOlivier De Cannière2024-05-286-0/+160
| | | | | | | | | | | | | This patch introduces the collection of statistics about the ahead-of-time compilation of functions and bindings to Cpp by qmlcachegen. This is done by having qmlcachegen save an aotstats file for every qml file it compiles. This file contains, for every function and binding, whether the Cpp codegen was successful, its duration and a potential error message Task-number: QTBUG-124667 Change-Id: Iba9a72be04f6642688533a3ae12ea687296c85e1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Correct license for test filesLucie Gérard2024-02-272-2/+2
| | | | | | | | | | | | | | According to QUIP-18 [1], all test files should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I26d72e8de04d4c7c57b3b7838af5d033265de5ba Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Kai Köhne <kai.koehne@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QtQml: Move dependentScripts into base CUUlf Hermann2024-01-181-1/+2
| | | | | Change-Id: Ia332a691a4a5f04fcca50eb1c3e2018f8368dbe6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Make base CU a member of ExecutableCompilationUnitUlf Hermann2024-01-101-1/+1
| | | | | | | | | | | | We want to re-use the base compilation unit across engines. For that to work it cannot be a slice of the engine-specific ExecutableCompilationUnit. Since CompiledData::CompilationUnit is refcounted on its own now, make it unmovable. Change-Id: I8418c9754d7a07e5210c1e7a7fc69355e1d57807 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QML diskcache: Verify cache file sizeFabian Kosmale2023-10-062-0/+783
| | | | | | | | | | | | | | | | | | We can't rely on the checksum verification, as we still assume that we can read all bytes in the range claimed by the unit's header. If for some reason the cache file has been truncated, that will lead to crashes due to out-of-bound reads. As we already store the unit's size in the header, use it for an initial verification before doing any further work. Initial test case was provided by Harald Sitter <sitter@kde.org>. Pick-to: 6.6 6.5 6.2 5.15 Fixes: QTBUG-117130 Change-Id: Idd20191ed0e0ef9c37985c4c64124578f0607ad3 Reviewed-by: Semih Yavuz <semih.yavuz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CMake: Make qml tests standalone projectsAlexandru Croitor2023-07-051-0/+6
| | | | | | | | | | | | | | | | | Add the boilerplate standalone test prelude to each test, so that they can be opened with an IDE without the qt-cmake-standalone-test script, but directly with qt-cmake or cmake. Boilerplate was added using the follow script: https://git.qt.io/alcroito/cmake_refactor Manual adjustments were made where the code was inserted in the wrong location. Task-number: QTBUG-93020 Change-Id: Ia68c9d263e7454f0c4a26c29b10f1c535d08e2f6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
* CMake: Allow omitting the version of QML modulesUlf Hermann2023-01-271-1/+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>
* Retire the qt_parse_all_argumentsAmir Masoud Abdol2023-01-201-2/+2
| | | | | | Task-number: QTBUG-99238 Change-Id: Ia11c9cbd7c06347319ab3674ec0cd8da0214747e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QtQml: Allow more fine grained control of the disk cacheUlf Hermann2023-01-021-21/+78
| | | | | | | | | You can now enable and disable the AOT-compiled code and the loading and saving of .qmlc files separately. Fixes: QTBUG-101358 Change-Id: I1305c4f2f75d8cff544a127e956589d1ed1aeb52 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-09-071-1/+1
| | | | | | | 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>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-281-1/+1
| | | | | Change-Id: I1cd769f85d5f82c43639d6787d98e536619249e6 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Add license headers to cmake filesLucie Gérard2022-07-081-0/+3
| | | | | | | | | | | | 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-231-0/+1
| | | | | | | | | | | | | | | | | | 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-112-54/+4
| | | | | | | | | | | | 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>
* Replace uses of deprecated _qs with _s/QStringLiteralSona Kurazyan2022-04-291-1/+3
| | | | | | Task-number: QTBUG-101408 Change-Id: Ic925751b73f52d8fa5add5cacc52d6dd6ea2dc27 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Skip tests that call qmlcachegen when cross-compiledPasi Petäjäjärvi2022-02-032-0/+53
| | | | | | | | | qmlcachegen is not meant to be available on the target. Fixes: QTBUG-100366 Pick-to: 6.2 6.3 Change-Id: I5cbaa62e85d9a5dd6467840eb4e3ba5e3b63857c Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
* tst_qmlcachegen: Output some diagnostics on failuresUlf Hermann2022-01-251-0/+6
| | | | | Change-Id: I43b407670916ff53faab34194617d54217c0da27 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove unused .qrc filesJoerg Bornemann2022-01-204-22/+0
| | | | | | | Task-number: QTBUG-94446 Change-Id: Ib8e773f97fca0d296752fd006062b5841dfd5662 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Compile QML files ahead of time with qmlcachegenUlf Hermann2021-12-031-1/+4
| | | | | | | | | | | | | | | | | | | | | qmlcachegen compiles bindings and functions to C++ as far as QQmlJSAotCompiler can. It does respect "pragma Strict" and rejects the file if it's violated. Furthermore, it sets up the logger to follow the qt.qml.compiler.aot logging category. By default it's completely silent. Compiling the examples with qmlcachegen exposes a bug in the type resolver where it returns an invalid generic type. It should never do that. Fix it by returning JSValue. [ChangeLog][QtQml][Important Behavior Changes] QML bindings and functions are now compiled to C++ by qmlcachegen, if possible. Use the qt.qml.compiler.aot logging category to receive diagnostics about the compilation. Task-number: QTBUG-98305 Change-Id: I6953812c3fd20b68339617a5714fcbe16a384360 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Improve tst_qmlcachegen::versionChecksForAheadOfTimeUnits()Ulf Hermann2021-11-221-9/+14
| | | | | | | | | | | | | | Output the messages generated by the qt.qml.diskcache logging category while loading the original unit. This might tell us why the test occasionally fails. Also, make sure to clean up in case of a failure so that we don't cause further tests to fail. Task-number: QTBUG-98404 Change-Id: I7a6da4288721164c71bbd62d1bad0909efb35fc2 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* SaveableUnitPointer::saveToDisk restores flags incorrectly at cleanupJarkko Koivikko2021-09-171-0/+12
| | | | | | | | | | | | | | | SaveableUnitPointer::saveToDisk function uses XOR to restore flags, which causes the existing flags to be reset instead of restored. This can have major side effects, such as deallocation of StaticData units from static data cache (which should never be freed). Fixes: QTBUG-96275 Pick-to: 6.2 5.15 Change-Id: I09c06f2854fe07a12a2d97290a3e39604a25fd9a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
* Output a message when tst_qmlcachegen's version check failsUlf Hermann2021-09-161-1/+15
| | | | | Change-Id: I10fa50dd3bf6762c77362e5bc587cb5c528e128c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Consolidate test helpers into private librariesMitch Curtis2021-09-132-4/+10
| | | | | | | | | | | | | | | | | | | | Previously each test would include and build sources from the shared folder. Now we make those sources a library, build it once, then have each test link to it instead. We also take the opportunity to move some helpers that qtquickcontrols2 had added into the quicktestutils library where it makes sense, and for the helpers that don't make sense to be there, move them into quickcontrolstestutils. We add the libraries to src/ so that they are internal modules built as part of Qt, rather than tests. That way we can use them in a standalone test outside of qtdeclarative. Task-number: QTBUG-95621 Pick-to: 6.2 Change-Id: I0a2ab3976fdbff2e4414df7bdc0808f16453b80a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlIRBuilder: Always preserve "undefined" stringFabian Kosmale2021-08-094-0/+201
| | | | | | | | | | | | | | | | | | | | | | | QQmlIRBuilder skips storing binding scripts as a string to save memory. However, for QQmlScriptString, we need the string to be available. This is solved by running QQmlScriptStringScanner in the type compiler at runtime, which sets the correct stringIndex for script string bindings. However, that one does not run when we already have a compilation unit from cachegen (and if we would run it unconditionally, we still would miss the source code to recover the string). We work around this issue by noting that QQmlScriptString only cares about a very limited set of strings: Namely the various literals and undefined. The literals are already correctly handled, as IRBuilder has specific optimizations for them anyway. We now check in the generic case whether the bindings string equals "undefined", and if so, ensure that the string is registered. Fixes: QTBUG-91165 Pick-to: 6.2 Change-Id: I4c4696952a082d1e69e0c9e5a0b9bf2470d59187 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Add NO_PLUGIN option to qt6_add_qml_module()Craig Scott2021-08-031-2/+0
| | | | | | | | | | | | | | | | | | | | The new option allows the caller to state more clearly that they do not want a plugin at all. Previously, the NO_CREATE_PLUGIN_TARGET option had to be given to prevent the command from trying to create a plugin target, but that option is meant for when the project will create the plugin target later. Now that the caller has a way to explicitly say they don't want a plugin, require PLUGIN_TARGET to be given if NO_CREATE_PLUGIN_TARGET is present. This forces the project to provide the name of the plugin target that they will be responsible for creating. Fixes: QTBUG-95141 Pick-to: 6.2 Change-Id: I84e036074f3e2785f17a8d33ad87ee0b7e016173 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Rename FILES keyword to QML_FILES for qt6_target_qml_sources()Craig Scott2021-07-121-21/+20
| | | | | | | | | | | | | | | The function takes qml files and resources, so a generic keyword like "FILES" is no longer suitable for specifying just the QML files. Local docs for RESOURCES had previously been missed, so add them too. Fixes: QTBUG-95091 Pick-to: 6.2 Change-Id: Ie5770250ab719ddfb9779770af92965d037bc2e3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Refactor and update qml CMake APICraig Scott2021-06-042-11/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing CMake API for qml modules had a number of shortcomings. Refactor it to achieve the following: - Clearly separate public and internal aspects. - Re-use code from qtbase for adding plugins and module targets rather than reimplementing close variations. - Provide more robust and complete support for qmllint, qmlcachegen and automatic generation of qmldir files. - Reduce the steps needed for more common scenarios. - Encourage the use of separate backing library and plugin targets. - Automatically generate the plugin class .cpp file where possible. - Specify .qml files directly through qml-specific API elements rather than assuming they can be extracted out of a set of resources. [ChangeLog][QtQml] The qml CMake API has changed from 6.1 and is now out of Technical Preview status. The most notable change is that .qml files should no longer be specified as resources, there is dedicated handling for them in the qt6_add_qml_module(). A related change is that the qt6_target_qml_files() command has been replaced by qt6_target_qml_sources(). More complete integration with qmlcachegen, qmllint and qmldir generation is also part of the CMake API. Fixes: QTBUG-91621 Task-number: QTBUG-82598 Task-number: QTBUG-88763 Task-number: QTBUG-89274 Task-number: QTBUG-91444 Change-Id: I25aae1b0e89890394dfe2ba2824008164b2ca8d9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use fixed qt_add_resource BASE argumentJoerg Bornemann2021-05-211-7/+2
| | | | | | | | Pick-to: 6.1 Task-number: QTBUG-86726 Change-Id: If6e1033642d98ccd40daeb57a453c0e5bc2985da Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Move tools to libexecKai Köhne2021-05-111-1/+2
| | | | | | | | | | | | | | Move qmlimportscanner, qmltyperegistrar, qmljsrootgen, qmlcachegen to libexec These are internal tools that is not supposed to be run by the user directly. [ChangeLog][Linux] qmlimportscanner, qmltyperegistrar, qmljsrootgen, qmlcachegen tools got moved from QTDIR/bin into QTDIR/libexec directory. Task-number: QTBUG-88791 Change-Id: I2739044e872ec83ef7da7dd857c26395ecfd407d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
* Fix some "can be marked override" warningsAndreas Buhr2021-02-231-1/+1
| | | | | | Change-Id: I13da0d085901314950c4fa0afb5853e183652e67 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Uniformly support shebangFawzi Mohamed2021-02-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The "qml" tool was the only way of loading QML files that would respect a shebang line. This is problematic as this way you cannot load such files programatically using QQmlComponent, limiting their re-use. Common tools like Qt Creator, but also qmllint, qmlformat, qmlcachegen, etc would not recognize files with shebangs. By moving she-bang support directly in the lexer all tools implicitly support it. Note that we could just as easily support '#' as extra comment character along with //, but here we narrowly add support for in the first line only, as node does (this means that javascript files using she-bang accepted by node, are now accepted also by qml). The only tool needing some adjustments is qmlformat, that has to emit the she-bang again as she-bang and as first line. Add tests for qmlformat, and sprinkle some she-bangs in the other tests just to be sure it doesn't affect anything. Change-Id: I1f6d881c7438bdb23163b5dbe829d59a35d11132 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQmlIRLoader: Actually load RequiredPropertyExtraDataFabian Kosmale2021-02-032-0/+17
| | | | | | | | | | | | | | | If a QML component wants to mark properties of its "parent" component as required, it can do so via required propertyName The information about those properties is stored in a RequiredPropertyExtraData data structure. This structure is already serialized to disk in the QQmlIRWriter. However, we neglected to restore it so far in the loader. Fixes: QTBUG-90538 Pick-to: 5.15 6.0 Change-Id: I789daff9bc881e4f35c942c77f5116b5284de81b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove the qmake project filesFabian Kosmale2021-01-151-39/+0
| | | | | | | | | Remove all qmake project files, except for examples which are used to test that qmake continues to work. Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-061-9/+9
| | | | | | | | Modify special case locations to use the new API as well. Task-number: QTBUG-86815 Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Fix additional warnings from usage of deprecated APIsVolker Hilsheimer2020-09-161-1/+1
| | | | | | | | | | Replace more QLibaryInfo::location with QLibraryInfo::path Replace old event accessors APIs, including relevant comments. Change-Id: Ie205fc93b6e1c0dfb3dca9100fbde417ab68fc9f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQmlIRLoader: Restore inline components correctlyFabian Kosmale2020-07-222-0/+24
| | | | | | | | | | | | | | Whether a component is an inline component is not only stored in the flags, but also in the isInlineComponent member. Ideally, this should be unified and the member removed, but for now we just restore the value correctly. Adjusted tst_qmlcachegen::initTestCase so that we testFile and testFileUrl are actually usable in the test. Fixes: QTBUG-84237 Pick-to: 5.15 Change-Id: I759cd6b8914b186b9e5c8118863fc8d0580d21af Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* CMake: Fix failing tst_qmlcachegen::skippedResourcesAlexandru Croitor2020-07-073-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | The test was failing in CMake configurations because the pro2cmake generated code set the QT_SKIP_QUICKCOMPILER property on a non-existing file path (it was missing "data/"). Fix this manually by specifying the correct file path. Add a SkipQmlCacheGen.qml file to make it more clear what the file is used for. The previous alias from Retain.qml to Skip.qml was confusing, and also was overriding the source file properties on the same file that was part of 2 different resources. Keep the alias to Skip.qml so we don't have to touch the C++ code. pro2cmake will be fixed in a separate change to output correct file paths. Amends 41890402db086f4c61e052cef7659eb6b003dc77 Task-number: QTBUG-85364 Task-number: QTBUG-84886 Change-Id: I6e49deb8758403241d6f804af797adf2f05fda05 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>