diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2009-08-27 05:17:37 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2009-08-27 05:17:37 (GMT) |
commit | fd2616977e5e03afa3be9b455bc0a6be19f9132f (patch) | |
tree | b71404860117132253b7e76832adf28748ca81cb /src/declarative/qml/qmlcompiler.cpp | |
parent | 12f4fc296578fb30ac1bf690b3eeba176b72205a (diff) | |
parent | 219e2fa7ace74d87fda4ed8c3a2a75005fab10b9 (diff) | |
download | Qt-fd2616977e5e03afa3be9b455bc0a6be19f9132f.zip Qt-fd2616977e5e03afa3be9b455bc0a6be19f9132f.tar.gz Qt-fd2616977e5e03afa3be9b455bc0a6be19f9132f.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Conflicts:
src/declarative/extra/qmlbehavior.cpp
src/declarative/extra/qmlbehavior.h
Diffstat (limited to 'src/declarative/qml/qmlcompiler.cpp')
-rw-r--r-- | src/declarative/qml/qmlcompiler.cpp | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index b5edc38..764699e 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -1411,7 +1411,6 @@ void QmlCompiler::genPropertyAssignment(QmlParser::Property *prop, } } else if (v->type == Value::ValueSource) { - genObject(v->object); QmlInstruction store; @@ -1425,6 +1424,8 @@ void QmlCompiler::genPropertyAssignment(QmlParser::Property *prop, QmlMetaPropertyPrivate::saveProperty(prop->index); store.assignValueSource.owner = 0; } + QmlType *valueType = QmlMetaType::qmlType(v->object->metatype); + store.assignValueSource.castValue = valueType->propertyValueSourceCast(); output->bytecode << store; } else if (v->type == Value::PropertyBinding) { @@ -1584,15 +1585,7 @@ bool QmlCompiler::buildValueTypeProperty(QObject *type, Value *value = prop->values.at(0); if (value->object) { - const QMetaObject *c = - output->types.at(value->object->type).metaObject(); - bool isPropertyValue = false; - while (c && !isPropertyValue) { - isPropertyValue = - (c == &QmlPropertyValueSource::staticMetaObject); - c = c->superClass(); - } - + bool isPropertyValue = output->types.at(value->object->type).type->propertyValueSourceCast() != -1; if (!isPropertyValue) { COMPILE_EXCEPTION(prop, "Invalid property use"); } else { @@ -1762,30 +1755,26 @@ bool QmlCompiler::buildPropertyObjectAssignment(QmlParser::Property *prop, v->object->metatype = output->types.at(v->object->type).metaObject(); Q_ASSERT(v->object->metaObject()); + // Will be true if the assigned type inherits QmlPropertyValueSource + bool isPropertyValue = false; + if (QmlType *valueType = QmlMetaType::qmlType(v->object->metatype)) + isPropertyValue = valueType->propertyValueSourceCast() != -1; + // We want to raw metaObject here as the raw metaobject is the // actual property type before we applied any extensions that might // effect the properties on the type, but don't effect assignability const QMetaObject *propertyMetaObject = QmlMetaType::rawMetaObjectForType(prop->type); - // Will be true if the assigned type inherits QmlPropertyValueSource - bool isPropertyValue = false; // Will be true if the assgned type inherits propertyMetaObject bool isAssignable = false; - // Determine isPropertyValue and isAssignable values + // Determine isAssignable value if (propertyMetaObject) { const QMetaObject *c = v->object->metatype; while(c) { - isPropertyValue |= (c == &QmlPropertyValueSource::staticMetaObject); isAssignable |= (c == propertyMetaObject); c = c->superClass(); } - } else { - const QMetaObject *c = v->object->metatype; - while(!isPropertyValue && c) { - isPropertyValue |= (c == &QmlPropertyValueSource::staticMetaObject); - c = c->superClass(); - } } if (isAssignable) { |