aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
Commit message (Collapse)AuthorAgeFilesLines
* QtQml: Eliminate another obtainCompilationUnit()HEADdevUlf Hermann7 hours1-13/+17
| | | | | | | | | | If the type reference is a self-reference we have already determined that the inline component exists (otherwise we wouldn't know it's an inline component). If not, we need to have a compilation unit we can use to check it. Change-Id: Ie86f17a42eda7ae9bb45d4f9560134903c1b7dde Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QtQml: Unify the lists of types and propertyCachesUlf Hermann7 hours3-32/+33
| | | | | | | | Each type has a number of propertyCaches. There's no need to keep them in separate lists. Change-Id: I62fd7a07ce56bc258c06df8efcbbf972143e3fd2 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Fix assert when destroying qqmltypeloaderthreadEven Oscar Andersen32 hours1-0/+2
| | | | | | | | | | | | | | | The stub implementation of shutdown that is used if !QT_CONFIG(qml_type_loader_thread) does nothing. Hence in this case the thread is running. Apparently the processing is event based in this case so this should not be a problem. Fix by only doing the assert for !running() if QT_CONFIG(qml_type_loader_thread). Change-Id: I93b4f75ce4a1babdb836d28a9cd5f75ef2b3cf54 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QtQml: Eliminate controversial obtainCompilationUnit() callUlf Hermann38 hours1-24/+15
| | | | | | | | We can deduce that this inline component type is either a self-reference or has a typeData. Change-Id: If04183079c88b30a4e651b21318987a3c0f464b0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Drop the interfaces container from QQmlMetaTypeDataUlf Hermann38 hours2-6/+2
| | | | | | | We have this information already in the QQmlType itself. Change-Id: If8d40b6b79eb65dcf30057db9828795b30d4b5c6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Re-order QQmlTypeData::TypeReference and ScriptReferenceUlf Hermann38 hours1-7/+6
| | | | | | | | | | This drops the size from 72 bytes to 48 byes on x86_64. We have a lot of type references. ScriptReference stays the same size, but the padding moves to the end. Pick-to: 6.11 Change-Id: Iab377ea1e5cec983a32c9c2d80369f624e3c8fa9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Do not load resolved CompilationUnits from other enginesUlf Hermann38 hours3-45/+9
| | | | | | | | | | | | | | | | | | | | | If the type loader doesn't have a QQmlDataBlob in its cache, then this engine hasn't ever loaded and resolved the respective compilation unit. We can't skip the type resolution then because the current engine may have different URL interceptors, import paths, plugin paths etc than the one that previously loaded the CU. This leads to different type resolutions. This should not re-open QTBUG-134398 since now the base compilation units are not shared between engines anymore, despite still being stored in the type registry. Amends commit 27c2c989a3d10557da15de3d45bb5bd7b96d14e8. Amends commit 6468df7657f6af4de8727363c7f7d97b680b1867. Pick-to: 6.11 6.10 6.8 Fixes: QTBUG-142658 Change-Id: I10139492c38b4a943ecca41928ec96097cd8bfbe Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Make metaObjectToType constUlf Hermann4 days4-6/+6
| | | | | | | Nobody needs to modify QQmlTypePrivate once it's created. Change-Id: I8c28cf1ce64852576df671e663f9d00b419e3350 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* QtQml: Fix sorting in CMakeLists.txtUlf Hermann4 days1-2/+2
| | | | | | Change-Id: I2ff9533f262deb906d359c25c02d31fa8e95c9ff Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Update flowchart to use CSS styling where possibleDavid Boddie4 days3-1/+216
| | | | | Change-Id: I1630b786a331d65e519e52914377ed5166a0d272 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QV4: Mark CompilationUnit::saveToDisk constOlivier De Cannière4 days2-2/+2
| | | | | Change-Id: I6141df5776471aea755d0b57b2015571b250088a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Qml: qqmljs.g adjust precedence and associativity of keywordsDmitrii Akshintsev5 days1-8/+14
| | | | | | | | This patch changes resolution of conflicts (dangling "else" and "as" ambiguity) using precedence only relationship, which should be sufficient. Additionally it makes most of the nonassoc keywords equal, instead of erroneous relationship that was there before. Change-Id: I8fea33214221af36021b7d122d6d044a09214309 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Doc: Improve documentation for console.exceptionUlf Hermann6 days1-2/+4
| | | | | | | | | | | console.exception() unironically throws an exception if you call it without arguments. Otherwise it's almost the same as console.error() but prints a stack trace in addition. Pick-to: 6.11 6.10 6.8 Fixes: QTBUG-119460 Change-Id: I99cc1c009310059d7bd5bbd8308436b832f41da7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Update docs about constructible value typesUlf Hermann6 days1-21/+5
| | | | | | | | | | | | You shouldn't use type assertions to create value types. That was a terrible idea. We can document the interaction with the 'new' operator now, though. Task-number: QTBUG-124662 Pick-to: 6.11 6.10 6.8 Change-Id: I94dbf47cfd72ef20a2d4758450634708590f8fec Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Elias Steurer <i@kelteseth.net>
* Qt.createQmlObject: Trim compilation unitsFabian Kosmale6 days1-0/+1
| | | | | | | | | | | | | | | | | | | | | | | When we call createQmlObject, a completely new compilation unit is created. If an object is stil in use, that compilation is obviously needed. However, if code is using createQmlObject repeatedly with the same URL, there's a good chance that the object was only temporarily needed. To avoid unbounded memory usage in that case, we call trimCompilationUnitsForUrl, to remove the no longer needed CUs. Note that this does not help if the URL is also changing dynamically, but we don't want to trim all caches, including ones the user might actually want to hold on. To handle such cases, we should rather 1. integrate the trimming logic with the gc 2. give it a separate, configurable "high water mark" 3. Use some proper caching system for CUs, e.g. LRU That is however out of scope for this commit. Pick-to: 6.11 6.10 6.8 Fixes: QTBUG-142555 Change-Id: I7ebb63abd9bb99531b6b6b2cf1f98b35b1e652e2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Improve easingCurve value type documentationHatem ElKharashy9 days2-13/+7
| | | | | | | | | - Reference the structured value type page. - Fix errors in snippet and text. Change-Id: I16eeb0f8c2d9d9d3f36ea0d0fe34087b7330a9c4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QtQml: Optimize fallback lookups a bitUlf Hermann11 days2-39/+42
| | | | | | | | | | We don't need to repeatedly query the metaobject for its properties just to determine the type. We can instead store the type right away. The same holds for the "resettable" flag. Task-number: QTBUG-142331 Change-Id: Ia8bb96587a344a2981e766e4bc2f13bcac7b4561 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QtQml: Invalidate fallback lookups after each call from AOT codeUlf Hermann11 days2-4/+13
| | | | | | | | | | Fallback property lookups are created for completely dynamic metaobjects. Anything about them may change between any two calls. Pick-to: 6.10 6.8 6.5 Fixes: QTBUG-142331 Change-Id: Ib732c37a6f27ab8105bea0eeae000af7eb9c36d7 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* doc: update qmlls documentationSami Shalayel11 days1-46/+60
| | | | | | | | | | | | | | | The setup part is mainly meant for qmlls client developers, so mark it as such. Add the download links to the standalone qmlls, in addition to qmlls's location inside of qt. Also document that build directories can be passed via an LSP extension, to support multiple workspaces. Remove the parts about import paths and documentation directories, those are handled by CMake's .qmlls.build.ini and can lead to weird behaviors when set incorrectly. Change-Id: I59496d20a9d02504636af6374818260c1e5f622d Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlPropertyCache expand Override Semantics. QML pathDmitrii Akshintsev12 days3-68/+335
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This path focuses on the actual expansion of Override Semantics with regard to newly added virtual and override keywords. Since Override Semantics is central to the way PropertyCache is being populated, expanding it requires additional care. To ensure smooth and reliable iteration, this patch isolates data-flows: within this patch adding properties from MetaObject stay "unaffected" by the expansion, as well as the paths adding Methods and Signals from the IR. This is done with the help of 3 things: 1. Separating logging logic from the Override logic 2. Extracting Override Semantics into it's own namespace 3. Adding a nob to control the set of rules To facilitate and separate testing of the logging logic and override semantics, the principle of dependency injection is being used, allowing us to easily Fake handling of override semantics, simplifying testing of PropertyCache::appendPropertyAttr Logging logic (messages) is kept on the side of QQmlPropertyCache mostly because this entity logically has more context to do proper logging. Taking into account how the class name and name of the property are handled, those are kept to be "requested on demand", a.k.a. query them only in cases when the logging indeed needs to be performed. Multiple append* methods have been moved to the private section to avoid invalidation of caches. See comment above QQmlPropertyCache. As a workaround to enable unit-testing of some methods, tst_qqmlpropertycache has been added as a friend class. This patch updates tests/auto/quick/qquicklistview/data/negativeDisplayMargin.qml to remove an unintended override of ListView’s built-in count property. The test declared its own count property, which implicitly shadowed ListView.count. The newly introduced validation correctly flagged this conflict, so the test has been adjusted accordingly. Change-Id: I809e58e421fa50f5ee7f21b31edbf926ad472736 Task-number: QTBUG-98320 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Replace QSequentialIterable with QMetaSequence::IterableUlf Hermann12 days7-46/+47
| | | | | | | | QSequentialIterable is deprecated. Task-number: QTBUG-140181 Change-Id: I797c18fa5c319e5c1a0114448d98a38aad33ae04 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* qmlls: document new cmakeJobs optionSami Shalayel12 days1-2/+18
| | | | | | | | | Describe the option and how to set it via a setting file, a commandline argument or a environment variable. Task-number: QTBUG-142352 Change-Id: I37da4ebed65e4228aaed0973b8d98b43af9f53e0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Document QML Override SemanticsDmitrii Akshintsev12 days2-22/+176
| | | | | | | | | | | | This patch introduces and consolidates documentation of the 'final' and newly introduced 'virtual' and 'override' property attributes under the section Override Semantics. The section explains their purpose, semantics, and interaction rules, as well as the rationale behind. It includes examples illustrating common cases as well as invalid modifier combinations. Task-number: QTBUG-98320 Change-Id: I2662b469180ec82983d42ad28a5836f8393250fa Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* cmake: improve .qmlls.build.ini writing processSami Shalayel12 days1-27/+31
| | | | | | | | | | | | Instead of writing each line via an "echo" command, collect all target specific .ini bits into a file, and then append that file into the .qmlls.build.ini file. Note that writing the .ini bits directly into .qmlls.build.ini is not possible because add_custom_command() eats away the newlines from its arguments. Change-Id: Ibc79aa69e227b1b46459109fd055a0e0dfe8b96c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: write qrc file paths to .qmlls.build.iniSami Shalayel12 days1-0/+5
| | | | | | | | | | Write qrc file paths to the .qmlls.build.ini. This ensures that qmlls doesn't pick up other modules .qrc files to avoid situations like QTBUG-141707. Fixes: QTBUG-141707 Change-Id: I4ea6756af7b12bf00e2f3f3338c0d5bfd792dc77 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QQmlPropertyData add doesOverride and isVirtual flagsDmitrii Akshintsev12 days2-29/+49
| | | | | | | | | | | | Currently Override semantics evaluation is based on the flags of QQmlPropertyData. Therefore adding this flags is necessary. On a bigger picture this patch focuses on the data flow from the IR to QQmlPropertyData (property cache) Change-Id: I206ee46a075675e37c35e4c72c74c68e132d2ef2 Task-number: QTBUG-98320 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Qml IR: add support for virtual and override keywordsDmitrii Akshintsev12 days3-8/+49
| | | | | | | | | | | | | | | This patch adds two new fields, IsVirtual and IsOverride, to CompiledData::Property. These fields will later be used to populate QQmlPropertyData and to handle property override semantics. At a high level, this change focuses on the data flow from the AST to the IR, laying the groundwork for future semantic resolution. Also moves test helper Syntax namespace to the quicktestutils Task-number: QTBUG-98320 Change-Id: Ic2a2e28df08d53c8752c49304bd5f7ff46916d08 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QML: Temporarily allow revisions 13 and 14 of moc in qqmlpropertycacheOlivier De Cannière12 days1-1/+3
| | | | | | | | | | | | | The revision change does not break qqmlpropertycache but will cause static_asserts failures while the patch adapting to the moc change is not merged. Temporarily allow for both revision and revert to 14 only as soon as poosible. Task-number: QTBUG-142186 Change-Id: I4ea37bff08f0780148ec7f8958a05f372a6df0f3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CMake: avoid warning twice when getting import pathsSami Shalayel2025-12-011-6/+10
| | | | | | | | | | Now that qmlls uses the same import paths as qmllint, we warn multiple times if the import paths are bad, once in the qmlls.build.ini generation code and once in the linting target creation part. Add a target property to avoid warning multiple times. Change-Id: If427e17dbf4e21cb0121bf2acced9dccb228e221 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Qml language: add virtual and override property attributesDmitrii Akshintsev2025-11-274-14/+94
| | | | | | | | | | | | | | | This patch introduces 'virtual' and 'override' keywords. From the grammar perspective they are qml contextual keywords, first of all to preserve backwards compatibility (do not break the users code if they had object attributes named "virtual" or "override") "final" is made qml contextual keyword for the sake of consistency (to treat all "virt specifiers" equally) Change-Id: Ice13a77c8b54ce8219cd45cc7085fb3f10a5e908 Task-number: QTBUG-98320 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Qml Profiling: Handle the case of profiling without any featuresUlf Hermann2025-11-272-6/+8
| | | | | | | | | | | | | | We cannot encode the "running" state of a profiling adapter into the features it's recording. It may be started with no actual features enabled and then we still need to stop it eventually. In order for the QmlProfiler test to work without the DebugMessages feature we still need to create the DebugMessages client, but ignore its output. Otherwise the logic that checks "unrelated" clients gets confused. Change-Id: I52a3c2bc55ea36454ab9c8c7f25fe833c7f14a43 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QQmlListProperty: restore NRVO in toList()Marc Mutz2025-11-261-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Found by GCC -Wnrvo, which we intend to add to headersclean. To fix, factor the tail part of the function into a private helper. This preserves git history on the complete original code, compared to the "usual" solution of wrapping the tail part of such functions in an IILE. Amends fa259ed4ff84a5952cdb6d2c6215e92d65afa56a. Note: The amended commit manually cherry-picked to 6.5, but only partially, and QQmlListProperty::toList() was not part of the pick. While this adds a new member function to a public class, this is forwards BC, because the added entity is a member function template. Member function templates are never part of the ABI, even if their class was inherited by a wholesale-exported class. Pick-to: 6.10 6.8 Task-number: QTBUG-142146 Change-Id: I3d559c6432b636608f94f29f03203111b6a95990 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Doc: Use QML markup in QML code blocksDavid Boddie2025-11-261-2/+2
| | | | | Change-Id: I9833c9c690b89e57ca511dd2a43e7a979c97367a Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
* QJSList: restore NRVO in slice(), join() specializationMarc Mutz2025-11-261-6/+6
| | | | | | | | | | | | | | | ... for <QQmlListProperty<QObject>, QObject *>>. Like in the primary template, return the same object in each return statement, fixing GCC -Wnrvo, which we're going to add to headersclean. Amends e84686415187455a7153d61ca82478053f13e3f9. Pick-to: 6.10 6.8 6.5 Task-number: QTBUG-142146 Change-Id: I38e9e8374e51d147cdaf4276fa791489117ee4e3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QJSEngine: fix -Wnrvo in coerceValue() and fromVariant()Marc Mutz2025-11-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... as a preparation of enabling the flag in headerscheck. The coerceValue() functions was actually flagged by GCC in a headerscheck including -Wnrvo, probably because it was instantiated for some type in inline code. The fromVariant() function was not flagged automatically, but found by manual inspection. Because the structure of code, with the pre-existing extra scope, lends itself naturally to it, wrap the code that doesn't already return rvalues in an IILE. Outside the lambda, the return is now RVO'ed, and inside, NRVO'ed. Manual inspection also found the qjsvalue_cast() overloaded functions, but I don't readily see a fix for them, so deferring. GCC doesn't warn for function templates unless instantiated, so for the purposes of headerscheck, we should be good with the status quo. Amends 7b29ed6f64a300d4d714371c2872fcba344beebd (coerceValue()) and d0f4e0c037cf61eb5bb559755ee7c9ce6cf6b7dc (fromVariant()). Pick-to: 6.10 6.8 6.5 Task-number: QTBUG-142146 Change-Id: I2aa0ecb5a1cdc975c2ab8dffb9fe333bbeb7bc0f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* qqlmjs.g: Remove expect statementFabian Kosmale2025-11-261-1/+0
| | | | | | | We do, in fact, not expect any parsing conflict. Change-Id: I2df5e27f42dbdd7660eb0383da3c2bb01c6fc84e Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QV4: Hotfix bump QV4_DATA_STRUCTURE_VERSION to invalidate broken cacheOlivier De Cannière2025-11-261-1/+1
| | | | | | | Task-number: QTBUG-142186 Pick-to: 6.10 Change-Id: I07228c1ddd9196532886ad3b39751d525c525432 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CMake: Allow qmlls.build.ini generation to be skippedUlf Hermann2025-11-262-9/+19
| | | | | | | | | We don't want a qmlls.build.ini to be generated on a module that's intentionally hidden from the outside world. That won't work anyway. Change-Id: I4231361ab4d786d661db19f80b5cf0de84cc0b35 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* qmlformat: Add GroupAttributesTogether optionXavier BESSON2025-11-251-3/+13
| | | | | | | | | | | | Equivalent to NormalizeOrder but reorder QML categories without sorting attributes (property definitions, property bindings, methods, signals, enums) Fixes: QTBUG-132060 Change-Id: Ib46ce4bb58ce46e3293d14954b0e363837b64b76 Original-patch-by: Oliver Kuss <oliver.kuss@okapp.de> Reviewed-by: Semih Yavuz <semih.yavuz@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Doc: Update links in qml-toc.qdocAlexei Cazacov2025-11-251-1/+5
| | | | | | Pick-to: 6.10 Change-Id: Id1cff25028f1e4b79bd53a44950b35643e08ce99 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QtQml: Fill in the const iterator functions in the empty sequenceUlf Hermann2025-11-241-0/+11
| | | | | | | | | | Without these you may get an infinite sequence when trying to iterate using const iterators. Pick-to: 6.10 6.8 Task-number: QTBUG-142097 Change-Id: Iae93063b240ebe9426804197533ed7efd8e007bc Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QtQml: Don't mark QJSValues on the AOT stackUlf Hermann2025-11-241-1/+10
| | | | | | | | | | | | QJSValue and QJSManagedValue hold persistent values which are marked elsewhere. QJSPrimitiveValue doesn't need to be marked at all. Amends commit 2d016a2653c59f10a57dc1903b817f71d16d0622. Pick-to: 6.10 6.8 Fixes: QTBUG-142097 Change-Id: I50d6405a684726a81ceee506b2d4f8b90330fcaf Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Doc: Use unambiguous link targets where possibleDavid Boddie2025-11-218-16/+18
| | | | | | | | | | | | | | Some links to sections within the same document were incorrectly going to other documents due to the way that QDoc handles duplicate section names. Additionally, documents containing duplicate section titles are not guaranteed to be handled as authors may expect. Links were changed to be more specific or removed in the case where the target was immediately after the original link. Change-Id: I78696519bd811dfe264561b799898a1d94b027dc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* Tooling: Add test for integrating event replay with qmlpreviewUlf Hermann2025-11-211-0/+4
| | | | | | | | | | | | This makes sure that the relevant debug services can coexist. In order for this to actually be true, we need to initialize the type loader before we initialize the various services. Otherwise the profiler service will initialize the type loader which will query the preview service for some directories, leading to a deadlock. Task-number: QTBUG-141569 Change-Id: Ia0873802b94b885654c693bdb9a96100cad492bf Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Doc: Make module links more precise, fix markupDavid Boddie2025-11-2012-40/+41
| | | | | | | | | | | QDoc can be inconsistent with link targets when there are duplicate page and section titles. Using link commands can help with more precise linking. In addition, code can be markup up as QML or using the \c command to make quoted content more accurate. Change-Id: I480b7cd301d5495201af926895a9bfec7b3bd9c8 Reviewed-by: Jerome Pasion <jerome.pasion@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QtQml: Optimize QQmlObjectCreator a bitUlf Hermann2025-11-181-9/+12
| | | | | | | | | std::move some strings into place, check condition only once, use constFind() and constEnd() where applicable. Coverity-Id: 897291 Change-Id: Icad3a49bc1137bc42de14f064cac111134993a2d Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* QtQml: Reset JS libraries and ES modules on clearComponentCache()Ulf Hermann2025-11-181-2/+13
| | | | | | | | | | | | | We can't drop the respective compilation units without re-opening QTBUG-128638 and QTBUG-128782. However, we can empty them out and force them to be re-evaluated. Since you can store arbitrary data in those libraries, this is important for a proper clearing of the component cache. You may hold on to a QObject that in turn holds on to other compilation units. Change-Id: Ie6bd3878c0d45086a7efade76ad5696bf8428acb Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* gc: Fix sweep logicFabian Kosmale2025-11-181-1/+43
| | | | | | | | | | | | | | | | | | | | | | | When sweeping chunks, we might end up allocating additional chunks in a custom destroy handler. This could cause the insertion of a new chunk into the chunk vetcor, in the worst case invalidating the iterators (in the slightly less worse case, we still have a chunk on which we don't call sweep, leading to meta-data corruption later on). Note that while the number of chunks can grow, it can't decrease. Therefore, we can fix the problem by replacing the iterator based partition with a size based one, which has additional checks in case the size has changed during the iteration. As a small optimization, wer run the loops without always checking for a size change first, and only afterwardts check for it (as allocating destroy handler aren't that common). Only afterwards we check if the size has changed, and rerun the loop on the remaining vector. Pick-to: 6.10 6.8 6.5 Initial-patch-by: Rafal Chomentowski <rafal.chomentowski@ge.com> Fixes: QTBUG-141963 Change-Id: If9429a4a9030ec64952426ac35c38d3ae250e18d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qqmldebugserverfactory: use file-based includeSami Shalayel2025-11-171-4/+4
| | | | | | | Qt Code should use file based includes. Change-Id: I19a5b583c0df9c2c418c322ee1221afa1517f77b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qqmldebugserverfactory: add qFatal() on QApplication leakSami Shalayel2025-11-172-2/+18
| | | | | | | | | | | | It seems that the QML debugger framework cleanup does not happen correctly when QApplication is leaked. Instead of running into the asserts of QQmlDebugServerImpl::removeService and ~QObject (during destruction of QQuickProfilerAdapter), warn the user with qFatal() about the possible leak of QApplication. Task-number: QTBUG-139131 Change-Id: If0497b3d4de4a1dec1bf968760d9fa79eb24683e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>