aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorChristian Kamm <[email protected]>2010-02-17 09:16:28 +0100
committerChristian Kamm <[email protected]>2010-02-17 09:17:29 +0100
commit265118eb5e59d1be3fb507c86a9f3dd8b9b77fe9 (patch)
tree1047e247bbc9f2cd01a6b554bc8bd21f4269fb6a /src/libs
parent1f411118bf8fc4119677e773d1d82bd6c6c8e86c (diff)
Add the onNameChanged signals that Qml properties generate implicitly.
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/qmljs/qmljsinterpreter.cpp12
-rw-r--r--src/libs/qmljs/qmljsinterpreter.h2
2 files changed, 12 insertions, 2 deletions
diff --git a/src/libs/qmljs/qmljsinterpreter.cpp b/src/libs/qmljs/qmljsinterpreter.cpp
index 34d7ac95f9e..caf472a12f5 100644
--- a/src/libs/qmljs/qmljsinterpreter.cpp
+++ b/src/libs/qmljs/qmljsinterpreter.cpp
@@ -2026,11 +2026,14 @@ bool ASTObjectValue::getSourceLocation(QString *fileName, int *line, int *column
void ASTObjectValue::processMembers(MemberProcessor *processor) const
{
- foreach (ASTPropertyReference *ref, _properties)
+ foreach (ASTPropertyReference *ref, _properties) {
processor->processProperty(ref->ast()->name->asString(), ref);
+ // ### Should get a different value?
+ processor->processGeneratedSlot(ref->onChangedSlotName(), ref);
+ }
foreach (ASTSignalReference *ref, _signals) {
- // ### These two should get different values?
processor->processSignal(ref->ast()->name->asString(), ref);
+ // ### Should get a different value?
processor->processGeneratedSlot(ref->slotName(), ref);
}
@@ -2125,6 +2128,11 @@ const Value *QmlPrototypeReference::value(Context *context) const
ASTPropertyReference::ASTPropertyReference(UiPublicMember *ast, const QmlJS::Document *doc, Engine *engine)
: Reference(engine), _ast(ast), _doc(doc)
{
+ const QString propertyName = ast->name->asString();
+ _onChangedSlotName = QLatin1String("on");
+ _onChangedSlotName += propertyName.at(0).toUpper();
+ _onChangedSlotName += propertyName.midRef(1);
+ _onChangedSlotName += QLatin1String("Changed");
}
ASTPropertyReference::~ASTPropertyReference()
diff --git a/src/libs/qmljs/qmljsinterpreter.h b/src/libs/qmljs/qmljsinterpreter.h
index 0df1d9cdb22..8f0fa51532f 100644
--- a/src/libs/qmljs/qmljsinterpreter.h
+++ b/src/libs/qmljs/qmljsinterpreter.h
@@ -685,12 +685,14 @@ class QMLJS_EXPORT ASTPropertyReference: public Reference
{
AST::UiPublicMember *_ast;
const Document *_doc;
+ QString _onChangedSlotName;
public:
ASTPropertyReference(AST::UiPublicMember *ast, const Document *doc, Engine *engine);
virtual ~ASTPropertyReference();
AST::UiPublicMember *ast() const { return _ast; }
+ QString onChangedSlotName() const { return _onChangedSlotName; }
virtual bool getSourceLocation(QString *fileName, int *line, int *column) const;
virtual const Value *value(Context *context) const;