aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
Commit message (Collapse)AuthorAgeFilesLines
...
* QtQml: Do not speculatively create ICs for non-composite typesUlf Hermann2024-02-084-16/+15
| | | | | | | | | This just clobbers the type registry with useless trash. Pick-to: 6.7 6.6 Task-number: QTBUG-120506 Change-Id: I9c56930493cfbe343359f6cb22eac2a6c76d01a2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Re-allow assigning of raw numbers to enum property aliasesUlf Hermann2024-02-013-4/+12
| | | | | | | | | | | This used to work and we cannot just take it away. Amends commit 3ea55bf398412d373daab9c92b1498f45de70e96. Pick-to: 6.7 6.6 6.5 6.2 Fixes: QTBUG-121710 Change-Id: I7f856140286bba9d49b7ed1abfdf398a65fb1962 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Clear context objects more thoroughly on destructionUlf Hermann2024-02-012-15/+28
| | | | | | | | | | | | The same object can be the context object of a hierarchy of contexts. So far we would only clear one of them, leaving dangling pointers in the others. Clear all the contexts. Pick-to: 6.7 6.6 6.5 6.2 5.15 Fixes: QTBUG-119326 Change-Id: I509f257672813866e3736b51f430f1243a8577f0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlTypeLoader: Honor import dependencies even without qmldirUlf Hermann2024-02-011-22/+34
| | | | | | | | | If we register a module purely from C++, we still want to load the import dependencies. Change-Id: I3aa2d0e0b16a5f1c7c81d5fe7a130ec9d12d5c65 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QQmlProperty: fix signal handler warningFabian Kosmale2024-01-301-6/+7
| | | | | | | | | It should only be emitted if we find a signal of that name. Pick-to: 6.7 6.6 6.5 Fixes: QTBUG-118710 Change-Id: I15cf92c03dd7b46805e5a69078ca2beb6c862293 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Handle non-resettable undefined assignmentUlf Hermann2024-01-251-13/+28
| | | | | | | | | | | | We need to generate an exception if undefined is assigned to a property that can't be reset. We don't want to reject everything that can potentially be undefined. Therefore, we use the QVariant fallback and examine the value for undefined at run time. Pick-to: 6.7 6.6 6.5 6.2 Change-Id: I0a034032f4522f017b452690d93319eb4bfedb1c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Clean up QQmlTypeWrapperUlf Hermann2024-01-252-14/+31
| | | | | | | | | We can enforce that it always receives some kind of type and that the type doesn't disappear before it's deleted. We also don't have to cast a Heap::Base to get its engine. Change-Id: I7f95df64c254d6f4482a02782666e7cccea11ee8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move header verification into CompiledData::UnitUlf Hermann2024-01-231-1/+1
| | | | | | | | There is nothing that makes it depend on ExecutableCompilationUnit. Change-Id: I482dfc0177530f748bb90e5373c64ca5558d8629 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Remove some dead codeUlf Hermann2024-01-222-7/+0
| | | | | Change-Id: Ic3755748b849852c366a8681e858d60b02968273 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Use CompiledData::CompilationUnit in more placesUlf Hermann2024-01-2020-122/+158
| | | | | | | | | | We rarely actually need the executable CU, and where we need it, we can dynamically create or retrieve it from the engine. To that end, store all the CUs in the same container in the engine. Change-Id: I0b786048c578ac4f41ae4aee601da850fa400f2e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Make move ctors and operatos of QQmlNullableValue noexceptUlf Hermann2024-01-181-4/+4
| | | | | | | Amends commit 5f72764c876058e290e42b0b2f1e77d59f4c914d. Change-Id: Ie988f6c87119c605922602737da2824f6787805f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QtQml: Move dependentScripts into base CUUlf Hermann2024-01-182-8/+8
| | | | | Change-Id: Ia332a691a4a5f04fcca50eb1c3e2018f8368dbe6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move type name cache into base CUUlf Hermann2024-01-183-5/+6
| | | | | Change-Id: Ie3504f16b34859cdef72f8138e6058dcc2d1f58f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move qmlType into base CUUlf Hermann2024-01-184-6/+6
| | | | | Change-Id: I81ae9a4d24518dffc5b924994d45203958bb9546 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix build warning in tracepointAntti Määttä2024-01-181-1/+1
| | | | | | | Fix class vs struct missmatch warning Change-Id: I041eb2f4c5c49a2f54b95d91129d0c50eaa8770e Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* QtQml: Make addImportToNamespace() file-localUlf Hermann2024-01-172-7/+1
| | | | | | | We don't need to expose it. Change-Id: Ia61685ecc587eca3abd3e3772092199d2f67913c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: std::move() some variables instead of copying themUlf Hermann2024-01-171-2/+2
| | | | | | | Coverity-Id: 435193 Coverity-Id: 435196 Change-Id: I8a1b55ff0894f445aacd522ab26178a7eea08b90 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix some compile errors when compiling with -no-gui -no-qml-debugUlf Hermann2024-01-171-0/+2
| | | | | Change-Id: I33254477ad4535c898d1091b1275cc4d9a3de5d4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Assign unique placeholder names to anonymous metatypesUlf Hermann2024-01-172-4/+4
| | | | | | | | | They cannot all be called "*". This becomes an issue when we start to properly remove the unnecessary metatypes. Pick-to: 6.7 Change-Id: I189c0b8b32b5039884f2570df845fedbc62f6e94 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Don't create metatypes for procedurally registered compositesUlf Hermann2024-01-171-9/+14
| | | | | | | | | | | | | | We never want to find or insert them in the compositeTypes. Anytime an engine wants to use such a type it has to compile it all the way. Amends commit b48bb41681f561b59a4ce9c9d0ac95b23d5ccb1e. Pick-to: 6.7 Fixes: QTBUG-121014 Change-Id: I027f977643db01dac25d8fbc06a6d3e75a7183f5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Nicolas Fella <nicolas.fella@kdab.com>
* Trace: Update createInstance parameterAntti Määttä2024-01-171-2/+2
| | | | | | | The compilationUnit parameter type has changed. Change-Id: Idbef71d0cf66e52986a607bb130642c9f808ec7c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QtQml: Avoid a copy where we can move insteadUlf Hermann2024-01-151-1/+1
| | | | | | Coverity-Id: 434871 Change-Id: I1af42a125870c029550858997a424b56e85c7e97 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QtQml: Move property caches into base CUUlf Hermann2024-01-134-13/+16
| | | | | Change-Id: I1567c9d3d61312e98200fb0854d7fcf111983948 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move ResolvedTypeReference into base CUUlf Hermann2024-01-134-14/+15
| | | | | Change-Id: I25063457aad3a6d29a8c2a5b236f9a51b56a2f51 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move BindingPropertyData into the base CUUlf Hermann2024-01-134-8/+10
| | | | | Change-Id: I2edcb2c324919a1131ae490bee9c9b1140097b09 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move inlineComponentData and icRootName into base CUUlf Hermann2024-01-136-14/+18
| | | | | | Change-Id: I89e44644b083681f069d1d7a385bec68b4bfd80b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove the use of Q_QML_PRIVATE_EXPORTAlexey Edelev2024-01-1143-87/+87
| | | | | | Task-number: QTBUG-117983 Change-Id: I5790f01d614cd70c7fcc9bd817ec6ace3f3e3730 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add doc for gc()Tasuku Suzuki2024-01-111-0/+8
| | | | | Change-Id: I920acf76846bece462b518239fc4c068a0fad8c1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Extend the Q_IMPORT_QML_PLUGIN documentationAlexey Edelev2024-01-111-2/+14
| | | | | | | | | | | Add the explanation what is PluginName and how it's computed when using the modern QML API. Fixes: QTBUG-119372 Pick-to: 6.2 6.5 6.6 6.7 Change-Id: I7346f7b7f82c717ee79b07f4dcec0c0d1dc733b2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* QtQml: Clear stale compilation units more thoroughlyUlf Hermann2024-01-113-17/+47
| | | | | | | | | There are various places where we can still hold references. Clean them up when asked to do so. Also, free unused types and caches outside the type loader mutex, and only once on engine shutdown. Change-Id: Iae77cd6f50ad847d29a7eae4ac5c7c1c2524065d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move creation of ExecutableCompilationUnit into engineUlf Hermann2024-01-112-5/+6
| | | | | | | This is in preparation for letting the engine cache the executable CUs. Change-Id: Ideac10d8dda0784b41304b58f9b9fbd106173ea6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Remove QQmlTypeLoader from QQmlImportUlf Hermann2024-01-1116-123/+164
| | | | | | | | | The type loader belongs to the engine and we must not store it in engine-independent data structures. We do want the import cache to be stored in the type registry, though (in a separate change). Change-Id: I2828f5098b27bf1fc96852fc2bd160db44b109e7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Do detour through the CU for building property cachesUlf Hermann2024-01-111-1/+8
| | | | | | | | | | | | | This partially reverts commit bf2258e6f44f1279eee5e9c2dd595c5dd2020784. When building property caches we have to take the possibility into account that the QQmlType we have at hand is from a different QML engine. We therefore have to double check with our own QML engine. Pick-to: 6.7 Fixes: QTBUG-120189 Change-Id: If3b53a14b767f464318a61ed15d62077efd6bf61 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QtQml: When clearing the type loader, also clear any pending eventsUlf Hermann2024-01-103-0/+23
| | | | | | | | | | The events typically hold references to the data blobs they want to notify about. Those will prevent such blobs from getting cleaned up. Since we are explicitly asked to clear everything, we should also clear those. Change-Id: I476b071d78555a561396181128f2e915df13aeee Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Get rid of the module mutexUlf Hermann2024-01-104-32/+71
| | | | | | | | | | | | | It only exists so that the type loader can query pre-compiled and native modules from the loader thread. However, the type loader already has a mutex of its own. We can use that to inject a "native" blob into its script cache for the same effect. We need to get rid of the mutex so that we can use the module map for other compilation units, too. Change-Id: I5a9c266ea36b50f5ea69214110def644f7501674 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Always link executable CU on creationUlf Hermann2024-01-107-44/+45
| | | | | | | | | | | | | | | 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>
* QtQml: Make base CU a member of ExecutableCompilationUnitUlf Hermann2024-01-105-13/+23
| | | | | | | | | | | | 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>
* QtQml: Clean up QIntrusiveListUlf Hermann2024-01-091-183/+102
| | | | | | | | | Allow const iteration and move all the functions inline so that it becomes more readable. Change-Id: I0c7c9f6607519f842c86476dd6d7dfba65a38575 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move engine-specific data out of base compilation unitUlf Hermann2024-01-081-2/+1
| | | | | | | | | | We want to re-use the base compilation unit for different engines. To do that, we cannot have data in there that belongs to a specific engine. Pick-to: 6.7 Task-number: QTBUG-120189 Change-Id: I8e43e7ec6c1cd33249dc4ed15fec16babc6d06fb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Make QQmlNullableValue somewhat saferUlf Hermann2024-01-081-12/+59
| | | | | | | | We need it movable, and you shouldn't be able to poke its internals. Change-Id: Ia9fbde26ef525837402d9214aa534eeec0221e2f Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* Doc: Fix linking issues and missing QDoc commandsTopi Reinio2024-01-061-1/+1
| | | | | | | | | | | | | | | Fix multiple incorrect \l (link) command arguments that were not captured by documentation testing in CI. Add missing \endqml and \endcode commands to code snippets. Convert \sa commands that are meant to be related to specific \section commands into manual 'See also' paragraphs. Otherwise, they are listed at the bottom of the page. Pick-to: 6.7 Change-Id: Icf2a97f63b8b8cdec2d9398448d28759dabdb06b Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
* QtQml: Do not poison the type registry with unfinished enumsUlf Hermann2023-12-203-124/+88
| | | | | | | | | | | | If a composite type is not ready, yet, and we request its enums, we should not cache the result. To facilitate this, deduplicate the surrounding code and centralize the call to initEnums(). Pick-to: 6.7 Fixes: QTBUG-120084 Change-Id: I8386a3b44010a39470e886e93c5c64bfedac0b95 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Long live incremental garbage collection in QML!Fabian Kosmale2023-12-202-3/+6
| | | | | | | | | | | | | | | | | 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: Hide warning about cyclic dependencies between singletonsUlf Hermann2023-12-151-3/+3
| | | | | | | | | | Those are wrong most of the time. Since our dependency tracking is too coarse we cannot properly tell if this is an actual cycle. Pick-to: 6.7 Fixes: QTBUG-117827 Change-Id: Ib6779d6e1b04137119009ded5452157c09cfadc1 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QML: Use actual type for aliases of enum valuesUlf Hermann2023-12-051-9/+2
| | | | | | | | | | | | | | The metatype system and the compiler may disagree about the underlying type. It's generally better to pass the full type information. We can deal with it everywhere by now. Amends commit 3ea55bf398412d373daab9c92b1498f45de70e96 Pick-to: 6.6 Fixes: QTBUG-119531 Change-Id: I4744f5fb81fb5430ac040ec5877f7d0845a2ab12 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Drop the explicit ctor for QQmlScriptDataUlf Hermann2023-12-052-7/+2
| | | | | | | | A default one will do just fine. Coverity-Id: 428988 Change-Id: I58e52e3f9bdb6729cb5e81b5ef9653c7d2f2cafd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QML: Let IDs in outer context override bound components' propertiesUlf Hermann2023-12-042-6/+3
| | | | | | | | | | | | | | | | | | This is necessary to make the usage of such IDs actually safe. If we let local properties override outer IDs, then adding local properties in later versions invalidates the ID lookups. [ChangeLog][QtQml][Important Behavior Changes] In QML documents with bound components, IDs defined in outer contexts override properties defined in inner contexts now. This is how qmlcachegen has always interpreted bound components when generating C++ code, and it is required to make access to outer IDs actually safe. The interpreter and JIT have previously preferred inner properties over outer IDs. Pick-to: 6.6 6.5 Fixes: QTBUG-119162 Change-Id: Ic5d3cc3342b4518d3fde1b800efe1b95d8e8b210 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Fix linking to Qt Qml moduleTopi Reinio2023-12-011-1/+1
| | | | | | | | | | The module landing page has been renamed in af0539c7bb6f46e89523054c09d5d846ae55f355. The correct link target is 'Qt Qml'. Change-Id: I4a13348948fe1577e7a62edbb49a0d99f9695322 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlConnections: Allow connections to C++-defined methodsUlf Hermann2023-11-293-46/+95
| | | | | | | | | | | | | | | | | | | | With qmltc you can produce classes derived from QQmlConnections with handler methods that should still receive the signals. Introduce a new helper class QQmlConnectionSlotDispatcher that enables connections to a C++ method inside a QQmlConnections, in the same way as QQmlBoundSignal does for Javascript functions. Change QQmlConnectionsPrivate::boundsignals to allow for C++ slots using QQmlConnectionSlotDispatcher. This allows usage of Connections QML elements when they are compiled to C++ via qmltc. Pick-to: 6.6 6.5 Fixes: QTBUG-119084 Change-Id: I05d78a45a703630f43d37337268d0a3df341e7d3 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Fix \fn template arguments for Qt QmlTopi Reinio2023-11-271-2/+2
| | | | | | | | | | | | | Upcoming changes to QDoc require accurate definition for template arguments in \fn commands. Qualify links to qmlRegisterType() with QQmlEngine scope; this is a workaround for a problem in QDoc that will be addressed separately. Task-number: QTBUG-118080 Change-Id: I78dbbc2770e9d2fe9a7c20a5858c412fb1ae0fd8 Reviewed-by: Paul Wicking <paul.wicking@qt.io>