diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2022-07-27 10:37:15 +0200 |
---|---|---|
committer | Andrei Golubev <andrei.golubev@qt.io> | 2022-07-29 15:22:53 +0200 |
commit | 7754582a2b5c5f966d320855a02088908bd94aad (patch) | |
tree | af4d543e58b7510d2cfcd05cd8fad3b318a47c60 /tools/qmltc/qmltccompiler.cpp | |
parent | 4580f49fb9867fd0f6cf597a45fbe74b0f5d6a48 (diff) |
qmltc: Fix alias assignment code generation
Fix subtle issue where alias assignment would cause qmltc to generate
direct property set code (doesn't work for aliases since those do not
have "real" properties)
Remove now redundant TODO and identical code path when compiling alias
assignments on types with composite bases (used to work poorly during
prototype times)
Change-Id: Ifacf5872ff5432a748fb1ec16c300ec844d65e9a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit e14b7fe59767e972a32aed7b019d01def14b429c)
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tools/qmltc/qmltccompiler.cpp')
-rw-r--r-- | tools/qmltc/qmltccompiler.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/tools/qmltc/qmltccompiler.cpp b/tools/qmltc/qmltccompiler.cpp index 0d80a8dedc..9a38cca06c 100644 --- a/tools/qmltc/qmltccompiler.cpp +++ b/tools/qmltc/qmltccompiler.cpp @@ -798,19 +798,8 @@ void QmltcCompiler::compileBinding(QmltcType ¤t, const QQmlJSMetaPropertyB const auto assignToProperty = [&](const QQmlJSMetaProperty &p, const QString &value, bool constructFromQObject = false) { - if (p.isAlias() && QQmlJSUtils::hasCompositeBase(type)) { - qCDebug(lcQmltcCompiler) << u"Property '" + p.propertyName() - + u"' is an alias on type '" + type->internalName() - + u"' which is a QML type compiled to C++. The assignment is special" - + u"in this case"; - // TODO: attest whether we could simplify this (see why prototype - // did special code generation) - QmltcCodeGenerator::generate_assignToProperty(¤t.endInit.body, type, p, value, - accessor.name, constructFromQObject); - } else { - QmltcCodeGenerator::generate_assignToProperty(¤t.endInit.body, type, p, value, - accessor.name, constructFromQObject); - } + QmltcCodeGenerator::generate_assignToProperty(¤t.endInit.body, type, p, value, + accessor.name, constructFromQObject); }; QQmlJSMetaProperty p = type->property(propertyName); |