Add check for correct color string in Qml.

This commit is contained in:
Christian Kamm
2010-02-23 14:36:38 +01:00
parent f6cd2493be
commit 0e2685332c
3 changed files with 97 additions and 34 deletions

View File

@@ -326,6 +326,10 @@ const Value *QmlObjectValue::propertyValue(const QMetaProperty &prop) const
value = object;
} break;
case QMetaType::QColor: {
value = engine()->colorValue();
} break;
default:
break;
} // end of switch
@@ -610,6 +614,10 @@ void ValueVisitor::visit(const EasingCurveNameValue *)
{
}
void ValueVisitor::visit(const ColorValue *)
{
}
////////////////////////////////////////////////////////////////////////////////
// Value
////////////////////////////////////////////////////////////////////////////////
@@ -671,6 +679,11 @@ const EasingCurveNameValue *Value::asEasingCurveNameValue() const
return 0;
}
const ColorValue *Value::asColorValue() const
{
return 0;
}
////////////////////////////////////////////////////////////////////////////////
// Values
////////////////////////////////////////////////////////////////////////////////
@@ -977,6 +990,16 @@ const EasingCurveNameValue *EasingCurveNameValue::asEasingCurveNameValue() const
return this;
}
void ColorValue::accept(ValueVisitor *visitor) const
{
visitor->visit(this);
}
const ColorValue *ColorValue::asColorValue() const
{
return this;
}
MemberProcessor::MemberProcessor()
{
}
@@ -1621,6 +1644,11 @@ const EasingCurveNameValue *Engine::easingCurveNameValue() const
return &_easingCurveNameValue;
}
const ColorValue *Engine::colorValue() const
{
return &_colorValue;
}
const Value *Engine::newArray()
{
return arrayCtor()->construct();