From 7754582a2b5c5f966d320855a02088908bd94aad Mon Sep 17 00:00:00 2001 From: Andrei Golubev Date: Wed, 27 Jul 2022 10:37:15 +0200 Subject: 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 Reviewed-by: Qt CI Bot (cherry picked from commit e14b7fe59767e972a32aed7b019d01def14b429c) Reviewed-by: Ulf Hermann --- tools/qmltc/qmltccompiler.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'tools/qmltc/qmltccompiler.cpp') 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); -- cgit v1.2.3