aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-09-20 14:32:06 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-20 22:13:31 +0200
commit6213d26cc07281c6732594eb13b0ec0e35b62a11 (patch)
treeaac2de272e3b46408f40b295162bc9eeefdf72d0 /src/qml/compiler
parent3123a22ae66016a0d9cd600dbb6f636fd29fc312 (diff)
[new compiler] Fix signal handlers on own properties
When compiling signal handler expressions we need to determine the parameters. We first try to look up the signal in the base meta-object. For our own QML type itself we don't have a meta-object yet and so we extract the information about which parameters the signals have from the parsed AST's signal declarations. For signal handlers on declared properties we need to "synthesize" the signal (myPropertyChanged) as well, with an empty parameter list. Change-Id: Iecfe7bc7a9979d57586cbd9434bb9eb2f38a2c7b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler')
-rw-r--r--src/qml/compiler/qqmlcodegenerator.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/compiler/qqmlcodegenerator.cpp b/src/qml/compiler/qqmlcodegenerator.cpp
index 381f5bfec9..3d3e155abe 100644
--- a/src/qml/compiler/qqmlcodegenerator.cpp
+++ b/src/qml/compiler/qqmlcodegenerator.cpp
@@ -1268,6 +1268,11 @@ bool SignalHandlerConverter::convertSignalHandlerExpressionsToFunctionDeclaratio
const QString &signalName = stringAt(signal->nameIndex);
customSignals.insert(signalName, signal->parameterStringList(parsedQML->jsGenerator.strings));
}
+
+ for (QmlProperty *property = obj->properties->first; property; property = property->next) {
+ const QString propName = stringAt(property->nameIndex);
+ customSignals.insert(propName, QStringList());
+ }
}
QHash<QString, QStringList>::ConstIterator entry = customSignals.find(propertyName);