Add check for anchor line, changed value assignment checks into visitor.

Done-with: Erik Verbruggen
This commit is contained in:
Christian Kamm
2010-02-23 17:02:50 +01:00
parent 04d90d9563
commit f0674aa7e9
4 changed files with 168 additions and 76 deletions

View File

@@ -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();