aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
Commit message (Collapse)AuthorAgeFilesLines
* QML: Port QV4::CompiledData::Location to new special integer bitfieldUlf Hermann2022-05-173-6/+13
| | | | | | | | Task-number: QTBUG-99545 Change-Id: If0d6f893f2351a4146ddf125be4079b5e312f308 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit 893b6ae6e890a2b8fc842d9c9cc64b9b8f34e22f)
* QML: Port QV4::CompiledData::Object to new special integer bitfieldUlf Hermann2022-05-171-6/+7
| | | | | | | | Task-number: QTBUG-99545 Change-Id: Ia57a16313e883a8d4dab15c971181440ed1d2214 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit 745cce4391a8b6255605cb304d8bc14b11168423)
* QML: Port QV4::CompiledData::Binding to new special integer bitfieldUlf Hermann2022-05-171-1/+1
| | | | | | | Task-number: QTBUG-99545 Change-Id: I9f8bc5fa45c61f77ee95b055a3d8de001da8f8c5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 36ebee4e69182f0e44d87691d4740b271e1dcf38)
* QML: Port QV4::CompiledData::RegExp to new special integer bitfieldUlf Hermann2022-05-121-2/+2
| | | | | | | | | Task-number: QTBUG-99545 Change-Id: I37be080387bf086d84761b056140cc5a99d161ed Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit da09f7c3d8962b4521189c96adf1ed0e1da3e8dd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Port QV4::CompiledData::Lookup to new special integer bitfieldUlf Hermann2022-05-121-2/+2
| | | | | | | | | Task-number: QTBUG-99545 Change-Id: I8cc6db56642f1cd2d16e80ba5c49ffd7c6fdcd8c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit 6d92633f32ff2089b8f0a39e07f0d40bf57d8011) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Port icutils::Node to new special integer bitfieldUlf Hermann2022-05-121-1/+1
| | | | | | | | Change-Id: I46f4f21bda1360d09e2c49a1f04dbe411fb46f7d Task-number: QTBUG-99545 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit eca5dcab020a60a53c0ad1b130cf2873d3feff3e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Port QV4::CompiledData::JSClassMember to new special integer bitfieldUlf Hermann2022-05-121-2/+2
| | | | | | | | | Task-number: QTBUG-99545 Change-Id: I0a7d86450011f1664d61db4d78317dafbcfbb8cf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit b5a8a6943ab979e23db284780df9209af5ae03a8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qv4string: port away from std::aligned_storageMarc Mutz2022-05-101-1/+1
| | | | | | | | | | | | It's deprecated in C++23. Just use an explicitly-aligned char array directly, wrapped in a struct to avoid decays to char*. Task-number: QTBUG-99122 Change-Id: I9b876534502363e40247cde3db315330efa0454b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 299b629651626977f01dfe893980ce01d1f021e8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* V4 Engine: Don't try to convert JS functions to other typesUlf Hermann2022-05-091-1/+4
| | | | | | | | | | | | When converting a JS value to a variant, if we notice that we get a QJSValue again, there is no point in trying to convert it further. We'll just run into infinite recursion. Fixes: QTBUG-102545 Change-Id: I0a40e21287e5460e5e214101aabe8d2b4bf0afad Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 2bed3d5f0ff7de2774e8e4a1ea164063e8d5aa0c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QtDeclarative: replace qSwap with std::swap/member-swap where possibleMarc Mutz2022-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | | qSwap() is a monster that looks for ADL overloads of swap() and also detects the noexcept of the wrapped swap() function, so it should only be used when the argument type is unknown. In the vast majority of cases, the type is known to be efficiently std::swap()able or to have a member-swap. Call either of these. For the common case of pointer types, circumvent the expensive trait checks on std::swap() by using our hand-rolled qt_ptr_swap() template, the advantage being that it can be unconditionally noexcept, removing all type traits instantiations. In QQmlPropertyCacheAliasCreator, replace the qSwap() with std::move(). Task-number: QTBUG-97601 Change-Id: I8b78a3ad287ce8565ca258ff38261e4d2cf0be63 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit eff31bf486c2f6b9fcc43e526566cd381aad2d6f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Qml: includemocsMarc Mutz2022-04-302-0/+4
| | | | | | | | | | | | | Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Task-number: QTBUG-102948 Change-Id: Ie39c60a19ba562affe6bd52ba68b38db95298cf3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 26992a29c6ec1697fe6cec3379b37d1c9b203947) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Adapt qv4engine to stack size on AndroidAndreas Buhr2022-04-141-0/+9
| | | | | | | | | | | | Adapt maximum stack size to not run into segfaults due to stack overflow. Task-number: QTBUG-102384 Task-number: QTBUG-96788 Change-Id: I4ba3518369c822b1b2d93388817beb7f86d19cdc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 38d455dca051d7580449553d85b88d5df9d2162a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* V4 ArrayIterator: Protect retrieved value from GCUlf Hermann2022-03-251-3/+3
| | | | | | | | | | | | When constructing the iterator return object, the garbage collector may run, and drop the element value we want to return. Fixes: QTBUG-101700 Change-Id: I60c9b0b9fbb9e784fa089a8b5bb274d02ef7fc1f Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 185760fa44f5b62f1ed3f10a458f4bc38072768f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QmlCompiler: Fix a number of warts regarding type lookupUlf Hermann2022-03-252-3/+3
| | | | | | | | | | | There was a condition missing in qqml.cpp making most type lookups crash right away. Furthermore, we need to generate code for type lookups we do need. Fixes: QTBUG-102019 Change-Id: I34e9de7686528b39a35e59c616e4e28b32a6e031 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 5901fba81195ed725ffd7ad6c278e44f41b6df6f)
* QQmlPropertyCache: Store checksums in type loaderUlf Hermann2022-03-144-6/+10
| | | | | | | | | | | | | | The type loader is specific to the engine. This way we can calculate/retrieve the checksum without modifying the property cache, which makes checksum() threadsafe. The checksums are only needed for loading and storing compilation units from/to disk. Therefore, there is no point in keeping them inside the property caches anyway. Task-number: QTBUG-73271 Change-Id: I7bea65e73769f76352bb5947d7229e256e7f2f25 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit a2184b9ab7469bc5ca36478394243a04cda9006c) Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* ExecutionEngine: Move initialization of statics into separate methodUlf Hermann2022-03-052-68/+87
| | | | | | | | | | | ... and do it only for the first engine (ie engineId == 1). The engineId is determined using atomic operations, so this is safe now. Task-number: QTBUG-73271 Change-Id: Ife38213fe04e26f35425a29230a2e3b586572dd2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 6fb63032966cc27cc11ce3686e97b185fdb3cb6b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Handle dynamic meta objects in AOT lookupsUlf Hermann2022-03-043-0/+12
| | | | | | | | | | | | If we are dealing with dynamic metaobjects, the QML engine may not create property caches. We cannot see this at compile time. Therefore, we need to establish a fallback infrastructure that does the same operations on plain QMetaObject. Fixes: QTBUG-101349 Change-Id: I8c936fc077b0018df71196620b6987825253cb39 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 1e722f5e8e6510f3a1bc10436f8262c918ca9599)
* qmlmodels: Move QModelIndex from QtQmlMaximilian Goldstein2022-02-221-1/+1
| | | | | | | | | | | | Moves the QModelIndex value types from QtQml to QtQml.Models as they cannot otherwise be properly resolved in tooling. 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> (cherry picked from commit e2864d6aa97d246546514ec0f97263574d19ec47) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Avoid spurious dependency on qml_compile_hash_p.hFabian Kosmale2022-02-141-0/+2
| | | | | | | | | | | | | The compile hash changes on every commit, so including it in a central header like qv4compileddata_p.h would cause many spurious rebuilds. As we only needed it there for a static assert, we can simply move that check into a source file. Change-Id: I9f24cb3faf5172023b0ece9e6aa07db02638c8be Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 28b32ae449913d079f220110ffa90de9a9ee9784) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* V4: Do not call dtor of an object we continue to useUlf Hermann2022-02-041-3/+2
| | | | | | | | | | | | | | | | | | | After destroyObject(), the QObjectWrapper is still alive. We might use its heap object again. Furthermore, the Heap::QObjectWrapper dtor does not actually do anything defined. What we want to do here is clear the QObject pointer because we've just gotten rid of the QObject. There is a method for that: Heap::QObjectWrapper::destroy(). Finally, the internalClass must never ever be nullptr. Assert on that rather than checking it. Task-number: QTBUG-100431 Change-Id: I794a295c182b2ed4ba80673f58d6143c861b7391 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 6c197319f34b8098d034f1543eb5feb9d7be54c3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* V4 Date: Support another nonstandard date format QDateTime has droppedUlf Hermann2022-02-031-0/+2
| | | | | | | | | | | | Amends commit 43eaa77e8ed03153335c0002dcc8b660c39a0beb. Fixes: QTBUG-100377 Change-Id: I01028bd991b8a64bd9dcad31ce90536d83dad0a1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 41a5c7b223d958bd40240aee81bb8fb96540735d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Adjust default max call depth for QNXUlf Hermann2022-01-261-0/+4
| | | | | | | | | | | QNX by default has smaller stacks than other platforms. Change-Id: Ia83d4e12c0fd24c51069777db2283d456c49800f Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io> (cherry picked from commit 7680fc7beed9c9f8e3883ac1796ef332cf40a4c8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Further tighten checks around QML_COMPILE_HASHUlf Hermann2022-01-211-4/+10
| | | | | | | | | | Log the differing hashes in case of a mismatch. Task-number: QTBUG-99608 Change-Id: Id85306d3cfdb08d235c8717b441105c5d0b68cf3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit ed6b31389ac554287b4e00a6ad743e6ebf72160f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* SequenceObject: Define length accessors on the prototypeUlf Hermann2022-01-181-76/+71
| | | | | | | | | Re-defining them for each single sequence object is quite expensive. Change-Id: Ia7a602aada6f9904dd3a72ad5788482576170d9e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 615406f09a89ef8e0ec820084e646fc911f1535a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix handling of QML_COMPILE_HASHUlf Hermann2022-01-071-2/+2
| | | | | | | | | | | | 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. Task-number: QTBUG-99608 Change-Id: Ic42a073b196143f8576a84e7a4531b5f2927fb68 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 0616a44e8ad0faa9c441212e281a61136c287f73) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Do not copy lookupsUlf Hermann2021-12-175-70/+110
| | | | | | | | | | | | | | It leads to data corruption. Also, be more careful about releasing the property cache. We can only do that if the qobjectlookup member of the union is active. Unfortunately we have to do a number of checks now, to make sure it is. In order to still keep the checks inline, we move some functions around. Fixes: QTBUG-99211 Change-Id: If6dd879e67b172e1a9035e83fbfacbe73c6c7476 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit de587f1c55ce27ed332e0810eb8768b287212bcf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert accidental change in qv4qmlcontext.cppUlf Hermann2021-12-121-2/+1
| | | | | | | | | | | Amends commit 90790ef23bb148b4ac4c055bd3c11153b4c9a502. As detailed in the commit message of that change, we don't know if it's actually safe to skip the work if we've already set up the lookup before. We should indeed overwrite it. Pick-to: 6.2 Change-Id: I27cc4dd256599c292f748b2b70cc2519baabb32c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlJSAotContext: flushPendingBinding() before capturing a propertyUlf Hermann2021-12-101-1/+1
| | | | | | | | This avoids duplicate evaluation and binding loops. Pick-to: 6.2 Change-Id: I5eba42d9dca0782dd964bd64c088c2e158faa9b3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* V4 Lookup: Do not leak property cachesUlf Hermann2021-12-093-16/+37
| | | | | | | | | | | | | | | | | | | | | | When a function that performs a lookup is called recursively via the flushing of initial bindings, we may initialize the same lookup twice. In that case, make sure to release the old property cache before overwriting it. We might suspect that this can only re-assign the same property cache again and therefore we can skip the whole operation if it has been done before. Yet, considering the dynamic nature of QML, it's very hard to guarantee this. There are cases where we have to revert lookups because the types don't match anymore at the time we call them again. I cannot rule out the possibility of this happening during initialization. Therefore, the code doesn't try to be clever about this case and instead just blindly overwrites the lookup (like it did before, just without leaking). Fixes: QTBUG-99025 Pick-to: 5.15 6.2 Change-Id: I536deef282bbff723f79a82e4d9e694c3d2d32df Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Fix return type calculationUlf Hermann2021-12-061-2/+4
| | | | | | | | | | We can return void from a function, explicitly or implicitly, and we need to be able to wrap that into a QVariant. In order to explicitly return void, we need the void type to be exposed and understood. Pick-to: 6.2 Change-Id: I513cabb25469b89a85b5d212a6825a037400729d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlTypeNameCache: Unify querying for typesUlf Hermann2021-12-031-1/+1
| | | | | | | | | | | | | | | Template all of the code and make sure the different query variants do the same work. There is no reason not to query the namespaced imports if we are passed a different string type as parameter. If we want to skip the namespaced imports, that is a separate parameter. This needs to be picked to 6.2 as precondition for fixing AOTCompiledContext::initLoadAttachedLookup. We need to pass a QQmlImport::RecursionRestriction when querying by QHashedStringRef. Pick-to: 6.2 Change-Id: I98aecc7775036728668cc93f550aa73fdefafe9a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix life cycle methods of various types related to QQmlBindUlf Hermann2021-11-122-12/+15
| | | | | | | | | | | Code checker complains about the absence of move ctors and operators. While we're at it, make ctors default where possible, do not use const rvalue refs, add noexcept where possible, properly disable moving and copying of QQmlBindEntryContent, and inline the null check of QV4::PersistentValueStorage::free(). Change-Id: I11b6511f39f3d84479dbacee7f3e3552a5fb2b5a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QV4::QObjectWrapper: Clean up CallArgumentUlf Hermann2021-11-091-258/+323
| | | | | | | | | | | Prefer comparison of metatypes by type rather than ID. When still comparing by ID take advantage of switching through the builtin types. Furthermore, restructure the code for more clarity and consistently apply the qml_sequence_type guards. Change-Id: I7572ba644621ac551ae1821a59229b60c1485a1d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Clean up PropertyCache life cycleUlf Hermann2021-11-093-15/+13
| | | | | | | | | | | | | We generally want to use QQmlRefPointer for it, rather than manually calling addref() and release() all over the place. Also, we can completely inline its ctor and drop an unused member. Also, do not keep property caches of dynamic meta objects in type registry. The dynamic metaobjects will change, and the outdated property caches will eventually be retrieved. Change-Id: I8042c85b32f3031b554f97a35c1545a3412d2acb Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Clean up some includesUlf Hermann2021-11-052-17/+17
| | | | | | | | | We should not include qqmlglobal_p.h just for the export macros as that pulls in a number of other things. Rather, include qtqmlglobal_p.h for that. Change-Id: Iecb60ef676dd880c0d94360ccef6517ef1ec73bf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Replace all includes of windows.h with qt_windows.hUlf Hermann2021-10-254-4/+4
| | | | | | | We don't want min and max to be macros. Change-Id: Ifa79eaecf00c9f8b9c61494aa9d883eebfdabc65 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QV4::QObjectWrapper: Improve overload resolutionUlf Hermann2021-10-211-39/+59
| | | | | | | | QQmlV4Function should be used as the last fallback if there are other options available. Also, take QVariantMap into account. Change-Id: I9ebf39f4f860cf3bf44c6cbc80efbac7ea30c70b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Improve type conversions from/to QJSValueUlf Hermann2021-10-203-4/+10
| | | | | | | | | We can convert everything into a QJSValue if we have an engine and we can save a binding function in a QVariant by wrapping it into QJSValue. Change-Id: I48e7c13f3f744f1c50bf673b427fe9331250f313 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add a Pragma for list assign behaviorUlf Hermann2021-10-131-0/+9
| | | | | | | | | | [ChangeLog][QtQml] You can now specify the list property assignment behavior in QML using the "ListPropertyAssignBehavior" pragma. This is analogous to the macros you can use in C++. Fixes: QTBUG-93642 Change-Id: I9bdcf198031f1e24891f947b0990a3253d29a998 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Avoid QAbstractDynamicMetaObject where possibleUlf Hermann2021-10-121-1/+4
| | | | | | | | | | | | | | | | | | | | | We don't want to copy metaobjects, but QAbstractDynamicMetaObject forces us. Rather, use plain QDynamicMetaObjectData, and store a pointer to the actual metaobject. This requires us to drop the "isDirect()" optimization for property access, as we realize that there can be dynamic meta objects which are not QAbstractDynamicMetaObject. However, this optimization was questionable anyway. What it did was cache the fact that an object might have a dynamic metaobject in a flag. Checking this on the object itself should not be much more expensive, though. On the other hand, an object might receive a dynamic metaobject individually without us adjusting flags for its type. In that case we would call the wrong method. Furthermore, most property access can be done using the static metacall function anyway. Change-Id: I5897351253496309721bd38adf3e35a1f069b080 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix missing whitespace after `argv[N]:` patternIvan Tkachenko2021-10-074-5/+5
| | | | | Change-Id: I6657ffd1e29124211642c62f719057cfe9b2aa6c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix warnings when which are treated as errors with -developer-buildAssam Boudjelthia2021-10-041-5/+5
| | | | | | | | Pick-to: 6.2 Task-number: QTBUG-91163 Change-Id: I7fdac1ff11b4e1c5a6b0caa6cbeae67ddc3effc4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add comments to use qsizetype for some APIs in Qt 7Assam Boudjelthia2021-10-041-0/+2
| | | | | | Task-number: QTBUG-91163 Change-Id: Iee52fce16d899a2a72277e314d7dc65b27da3b88 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* disconnectNotifiers() more aggressively during object deletionUlf Hermann2021-09-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | When an object is queued for deletion, there is no point in notifying anyone anymore. The change notifications almost always result in the property that changes being read. Reading a property from a half-deleted scope object silently returns undefined, no matter what type the property is. Reading a property from a half-deleted object via some qualified lookup throws a type error. Neither of those is useful. Furthermore, when an object is deleted, often a large number of properties change, triggering a lot of unnecessary computation. [ChangeLog][QML][Important Behavior Changes] When an object is queued for deletion, for example because its parent object is being deleted, then all of its change notifiers are dropped. This means no binding or signal handler that depends on properties of such an object will be triggered anymore. As you cannot read properties from such half-deleted objects anyway, there was never a point in being notified about further property changes. There may be corner cases where the notifications are used for some unrelated processing, though. Task-number: QTBUG-95262 Change-Id: I7bab0e42dd892921be259ea764160f99a46a322d Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add "As" function to symbol tableUlf Hermann2021-09-061-0/+1
| | | | | | | Fixes: QTBUG-96099 Pick-to: 6.2 Change-Id: I0bc50c0a66759c36dc50b2d6ef8e16be8fbba45c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use value type providers in metaTypeFromJSUlf Hermann2021-09-061-19/+9
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-96144 Change-Id: If12f669ae33bb8ae4768ca79e4ca985f70a2651d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove workarounds for AndroidFabian Kosmale2021-08-241-41/+0
| | | | | | | | | | | Modern NDKs should have all the math functions. Change-Id: Id0bd655c0143436b42dd507d8e8034ffb452e75b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Upgrade std::is_trivial::value to C++17 std::is_trivial_vIvan Tkachenko2021-08-248-11/+11
| | | | | | | | | Since Qt 6 requires at least C++17, we can finally make use of some of its goodness. Change-Id: I56a318bc0b1b60d1e2b0186f335f8feda7622df4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* When binding signals, run the outer function to get the nested oneUlf Hermann2021-08-171-0/+1
| | | | | | | | | | | | | | | The outer function may perform important tasks like setting up a call context with a "this" member for the nested function. In particular, arrow functions retain their original "this" member, no matter where they are executed later. We can detect this condition while generating the compilation unit. If the outer function is not a simple wrapper that only returns the inner function, execute it when binding a signal. Fixes: QTBUG-95659 Pick-to: 6.2 Change-Id: I7dfef2c78378588e6bfc4bedde7889c7f2ce03ef Reviewed-by: Yuya Nishihara <yuya.nishihara@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
* Finally drop last references to v8Ulf Hermann2021-08-164-0/+301
| | | | | | | | Move files out of the v8 directory and adapt some comments and member names. Change-Id: I36dd9eaf6f51157627327bf46442a54c79a616a5 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>