aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/common
Commit message (Collapse)AuthorAgeFilesLines
* QtQml: Properly enforce signatures of AOT-compiled functionsUlf Hermann2024-04-261-1/+1
| | | | | | | | | | | | | Pass the metatypes of the contained types rather than the stored types. [ChangeLog][QtQml][Important Behavior Changes] The AOT compiled code for type-annotated JavaScript functions does not let you pass or return values of the wrong type anymore. Fixes: QTBUG-119885 Change-Id: I685d398c0745d32a999a3abd76c622a2c0d6651f Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Consider lengths to be qsizetypeUlf Hermann2024-04-262-5/+30
| | | | | | | | | | | | | | | | | | | | This is what we get as "source material" from all the containers. In JavaScript, arrays sizes are up to 32bit unsigned, but we need to represent -1 in a few places. Therefore, we cannot clamp the result to 32bit signed if the underlying container supports 64bit indices. We can change qjslist.h here because this header is only supposed to be used from generated code. Therefore, if you rebuild any users of this code, you will also re-generate them, adapting to the new API. Since we check for QJSNumberCoercion::isArrayIndex() before we use any number as an array index when generating code, this is actually safe. We just need to adapt isArrayIndex() to consider numbers greater than INT_MAX as possible values. Fixes: QTBUG-122582 Change-Id: I1147978a05bfedb63037c7f4437921f85a6aabb1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Perform return value assignment inside generated codeUlf Hermann2024-04-241-1/+1
| | | | | | | | | | | | This is in preparation for using exact types and actually enforcing them. We shouldn't wrap the return value into a QVariant in order to then painstakingly unwrap it again. The generated code can already do the right thing. Task-number: QTBUG-119885 Change-Id: I13e517967ee982be717024a9abb74d5e02a185d6 Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Silence bogus warning on mingwUlf Hermann2024-03-251-0/+7
| | | | | | Change-Id: I51e2f8c7017a4c1c479e95b7fbee9355adb2e5e9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QtQml: Make QLocale an actual value typeUlf Hermann2024-03-021-5/+0
| | | | | | | | | | | | | | | | | | | | We want to be accessible to qmllint and other QML tooling. To this end, make all legal invocations of its methods properly typed invokables. Keep two QQmlV4Function overloads to produce error messages if the methods are called with the wrong parameters. We have to do this because JavaScript is more liberal in its argument coercion than the methods would like. Un-deprecate QJSNumberCoercion::isInteger() since it's actually quite practical here. Pick-to: 6.7 Fixes: QTBUG-112366 Change-Id: I016e5edc47efaade44461c504c1b3e2b1b829b58 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* V4: Switch the sticky and unicode regexp flagsUlf Hermann2024-02-151-3/+3
| | | | | | | | | This way they match Yarr's flags, which is generally preferable. Task-number: QTBUG-121509 Change-Id: Ibb3ed8d54c54415435f12bf391daadaa70013017 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* QtQml: Re-allow assigning of raw numbers to enum property aliasesUlf Hermann2024-02-011-0/+2
| | | | | | | | | | | 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: Move header verification into CompiledData::UnitUlf Hermann2024-01-232-0/+68
| | | | | | | | 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: Use CompiledData::CompilationUnit in more placesUlf Hermann2024-01-202-0/+140
| | | | | | | | | | 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: Move the property cache creator interface into the base CUUlf Hermann2024-01-181-1/+46
| | | | | Change-Id: I521b00754593dee600465047b3fe9a57d614bc77 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move dependentScripts into base CUUlf Hermann2024-01-182-0/+4
| | | | | Change-Id: Ia332a691a4a5f04fcca50eb1c3e2018f8368dbe6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move type name cache into base CUUlf Hermann2024-01-182-6/+12
| | | | | Change-Id: Ie3504f16b34859cdef72f8138e6058dcc2d1f58f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move getters for flags into base CUUlf Hermann2024-01-181-0/+45
| | | | | Change-Id: I6bf0bd06e489d07517a9fba6f675c402e9beddbb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move qmlType into base CUUlf Hermann2024-01-182-0/+12
| | | | | Change-Id: I81ae9a4d24518dffc5b924994d45203958bb9546 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move checksum verification into base CUUlf Hermann2024-01-132-0/+17
| | | | | Change-Id: I49d48a7bc38e727bb23f3154311e1f7876f8cc03 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move binding, object and parser status counts to base CUUlf Hermann2024-01-132-0/+29
| | | | | Change-Id: Id52e3d50b02649010ebcb2309253aa689a536770 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move inlineComponentId() into base CUUlf Hermann2024-01-131-0/+13
| | | | | Change-Id: Icfc234c0354c27f8ff353f49c16c3d99a14e7ea7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move property caches into base CUUlf Hermann2024-01-131-0/+8
| | | | | Change-Id: I1567c9d3d61312e98200fb0854d7fcf111983948 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move ResolvedTypeReference into base CUUlf Hermann2024-01-132-17/+68
| | | | | Change-Id: I25063457aad3a6d29a8c2a5b236f9a51b56a2f51 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move BindingPropertyData into the base CUUlf Hermann2024-01-131-0/+9
| | | | | Change-Id: I2edcb2c324919a1131ae490bee9c9b1140097b09 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Move inlineComponentData and icRootName into base CUUlf Hermann2024-01-131-3/+28
| | | | | | 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-111-3/+3
| | | | | | Task-number: QTBUG-117983 Change-Id: I5790f01d614cd70c7fcc9bd817ec6ace3f3e3730 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QtQml: Get rid of the module mutexUlf Hermann2024-01-102-4/+44
| | | | | | | | | | | | | 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-102-0/+122
| | | | | | | | | | | | | | | 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-101-28/+4
| | | | | | | | | | | | 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: Move engine-specific data out of base compilation unitUlf Hermann2024-01-081-55/+9
| | | | | | | | | | 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>
* Add pragma syntax to support translation contextLucie Gérard2023-10-261-1/+15
| | | | | | | | | | | | | Translator pragma can be used to set the translation context instead of having the file name used [ChangeLog][qml][translation][Important Behavior Changes] The context for the translation can now be controled in a given file using pragma Translator. Task-number: QTBUG-114528 Change-Id: I6d9d7fb81ea969a90d8637d7277bdbe96c102088 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix compile time qsTranslate with empty contextUlf Hermann2023-10-241-1/+2
| | | | | | | | | | | | | | | | | An empty context is to be passed as-is. We shall not replace it with the file context context. Since the TranslationData struct has a field for the context, we need to invent a "no context" value we use for the methods that don't allow you to set a context (e.g. qsTr, qsTrId). We cannot use 0 because that is the empty string which is a valid context now. Amends commit 9cfc19faf5d1ce2b9626914ab4528998b072385d. Pick-to: 6.6 6.5 Fixes: QTBUG-118469 Change-Id: I160c512f42aba4a8ae2fc8860cdf4e50c53d9d3e Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Qml: Prevent MSVC 2019 min()/max() macros from triggeringOlivier De Cannière2023-10-161-4/+4
| | | | | | | | | | | | | windows.h defines the min() and max() macros. These get applied when trying to call std::numeric_limits<int>::min(). Add parentheses around the function before its invocation to break the macro. Amends: 9df4293adf7d019b4d3ccaaa2f5d87ddfe0b041b Fixes: QTBUG-118132 Pick-to: 6.6 Change-Id: I96039cd714b042d880bcff6c9163cbeb76fe2f80 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlProperty: Accept badly capitalized signal handler namesUlf Hermann2023-09-052-0/+22
| | | | | | | | | ... but warn about them. Apparently we did accept them prior to 6.4. Fixes: QTBUG-116576 Pick-to: 6.5 6.6 Change-Id: If890db85f5a8d71c0bcdfaf646ee9f01765a0b3c Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QQmlSignalNames: Optimize a bitUlf Hermann2023-09-041-26/+32
| | | | | | | | | | | | | We don't have to repeat the strlen("on") and strlen("Changed") because we can phrase them as constexpr statics. The same holds for the actual strings. We can store them as latin-1 so that we don't have to construct temporary QStrings. When calculating the signal name from the handler name, we don't have to check the signal name length twice. And finally, we can reserve() the QString to return when creating a handler name. Change-Id: Ied0c33638d9e72df6360dd04b3f517d72beca21b Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Replace signal name manipulations with QQmlSignalNamesSami Shalayel2023-08-152-10/+29
| | | | | | | | | | | | | | | Remove custom implementations found in qqmljs* and use the static helper methods from qqmlsignalnames_p.h instead. This sometimes requires to move some code around to avoid bugs with property that do not have letters in their name. Add a warning in the JS implementation of the SignalSpy.qml that the used heuristic might fail on certain signal names. Add tests in in tst_qqmllanguage to see if the property change handlers work correctly for weird names. Change-Id: I4dc73c34df7f77f529511fa04ab5fcc5385b59fc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmlls: check user-supplied names on renamingSami Shalayel2023-08-102-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement the checking of user-supplied names for renaming operations in QmlLSUtils and qqmlrenamesymbolsupport.cpp Add a helper method QQmlLSUtils::isValidEcmaScriptIdentifier that runs the lexer on an identifier. Reject identifiers that do not parse as T_IDENTIFIER, like keywords and invalid unicode escapes, for example. Extend QQmlLSUtilsExpressionType to contain the name of the current object. Drive-by change: fix a off-by-one bug in the lexer, where files (or identifiers, in this case) could not be lexed when they were ending with an unicode-sequence. Also, do not crash on JSIdentifiers without semantic scope in resolveIdentifierExpressionType. Add some tests, and fix a warning about positionAfterOneIndent not being used in tst_qmlls_modules.cpp. Add QQmlLSUtils::isChangedSignalName next to QQmlLSUtils::isChangedHandlerName, and QQmlLSUtils::isHandlerName and add tests for all three. Fixes: QTBUG-114951 Task-number: QTBUG-114788 Change-Id: I0f1a544b70dfb69bca4aef355a8a8658f1d23081 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* UndefinedBehavior: fix some things found with -sanitize undefinedOlivier De Cannière2023-08-013-6/+46
| | | | | | | | | | | | | | | | | | Here are the sorts of things that were found: - Uninitialized variables containing garbage. - Calling member function through nullptr (where this is not actually used inside the function because that would trigger a segfault). - static_cast'ing double to int where the double is either +/-infinity or is outside the range of min and max values for int. Additionally, the uses of QJSNumberCoercion::isInteger() in the code generator have been replaced by QJSNumberCoercion::isArrayIndex() and the former was deprecated as it is no longer being used. Pick-to: 6.5 6.6 Change-Id: I9318671ccbda37e5519f4fcb84a1537585c2103f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlSignalNames: Add implementation for signal name manipulationsSami Shalayel2023-07-212-0/+256
| | | | | | | | | | | | | | | | 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>
* QQmlJs::MemoryPool: fix potential UB (pointer overflow)Marc Mutz2023-06-271-6/+4
| | | | | | | | | | | | | | | | A check like (p1 + s op p2) is dangerous, because p1 + s may overflow, and that would be UB, so the compiler can assume it doesn't happen and break the check. Reformulate the expression by subtracting p1 from both sides. Cast the ptrdiff_t to size_t to avoid -Wsign-compare. This is safe because _end is always ≥ _ptr. As a drive-by, remove extra parentheses. Pick-to: 6.6 6.5 6.2 5.15 Change-Id: If240d685fe48196ab5ceb7ff39736b73c8997e30 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QML: Revert the default for enforcing function signaturesUlf Hermann2023-06-261-1/+1
| | | | | | | | | [ChangeLog][QtQml][Important Behavior Changes] Type annotations on function signatures are now enforced, no matter if the code in question is interpreted, JIT-compiled, or AOT-compiled. Previously, only AOT-compiled code enforced the signatures. Therefore you could produce divergent behavior by passing or returning values that violated the type annotations. Fixes: QTBUG-113527 Fixes: QTBUG-109221 Change-Id: Ie573b31f35813db37b75189e747c764d1b9bbe78 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Undeprecate AOTCompiledFunctionUlf Hermann2023-05-231-3/+3
| | | | | | | We're going to call the JavaScript-typed functions a different name. Change-Id: If92c3fb1b16b1b0bd7d009e7dd712ae6405e1232 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* V4: Discern between named builtins and optimizations for common typesUlf Hermann2023-05-161-36/+53
| | | | | | | | | The named builtins include void and regexp. The optimizations for other types are useful, but should be a separate enum. Change-Id: I06220cf4a6d3449deca89a26c4f5db0e41d32765 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Replace {add,sub,mul}_overload with q{Add,Sub,Mul}OverloadMarc Mutz2023-05-111-1/+1
| | | | | | | | | | | | | | | | | | These APIs started out as private APIs in qnumeric_p.h, but have since been made pseudo-public in qnumeric.h. The qnumeric_p.h versions just forward to the qnumeric.h ones, so just use the latter. This is in preparation of removing the {add,sub,mul}_overflow versions, which, despite being defined in the unnamed namespace, don't sport the q prefix, so potentially clash with global symbols. The change is a simple textual search and replace. Picking to 6.5 to avoid cherry-pick conflicts going forward. Pick-to: 6.5 Change-Id: I2525619c14cb8eeadd08e2fa6c35968bcedd5171 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Silence signed vs unsigned warning on 32 bit VS 2022 debug buildJøger Hansegård2023-05-071-1/+1
| | | | | | | | | | | | | | The warning C4018: '<': signed/unsigned mismatch appears in a Q_ASSERT when checking a lookup index against the size of the container. Fixed by changing from unsigned to signed type for the index. Since the index is already implicitly converted to signed type when used, we can use a signed type from the start. We rely on implicit conversion from unsigned instead of static_cast to not hide other warnings in the future. Change-Id: I2b1983bdd40104e2c7135eec849a198ac074517c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QtQml: Improve handling of CU's sourceFileIndexUlf Hermann2023-03-281-6/+9
| | | | | | | | | | | | | | In the unlikely case that we get a corrupted CU from a cache file and it still passes the header verification we don't want it to access invalid memory when checking the file name. We also generally want to use uint as index into the string table. A signed integer makes no sense here. Pick-to: 6.5 Coverity-Id: 310389 Change-Id: I12e9b8f39e1d3c68fd701c1ef4f54845ab8c3c12 Reviewed-by: Fabian Kosmale <fabian.kosmale@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>
* QML: Add an "Addressable" value to ValueTypeBehaviorUlf Hermann2023-03-021-0/+1
| | | | | | | Task-number: QTBUG-94807 Change-Id: I8c78faa99fc4c4b2ffd8c89f1037fc7569212c73 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QML: Add a pragma for value type behaviorUlf Hermann2023-01-201-0/+1
| | | | | | | | | | | Unfortunately value types behave differently when compiled to C++. Document the difference and introduce a pragma to make them behave one way or the other. Pick-to: 6.5 Fixes: QTBUG-109221 Change-Id: Ib2685153c0b4ae209bafbea7a01229377fdb47dd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* V4: Do not shift heap pointer bits on arm64 AndroidUlf Hermann2023-01-171-2/+7
| | | | | | | | | | | | | | Memory obtained via mmap() is not subject to heap pointer tagging. We don't need to impose the overhead of shifting the bits around. Amends commit c7722d4ed61d6a887e9f6c403ffa10b2048de2a4. Pick-to: 6.5 Task-number: QTBUG-101686 Task-number: QTBUG-91150 Change-Id: I45dc291c5a1208dd747199f00f819e475d5c0aec Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Change value encoding scheme to make space for larger pointersUlf Hermann2023-01-121-148/+340
| | | | | | | | | | | | | | | | | | On android and on some other platforms, the upper bits of a pointer are significant. We need to store them in our JS value encoding. Shift the bits around to make this happen. We now can store pointers of up to 57 bits. That's enough for everything we've seen so far. Fixes: QTBUG-101686 Fixes: QTBUG-91150 Pick-to: 6.5 Change-Id: I72e0fe63b27fca94840f82963e4d3936b3581b28 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* QObjectWrapper: Fix calling attached methods on different objectsUlf Hermann2023-01-021-0/+1
| | | | | | | | | | | | | You can generally store a method in a value and call it on a different object. However, since we've ignored the thisObject basically forever, we cannot just accept it right away. Add an opt-in mechanism via a pragma that allows you to pass (implicitly via context or explicitly via call()) specific thisObjects to QObject methods. Fixes: QTBUG-109585 Pick-to: 6.5 Change-Id: I4c81b8ecf6317af55104ac9ebb62d98862ff24e7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Fix recognition of builtin list typesUlf Hermann2022-12-151-5/+20
| | | | | | | | | | | | | Previously all list types used as arguments or return types for methods had to be looked up via the imports. However, builtin types are not part of the imports at run time. Therefore, recognize list types already early on, when generating the IR. This is the same way we do it for property types and it allows us to easily identify lists of builtins. Pick-to: 6.5 Fixes: QTBUG-109147 Change-Id: I91fa9c8fc99c1e0155cc5db5faddd928ca7fabbc Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qml: silence -Wextra-semiTim Blechmann2022-11-161-2/+2
| | | | | | | | | silence gcc's -Wextra-semi. the private headers are pulled in via the type compiler Pick-to: 6.4 Change-Id: I5291d007c379f522c2dae9d814c4f4cc6a7d118a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>