diff options
author | Christian Kamm <[email protected]> | 2010-02-23 17:02:50 +0100 |
---|---|---|
committer | Christian Kamm <[email protected]> | 2010-02-23 17:03:05 +0100 |
commit | f0674aa7e9853cf5d3d48e3832a67de1b4033ad9 (patch) | |
tree | 6a7fff8a28473937e15eb5a7e67f8ec51705ddb7 /src/libs/qmljs/qmljsinterpreter.cpp | |
parent | 04d90d9563f347af36db08602535da66ed1963aa (diff) |
Add check for anchor line, changed value assignment checks into visitor.
Done-with: Erik Verbruggen
Diffstat (limited to 'src/libs/qmljs/qmljsinterpreter.cpp')
-rw-r--r-- | src/libs/qmljs/qmljsinterpreter.cpp | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/src/libs/qmljs/qmljsinterpreter.cpp b/src/libs/qmljs/qmljsinterpreter.cpp index 9d4461749f3..9975afdacb6 100644 --- a/src/libs/qmljs/qmljsinterpreter.cpp +++ b/src/libs/qmljs/qmljsinterpreter.cpp @@ -336,9 +336,7 @@ const Value *QmlObjectValue::propertyValue(const QMetaProperty &prop) const const QString typeName = prop.typeName(); if (typeName == QLatin1String("QmlGraphicsAnchorLine")) { - ObjectValue *object = engine()->newObject(/*prototype =*/ 0); - object->setClassName(QLatin1String("AnchorLine")); - value = object; + value = engine()->anchorLineValue(); } if (value->asStringValue() && prop.name() == QLatin1String("easing") && isDerivedFrom(&QmlPropertyAnimation::staticMetaObject)) { @@ -618,6 +616,10 @@ void ValueVisitor::visit(const ColorValue *) { } +void ValueVisitor::visit(const AnchorLineValue *) +{ +} + //////////////////////////////////////////////////////////////////////////////// // Value //////////////////////////////////////////////////////////////////////////////// @@ -684,6 +686,11 @@ const ColorValue *Value::asColorValue() const return 0; } +const AnchorLineValue *Value::asAnchorLineValue() const +{ + return 0; +} + //////////////////////////////////////////////////////////////////////////////// // Values //////////////////////////////////////////////////////////////////////////////// @@ -1000,6 +1007,16 @@ const ColorValue *ColorValue::asColorValue() const return this; } +void AnchorLineValue::accept(ValueVisitor *visitor) const +{ + visitor->visit(this); +} + +const AnchorLineValue *AnchorLineValue::asAnchorLineValue() const +{ + return this; +} + MemberProcessor::MemberProcessor() { } @@ -1577,6 +1594,21 @@ void TypeId::visit(const FunctionValue *object) _result = QLatin1String("Function"); } +void TypeId::visit(const EasingCurveNameValue *) +{ + _result = QLatin1String("string"); +} + +void TypeId::visit(const ColorValue *) +{ + _result = QLatin1String("string"); +} + +void TypeId::visit(const AnchorLineValue *) +{ + _result = QLatin1String("AnchorLine"); +} + Engine::Engine() : _objectPrototype(0), _functionPrototype(0), @@ -1649,6 +1681,11 @@ const ColorValue *Engine::colorValue() const return &_colorValue; } +const AnchorLineValue *Engine::anchorLineValue() const +{ + return &_anchorLineValue; +} + const Value *Engine::newArray() { return arrayCtor()->construct(); |