From a243f1eeeb9eda237ea2f6dad403984ab14aa375 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Tue, 22 Sep 2020 10:48:23 +0200 Subject: Fix QProperty property interaction with aliases With this change, an alias of a bindable property is also bindable, and shares its bindable interface with the target. Moreover, the logic in QQmlTypeCompiler is adjusted so that a change handler of an alias uses the bindable interface if possible, instead of connecting to the alias' change signal. That would never be emitted if the target is a QProperty without a notify signal. Alias properties still have a change signal, but those never get emitted. Change-Id: I857dfdbe51048a2b604ad632982e7f4adac6b907 Reviewed-by: Lars Knoll --- src/qml/qml/qqmltypecompiler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/qml/qml/qqmltypecompiler.cpp') diff --git a/src/qml/qml/qqmltypecompiler.cpp b/src/qml/qml/qqmltypecompiler.cpp index ca8a24439b..eb3b0e43ac 100644 --- a/src/qml/qml/qqmltypecompiler.cpp +++ b/src/qml/qml/qqmltypecompiler.cpp @@ -382,7 +382,8 @@ bool SignalHandlerConverter::convertSignalHandlerExpressionsToFunctionDeclaratio QString finalSignalHandlerPropertyName = signalNameCandidate; uint flags = QV4::CompiledData::Binding::IsSignalHandlerExpression; - if (signal) { + const bool isPropertyObserver = !signalPropertyData && qPropertyData && qPropertyData->isBindable(); + if (signal && !(qPropertyData && qPropertyData->isAlias() && isPropertyObserver)) { int sigIndex = propertyCache->methodIndexToSignalIndex(signal->coreIndex()); sigIndex = propertyCache->originalClone(sigIndex); @@ -400,7 +401,7 @@ bool SignalHandlerConverter::convertSignalHandlerExpressionsToFunctionDeclaratio } parameters += param; } - } else if (!signalPropertyData && qPropertyData && qPropertyData->isBindable()) { + } else if (isPropertyObserver) { finalSignalHandlerPropertyName = qPropertyName; flags = QV4::CompiledData::Binding::IsPropertyObserver; } else { -- cgit v1.2.3