diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2023-11-07 15:16:32 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-11-09 19:12:37 +0100 |
| commit | 3ea55bf398412d373daab9c92b1498f45de70e96 (patch) | |
| tree | f78259ffe54637f5d790d4511235981ceb3d14fb /src/qml/jsruntime/qv4executablecompilationunit.cpp | |
| parent | 6c1391911275ba84848647e05b8daa5a10638f1c (diff) | |
QtQml: Fix some problems with deep aliases
We cannot get the property cache for an inline component the usual way
during type compilation. We have to ask the compilation unit for it.
Guard against still not being able to retrieve the property cache for
any reason. Abort the compilation rather than crashing.
Also, unify the setting of property attributes. Those should really work
the same way everywhere.
Finally, disallow writing aliases to value type properties where the
property holding the value type itself is not writable.
Pick-to: 6.6 6.5 6.2
Task-number: QTBUG-115579
Change-Id: I029eb56a9a390085d0c696a787a64c48acf0d620
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4executablecompilationunit.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4executablecompilationunit.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4executablecompilationunit.cpp b/src/qml/jsruntime/qv4executablecompilationunit.cpp index e71568b2d8..c0c5f341e5 100644 --- a/src/qml/jsruntime/qv4executablecompilationunit.cpp +++ b/src/qml/jsruntime/qv4executablecompilationunit.cpp @@ -501,6 +501,15 @@ int ExecutableCompilationUnit::totalObjectCount() const { return inlineComponentData[*icRootName].totalObjectCount; } +ResolvedTypeReference *ExecutableCompilationUnit::resolvedType(QMetaType type) const +{ + for (ResolvedTypeReference *ref : std::as_const(resolvedTypes)) { + if (ref->type().typeId() == type) + return ref; + } + return nullptr; +} + int ExecutableCompilationUnit::totalParserStatusCount() const { if (!icRootName) return m_totalParserStatusCount; |
