diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-02-01 10:02:03 +1000 |
---|---|---|
committer | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-02-01 04:52:58 +0100 |
commit | 5e970b84663f5398eb51d4575856d1a3c44df953 (patch) | |
tree | cd70778d3eb518689aba31fadd3d8bcf92d74d08 /src/declarative/qml/qdeclarativecompiler.cpp | |
parent | f973bb1730e1138f9c745d142c1f2f5d9c53b456 (diff) |
Fix assert when binding to property variant.
Remove workarounds for the QVariant meta-type and use it directly and
remove QMetaObjectBuilder entirely and use the up to date copy in
qtbase.
Change-Id: I1ad601906d6b172adc7ce7bb63af28cd578eb5d7
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Diffstat (limited to 'src/declarative/qml/qdeclarativecompiler.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativecompiler.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 25e67ce5..38679f60 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -196,7 +196,7 @@ bool QDeclarativeCompiler::testLiteralAssignment(const QMetaProperty &prop, } int type = prop.userType(); switch(type) { - case -1: + case QMetaType::QVariant: break; case QVariant::String: if (!v->value.isString()) COMPILE_EXCEPTION(v, tr("Invalid property assignment: string expected")); @@ -340,7 +340,7 @@ void QDeclarativeCompiler::genLiteralAssignment(const QMetaProperty &prop, int type = prop.userType(); switch(type) { - case -1: + case QMetaType::QVariant: { if (v->value.isNumber()) { double n = v->value.asNumber(); @@ -1145,7 +1145,7 @@ void QDeclarativeCompiler::genValueTypeProperty(QDeclarativeParser::Object *obj, fetch.fetchValue.bindingSkipList = 0; fetch.line = prop->location.start.line; - if (obj->type == -1 || output->types.at(obj->type).component) { + if (obj->type == QMetaType::QVariant || output->types.at(obj->type).component) { // We only have to do this if this is a composite type. If it is a builtin // type it can't possibly already have bindings that need to be cleared. foreach(Property *vprop, prop->value->valueProperties) { @@ -1675,7 +1675,7 @@ void QDeclarativeCompiler::genPropertyAssignment(QDeclarativeParser::Property *p store.storeObject.propertyIndex = prop->index; output->bytecode << store; - } else if (prop->type == -1) { + } else if (prop->type == QMetaType::QVariant) { QDeclarativeInstruction store; store.type = QDeclarativeInstruction::StoreVariantObject; @@ -2064,7 +2064,7 @@ bool QDeclarativeCompiler::buildPropertyObjectAssignment(QDeclarativeParser::Pro v->type = Value::CreatedObject; - } else if (prop->type == -1) { + } else if (prop->type == QMetaType::QVariant) { // Assigning an object to a QVariant COMPILE_CHECK(buildObject(v->object, ctxt)); @@ -2491,7 +2491,7 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeParser::Object *obj, Dyn } break; case Object::DynamicProperty::Variant: - propertyType = -1; + propertyType = QMetaType::QVariant; type = "QVariant"; break; case Object::DynamicProperty::Int: |