aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* QtQml: Move QMetaObjectWrapper into separate header/impl filesUlf Hermann2024-04-281-0/+1
| | | | | | | | | We want to use it from QQmlTypeWrapper and avoid circular includes. Task-number: QTBUG-124662 Change-Id: I4c78a17eb262a303b7239bbdd853ec02d609c330 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Generate qmldir files for extra directories with QML filesUlf Hermann2024-04-031-1/+2
| | | | | | | | | | | | | | | | Those qmldir files contain only a prefer directive for the canonical resource location of the module. This way, any time another component from the implicit import is requested, it will not be located in the extra directory (where it probably doesn't exist), but instead in the canonical location. Since people may have manually written qmldir files with different content in those places, or worse, relied on the other components to be inaccessible, we need a new policy to opt into this. Fixes: QTBUG-111763 Change-Id: If236feb7dd7c8d704b813ea56482ff758799d0a7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Enable macOS POST_BUILD deployment for in-tree examplesAlexandru Croitor2024-03-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building all examples in-tree, we might not want to run the deployment / installation code for each example due to time and space constraints, but we still want to be able to run the examples from the build dir. The qml deployment API has a useful MACOS_BUNDLE_POST_BUILD option that ensures a macOS app bundle can run from the build dir /before/ installation (by symlinking plugins into the build dir). We couldn't use the API and option for a variety of "reasons", so we copy pasted a bunch of similar code in each example (bundle_shared and QtBundleQmlModuleForMacOS.cmake). This change addresses most of the reasons. Previously when qtdeclarative examples were built in-tree, they would not have the their qml deployment finalizer executed at all, because it is only run when the Qt6QmlConfigExtras.cmake file is loaded, and that wasn't loaded when qtdeclarative itself is built. This meant that an example calling qt6_generate_deploy_qml_app_script, would get an error like: No QML imports information recorded for target ${target}. The target must be an executable and qt_add_qml_module() must have been called with it. If using a CMake version lower than 3.19, ensure that the executable is manually finalized with qt_finalize_target(). Missing file: qtdeclarative/.qt/deploy_qml_imports/${target}.cmake Make sure we append the finalizer to the Qml target also when it is built. This will cause it to run for in-tree examples. Adjust the deployment skipping code to allow running the MACOS_BUNDLE_POST_BUILD step even if deployment itself will be skipped. This is especially important for no-prefix builds, where there is no install step and we want examples to run from the build dir. Pick-to: 6.7 Task-number: QTBUG-90820 Task-number: QTBUG-96232 Task-number: QTBUG-102057 Change-Id: I68e23b102f753037ee49a91b78c18311c8f2ae97 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove the explicit declaration of QQmlComponent::createObject(QQmlV4Function *)Alexey Edelev2024-03-121-1/+5
| | | | | | | | | | | | | | | | Now when manual moc provides the required QT_DISABLE_DEPRECATED_UP_TO definition we don't need to declare the QQmlComponent::createObject(QQmlV4Function *) for moc explicitly. Also we need to manually add imported dependencies of Qt6::Qml to make sure that we passed to moc all the required frameworks on the Apple platforms. Fixes: QTBUG-104898 Change-Id: I5404808b2589463d1b0ea5884f40e8e67cd5cb0e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jari Helaakoski <jari.helaakoski@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Consider Qt6::Qml compile definitions when manually running mocAlexey Edelev2024-03-071-1/+1
| | | | | | | | | | | Consider compile definitions of Qt6::Qml target, but not only include directories when manually running moc. Fixes: QTBUG-104898 Change-Id: I6fd15a346b7cb4b02a68ab2d034aac14d711d00e Reviewed-by: Jari Helaakoski <jari.helaakoski@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QtQml: Make QQmlScriptString a builtinUlf Hermann2024-02-221-11/+13
| | | | | | | | | It's really rather special. Pick-to: 6.7 Task-number: QTBUG-101364 Change-Id: I82899448d2b94ca67edd17772f773d4718619324 Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
* QtQml: install builtins metatypes JSON fileUlf Hermann2024-01-171-0/+18
| | | | | | | | | | | If we don't install and propagate it via INTERFACE_SOURCES we cannot use it in other modules. Those other modules then re-declare QObject over and over. Pick-to: 6.7 Change-Id: I13bff77e9bf79bd13eeb93cde96a6a8e5ef8f7d3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove the use of GENERATE_PRIVATE_CPP_EXPORTSAlexey Edelev2024-01-111-2/+1
| | | | | | | Task-number: QTBUG-117983 Change-Id: I584116bfd4d47deca914910b712c2ea3295f3e7f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QtQml: Always link executable CU on creationUlf Hermann2024-01-101-1/+1
| | | | | | | | | | | | | | | We don't want floating unlinked executable CUs. They should always be tied to an engine, and the engine should not change. This gives us one definite point where to register them with the engine (to be done in subsequent change). Unfortunately, due to the refcounting, we need to remove the engine from any still-referenced CUs when the engine itself is destructed. We will be able to drop the refcounting and make the engine fully own its executable CUs once we can hold base CUs in most places. Change-Id: I9a53e83d5c4746c2b2bca896b51baa4fe7fee757 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Long live incremental garbage collection in QML!Fabian Kosmale2023-12-201-1/+1
| | | | | | | | | | | | | | | | | The design of the garbage collector is described in src/qml/memory/design.md. The gc and gcdone test helpers are adjusted to drive the gc to completion, even when in incremental mode. Parts of tst_qv4mm and tst_qqmlqt need to run with the incremental gc disabled, as they call gc inside QML and assumes that the GC finishes before returning. Initial-patch-by: Rafal Chomentowski <rafal.chomentowski@ge.com> Task-number: QTBUG-119274 Change-Id: I1d94f41bc7a434fad67de0fd46454b6db285f2eb Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QtQml: Have qmltyperegistrar generate jsroot.qmltypesUlf Hermann2023-11-241-4/+10
| | | | | | | | There is no need to keep the file in the repository if qmltyperegistrar can generate it on the fly. Change-Id: I6ca129eeffbd4ed57c31e1f538f417850183037e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make builtins an actual moduleUlf Hermann2023-11-241-1/+90
| | | | | | | | | | | | | | | | | | | | | | This way we can eventually use the metatypes generated by the builtins to validate other module using qmltyperegistrar, and throw informed warnings if types are missing. qmltyperegistrar automatically picks up the metatypes of any library linked into a target. This means it always picks up the builtins metatypes now when QtQml is linked in. We now have to check more closely whether an object binding is actually a group property. QVariant now has a value type metaobject and does not pass as "unknown thing" anymore. We also have to move the QML_FOREIGN macros to QQmlIntegration since we want QML_FOREIGN to declare the builtins but we don't want to depend on QtQml. Task-number: QTBUG-101143 Change-Id: I9f1a2713797291b6624aef0ade599d19e0766907 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* QtQml: Have QtQml.Base formally import QMLUlf Hermann2023-11-171-0/+2
| | | | | | | | | | | | This way we don't have to register QtObject and Component twice. The QML_NAMED_ELEMENT etc. will return when we make the builtins a proper module. The imperative registration is a stop gap measure. Task-number: QTBUG-101143 Change-Id: I726aa77156b31aa624ac44d30e180ace6cb9d790 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QQmlSignalNames: Add implementation for signal name manipulationsSami Shalayel2023-07-211-0/+1
| | | | | | | | | | | | | | | | Add a set of static helper methods in src/qml/common/qqmlsignalnames{_p.h,.cpp} to do signal name manipulations (from signal to signal handler name and back, from property to property changed signal to property changed handler and back). Add tests in tst_qml_common for the helper methods. ToDo in following commit: replace all implementations of signal name manipulations out there with the helpers introduced in this commit. Change-Id: I8e606375839d9eda673da121a60484c5d211f4a0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: unbreak unity-build-batch-size 100000Marc Mutz2023-07-211-0/+25
| | | | | | | | | | | | | | | Exclude TUs that cause problems in a build where all of QtQml's .cpp files end up in a single unity_0_cxx.cxx. This should ensure that the build will forthwith not fail because someone added a new .cpp file in the "wrong" position. Of course, this is just a snapshot, with my configuration: Clang 15, Ubuntu 20.04, -developer-build, C++23, -sctp, libc++, ... Task-number: QTBUG-115140 Pick-to: 6.6 6.5 Change-Id: If3cb7c17548710dca3b6111b33a4d3ca70417728 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove the manual undef of the min/max macros, or def NOMINMAXAmir Masoud Abdol2023-06-061-2/+0
| | | | | | | | | | We now add NOMINMAX to PlatformCommonInternal target which will be linked to everything else, so min/max will not be defined upon the inclusion of `windows.h`, or other headers. Pick-to: 6.5 6.6 Change-Id: I3c71f2f719aad3fb83e189e33e5f176befcb4482 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QmlCompiler: Inline some array methodsUlf Hermann2023-04-281-0/+1
| | | | | | | | | | | So far we can only deal with methods that don't change the source array and don't use iterators or functions as parameters. We also omit concat() for now. However, indexOf(), lastIndexOf(), includes(), join(), slice() and toString() are possible already now. Task-number: QTBUG-112722 Change-Id: Id19c74e8ad25af876bc954c040c767823b7e3259 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Trace: Convert qtdeclarative to use new tracepoint generationAntti Määttä2023-04-261-1/+9
| | | | | | | Pick-to: 6.5 Change-Id: Ieacfa716b657ac221a75cd5a0dd75d5099962e91 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
* CMake: use the output dir's .generated dirThiago Macieira2023-04-191-1/+1
| | | | | | | | | | It doesn't exist in the source dir because the files are, as the name says, generated. Pick-to: 6.5 Change-Id: I3b169860d8bd41e9be6bfffd1757127c90e0a6aa Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Mark dependency between QmlMeta and qmlplugin in a static buildAlexandru Croitor2023-04-121-0/+6
| | | | | | | | | | | | | | | | | Just like we do for workerscript plugin, in a project that uses a static Qt without using qmlimportscanner, linking to the qmlplugin automatically initialize the QmlMeta plugin as well. Otherwise the application errors out with: module "QtQuick" version 6.6 cannot be imported because: module "QtQml" plugin "qmlmetaplugin" not found import QtQuick Pick-to: 6.5 Fixes: QTBUG-112712 Change-Id: I566eaf94e2a13a8d8bb7b5509af1594c6c3206e9 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
* Remove cmake porting artifactsFabian Kosmale2023-03-211-29/+0
| | | | | | | | | | The condition could never have been met anymore (given that we depend undconditionally on C++ > 17), and we apparently don't miss whatever the porting script could not parse. Change-Id: Ia6fcc09aa212f8a4fcc0e226e98e45bf4c9b8ccc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QML: Insert aliases in inline components when loading from disk cacheUlf Hermann2023-03-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far we did not completely restore aliases in inline components. This was masked by the fact that until recently we failed to load inline components from the disk cache and always loaded them from source instead. To fix this, refactor QQmlComponentAndAliasResolver to work for both, QmlIR and QV4::CompiledData. With QmlIR, it populates the relevant data structures. With QV4::CompiledData, it sanity-checks them. The sanity-checks do incur some overhead, but given recent events, we should err on the side of caution here. Since QQmlComponentAndAliasResolver has received all the fixes we've applied to make inline components work, this should lead to inline components loaded from cache files to work the same way as those compiled from source. In turn, we can drop some methods of QQmlPropertyCacheAliasCreator. Amends commit 131db085a752469e8f19974c2edb3a138d900249 Pick-to: 6.5 Fixes: QTBUG-111766 Fixes: QTBUG-111857 Change-Id: I9cc75e700a5fe5810a866e9aa930b9811368b1b4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Make QQmlTypeNotAvailable publicUlf Hermann2023-02-281-1/+0
| | | | | | | | | | | Since we are exposing it in the type registration macros, we need to make it visible to the compiler. Pick-to: 6.5 Fixes: QTBUG-111477 Change-Id: I3dbefd617f00de6e97585d105c612bbc33d0224d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add the missing dependencies to Qml_sync_headers targetAlexey Edelev2023-02-151-0/+11
| | | | | | | | | | | | | | | The Qml_sync_headers target doesn't exist in the scope of qtdeclarative/src/qml/CMakeLists.txt, that's why adding the AUTOGEN dependency on Qml_sync_headers doesn't work implicitly inside the qt_internal_add_qml_module call. This adds the required dependencies on Qml_sync_headers, to avoid issues related to the missing plugin IIDs in the qmlplugin and QmlMeta targets when running moc. Pick-to: 6.5 Change-Id: Ia06dfbf84872525d9ab62ee82ad2927f15feefaa Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Add exclusions for CMake Unity (Jumbo) buildsFriedemann Kleint2023-02-131-0/+4
| | | | | | | Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: Ie0eba7bd81cb5e493aeb9be0693dfd2076b3fa7d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qt_add_qml_module: Make usage of AUTO_RESOURCE_PREFIX a policyFabian Kosmale2023-02-011-0/+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>
* Fix minor API problemsUlf Hermann2023-01-181-0/+3
| | | | | | | | | | | Add explicit where appropriate, and use more elegant constructs in inline functions. Introduce removed_api.cpp for QJSEngine::create(int, const void *). Pick-to: 6.5 Change-Id: Ie54b0494fe3c5567f8a5ca361c3a583de3d97dd5 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix build with -no-feature-translationTasuku Suzuki2023-01-171-5/+1
| | | | | | | | qqmldebugtranslationprotocol_p.h doesn't contain QTranslator Pick-to: 6.5 Change-Id: I99686d1200f6f801c41c7b9ed941a8ca0f95af27 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QML: Add an accurate stack bounds checkerUlf Hermann2022-12-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This re-introduces a stack bounds checker. The previous stack bounds checker was removed in commit 74f75a3a120b07bbfe6904512b338db8850874e4 because the cost of determining the stack base was deemed too high. Indeed, determining the stack base on linux using the pthread functions costs about 200.000 instructions and the cost grows with the number of concurrently running threads. However, by reading /proc/self/maps directly we can trim this to about 125k instructions. Furthermore, with the new implementation we only need to do this once per engine. Calling JavaScript functions of the same engine from different threads is not supported. So we don't have to consider the case of checking the bounds of a different thread than the one the engine was created in. Furthermore, we get a more accurate number now, which means we don't have to re-check when we get near the boundary. Also, change QV4::markChildQObjectsRecursively() to use an actual QQueue instead of being recursive. This avoids the stack from overflowing when the stack is already almost full, and was leading to crashes in the stackOverflow tests. Make the stack smaller for the the tst_qquickloader::stackOverflow{,2} tests to run faster in the CI (and avoid the timeout). Task-number: QTBUG-106875 Fixes: QTBUG-108182 Change-Id: Ia5d13caa7d072526ff2a3e1713ec7781afc154a9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmltc: fix handlers for c++-signalsSami Shalayel2022-12-071-0/+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>
* QtQml: Restructure the moduleMaximilian Goldstein2022-11-281-2/+31
| | | | | | | | | | | | | | | | | | | | Create a new module QtQml.Base which contains the actual QtQml types and a new module QtQml that just imports QtQml.Base, WorkerScript and Models. This is so we don't have circular dependencies within QtQml anymore where QtQml imports QtQml.Models but Models can't depend on QtQml for type information. [ChangeLog][QtQml][Important Behavior Changes] If you import QtQml you now need to make sure that QtQml is actually in the import path. Usually this is the case, but by manipulating the import path you can hide QtQml. In previous versions of Qt you could then still import QtQml because its types are present in the QtQml library. However, it would ignore its dependencies: QtQml.Models and QtQml.WorkerScript. If you really want to import only the builtins, you can always "import QML". Fixes: QTBUG-105240 Change-Id: Icdcdcc926757a8e9e8d639301b5b6d110de59613 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* V4: Refactor QQmlValueType{Wrapper|Reference} and QV4::SequenceUlf Hermann2022-10-131-0/+1
| | | | | | | | | | | | | Every QQmlValueTypeWrapper is potentially a reference now. Since most were already before, the overhead of checking the vtables at every step was dubious at best. Extract a common base class that handles the reading and writing of object properties employed in both value type references and sequences. Task-number: QTBUG-99766 Change-Id: Idf72d9a20a52366e5c2d0dcd4b3a18072c0ccc41 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>
* Create Translation Bindings without CompiledData::BindingSami Shalayel2022-08-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To add translation bindings to qmltc, the methods used to create translation bindings need to be adapted to work without QV4::CompiledData::Binding as it is not available from qmltc. Instead, information already available from the QQmlJSScope should be used, along with a newly introduced helper class QQmlTranslation. Details: Add a QQmlTranslation class that represents a call to qsTr, qsTrId etc that knows how to translate itself (without needing any ExecutableCompilationUnit or Binding). It encapsulates the information needed to create a translation binding. ExecutableCompilationUnit::bindingValueAsString refactored so its functionality can be used without Binding. Instead, it uses only the translationId, see ExecutableCompilationUnit::translateFromId and ExecutableCompilationUnit::translateFrom. Refactored QQmlTranslationBinding to work with QQmlTranslation instead of CompiledData::Binding. Same for QQmlCppBinding::createTranslationBindingForBindable, QQmlTranslationPropertyBinding::create and QQmlCppBinding::createTranslationBindingForNonBindable. Changed TranslationBindingInformation to work without CompiledData::Binding, and also removed static unused QString ProxyTranslator::originStringFromInformation( const TranslationBindingInformation &translationBindingInformation) as I could not find out what this origin string is. Same for the translation debugging in qmldb_preview. Added QmltcCodeGenerator::generate_createTranslationBindingOnProperty. Added #if to avoid compilation error for standalone DOM compilation due to the new QQmlTranslation class. Task-number: QTBUG-105345 Change-Id: Iccd94d5cba4eaf63901233451fec48051c855c2a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@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>
* qmltc: Use correct output C++ file names within a moduleAndrei Golubev2022-06-291-0/+1
| | | | | | | | | | | | | | | | | | | | | Due to custom basenames in CMake qmltc can create non-default file names that contain the generated C++. This would cause troubles when locally importing such a custom-marked QML file from the same module. Resolve this by introducing a qrc-based mapping from source file name to C++ header file that the generated code would be put into Use the mapping information inside QmltcVisitor so that imported types are properly set Doing so, with some additional fixes around file paths collection, allows to get rid of the prototype code completely Fixes: QTBUG-104094 Pick-to: 6.4 Change-Id: I6a54774addf303449f35915df501ab3f47470c44 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Create a qrc mapping between build and source dir QML filesAndrei Golubev2022-06-291-0/+1
| | | | | | | | | | | | | QML tooling needs it in various places already As of now, support the mapping only for QML modules (created via qt6_add_qml_module) and enable it only if someone enables qmltc Pick-to: 6.4 Task-number: QTBUG-95151 Task-number: QTBUG-104094 Change-Id: I86d2351456b5b5b5fa88e16b35d51de493de58fd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QQml*ExtensionInterface: De-inline dtors of polymorphic classesMarc Mutz2022-06-281-1/+1
| | | | | | | | | | | ... fixing Clang -Wweak-vtables warnings, which we'll soon add to headersclean. Pick-to: 6.4 Task-number: QTBUG-45582 Change-Id: I02605febb3779e53530204447cfe65a3a72e2f80 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Address extension types in qmltcAndrei Golubev2022-06-021-0/+2
| | | | | | | | | | | | | | | | | | | | | Whenever working with properties (reading, writing, aliasing, etc.) of the type that has extensions, prefer the same-named properties from extension objects over type-owned properties (this is the internal QML mechanism) To achieve that, we need to query the extension object: * for Q_GADGETs use a dummy model of assuming we can cast the object to the extension type and use that * for Q_OBJECTs use a qmlExtendedObject() with additional logic of figuring out which extension should be picked in each specific case Create QQmlProxyMetaObject via a custom dynamic meta object API for qmltc-compiled objects that are derived from base types with extensions Task-number: QTBUG-91956 Change-Id: I5e783768ae2abdb9dddf894de7e79960244352bd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Replace synthetic AOT functions with property-to-property bindingsUlf Hermann2022-05-241-0/+1
| | | | | | | | | Those should be more efficient and make your feet attract fewer projectiles. Fixes: QTBUG-103588 Change-Id: I8b25b9edb1edf5e112dbcba5bba898646d29ae2b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add a TU for QQmlDebugServerConnection{,Factory} to de-inline dtor & includemocsMarc Mutz2022-05-091-1/+1
| | | | | | | | | | | | Destructors of polymorphic classes should be out-of-line. Header moc files should be included into the implementation files. Both need a TU, so add one. Task-number: QTBUG-102948 Task-number: QTBUG-45582 Change-Id: I2b59d18fb4530245cccace895ff86ab0634d9f55 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add a TU for QQmlDebugServiceFactory to de-inline dtor & includemocsMarc Mutz2022-05-091-1/+1
| | | | | | | | | | | | Destructors of polymorphic classes should be out-of-line. Header moc files should be included into the implementation files. Both need a TU, so add one. Task-number: QTBUG-102948 Task-number: QTBUG-45582 Change-Id: Ifbfb7f462aa94c7f7e2db8a179e06392f021e097 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add a TU for QV4::Debugging::Debugger to de-inline dtor & includemocsMarc Mutz2022-05-091-1/+1
| | | | | | | | | | | | Destructors of polymorphic classes should be out-of-line. Header moc files should be included into the implementation files. Both need a TU, so add one. Task-number: QTBUG-102948 Task-number: QTBUG-45582 Change-Id: Ia596ec1cab1e4c1f91e42cf217a7df7cbd0d91ad Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add a TU for QQmlDebugServerMarc Mutz2022-05-041-1/+1
| | | | | | | | | | | | | | | | This allows includemoc'ing, as well as de-inlining the destructor of this polymorphic class. Requires to rename the original qdebugserver.cpp, which turned out to be the implementation file for QQmlDebugServer_Factory_. I chose, surprise, qqmldebugserverfactory.cpp. The whole plugin could even be implemented in a single .cpp file, I guess. Task-number: QTBUG-45582 Task-number: QTBUG-102948 Pick-to: 6.3 6.2 5.15 Change-Id: I81aa4c60fa30ba5ced546afc72c5a4a3ba0e619f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Work around moc issue in static builds when building snippetsAlexandru Croitor2022-04-191-2/+5
| | | | | | | | | | | | | | | | | | | Static builds create additional targets for each resource, which are not covered by calls to qt_autogen_tools, and listing all of them manually is brittle. This ends up in an error at generate time: CMake Error: AUTOMOC for target qt_target_qml_sources_example_resources_3: The "moc" executable "~/build/qtbase/libexec/moc" does not exist Work around the issue by not building the doc snippets in a static build. Pick-to: 6.2 6.3 Fixes: QTBUG-99063 Change-Id: I313515a83d82f17a6930f7beeb7bb8acd7f8ce5b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* qmlmodels: Move QModelIndex from QtQmlMaximilian Goldstein2022-02-211-5/+0
| | | | | | | | | | | Moves the QModelIndex value types from QtQml to QtQml.Models as they cannot otherwise be properly resolved in tooling. Pick-to: 6.3 6.2 Fixes: QTBUG-100338 Change-Id: I30fc18b388974238ba8353e87ef09f57f8ceabd1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Remove the qml_sequence_object feature flagUlf Hermann2022-01-151-5/+1
| | | | | | | | | | | | | | | | | | | QML sequences are required for named lists of value types. The original reason for the introduction of this feature was the template code explosion caused by the way the sequence types were registered in Qt5. As we register them differently now, the code size overhead should be smaller. It makes very little sense to switch sequence types off these days. [ChangeLog][QtQml][Important Behavior Changes] The qml_sequence_object feature flag has been removed. Omitting sequences from the QML language does not make much sense now that we use them for lists of value types. The original reason to allow it was that the sequence support took up a lot of space in the binary. This is not the case anymore since 6.0. Change-Id: I2f1d43cdd29ba63853316b06113cb49ed30aa410 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix handling of QML_COMPILE_HASHUlf Hermann2022-01-071-16/+0
| | | | | | | | | | | We need to check for the contents of the tag file, not its name. We need to strip the contents before checking. We need to run git in the right directory. We need to fail if we cannot find any QML_COMPILE_HASH. Pick-to: 6.3 6.2 Task-number: QTBUG-99608 Change-Id: Ic42a073b196143f8576a84e7a4531b5f2927fb68 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Move QObject and QQmlComponent into builtinsMaximilian Goldstein2021-12-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | Previously we had two versions of QObject and QQmlComponent: a hand-written version in bultins and one that is generated from QtQml. We now move the QtQml version into builtins in order to allow for representing the JavaScript extensions that are present in these types. We also add some logic so that unused types will still react properly despite the fact that those components are no longer in QtQml. This is done by introducing the concept of static modules. These are modules that have side effects beyond simply provinding components. This applies both to when some components are in builtins instead of QtQml or when the global object is modified in some way (i.e. by adding an image provider). This is a tooling-only concept and does not affect how these modules are handled at runtime. Fixes: QTBUG-99025 Change-Id: Ifacaa836e4d2eef0521494f5a41363e053c90007 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use qmltc compiler prototype as a fallback implementationAndrei Golubev2021-12-171-0/+4
| | | | | | | | | | Task-number: QTBUG-91927 Task-number: QTBUG-96041 Task-number: QTBUG-84368 Pick-to: 6.3 Change-Id: I47320b5f3ed8efff6fb234778df5fae5be5b64f2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>