summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-02-23 05:41:22 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-02-23 05:41:22 (GMT)
commit113e350e36c0ff31824bc238160094814dc3fb4f (patch)
treec9bb17a87bd083f4c7ec1db7cbced68169af9a09 /src/declarative
parent66b8d89feb2850dbc06503fa66f5963d48616c1d (diff)
parente988763395625171bed001b5916d4da003d39aee (diff)
downloadQt-113e350e36c0ff31824bc238160094814dc3fb4f.zip
Qt-113e350e36c0ff31824bc238160094814dc3fb4f.tar.gz
Qt-113e350e36c0ff31824bc238160094814dc3fb4f.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp2
-rw-r--r--src/declarative/qml/qmlmetaproperty.cpp34
2 files changed, 19 insertions, 17 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
index 4f28da7..bfa9e9b 100644
--- a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
@@ -417,7 +417,7 @@ int QmlGraphicsVisualDataModelDataMetaObject::createProperty(const char *name, c
if (model->m_listAccessor->type() == QmlListAccessor::ListProperty) {
model->ensureRoles();
QObject *object = model->m_listAccessor->at(data->m_index).value<QObject*>();
- if (object && object->property(name).isValid())
+ if (object && (object->property(name).isValid() || qstrcmp(name,"modelData")==0))
return QmlOpenMetaObject::createProperty(name, type);
}
}
diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp
index 7c273dc..1742c43 100644
--- a/src/declarative/qml/qmlmetaproperty.cpp
+++ b/src/declarative/qml/qmlmetaproperty.cpp
@@ -378,7 +378,9 @@ QmlMetaProperty &QmlMetaProperty::operator=(const QmlMetaProperty &other)
d->object = other.d->object;
d->isDefaultProperty = other.d->isDefaultProperty;
+ d->isNameCached = other.d->isNameCached;
d->core = other.d->core;
+ d->nameCache = other.d->nameCache;
d->valueType = other.d->valueType;
@@ -811,22 +813,22 @@ bool QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data
return writeEnumProperty(prop, coreIdx, object, v, flags);
}
- int t = property.propType;
- int vt = value.userType();
+ int propertyType = property.propType;
+ int variantType = value.userType();
QmlEnginePrivate *enginePriv = QmlEnginePrivate::get(context);
- if (t == QVariant::Url) {
+ if (propertyType == QVariant::Url) {
QUrl u;
bool found = false;
- if (vt == QVariant::Url) {
+ if (variantType == QVariant::Url) {
u = value.toUrl();
found = true;
- } else if (vt == QVariant::ByteArray) {
+ } else if (variantType == QVariant::ByteArray) {
u = QUrl(QString::fromUtf8(value.toByteArray()));
found = true;
- } else if (vt == QVariant::String) {
+ } else if (variantType == QVariant::String) {
u = QUrl(value.toString());
found = true;
}
@@ -840,12 +842,12 @@ bool QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data
void *argv[] = { &u, 0, &status, &flags };
QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, argv);
- } else if (vt == t) {
+ } else if (variantType == propertyType) {
void *a[] = { (void *)value.constData(), 0, &status, &flags };
QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, a);
- } else if (qMetaTypeId<QVariant>() == t) {
+ } else if (qMetaTypeId<QVariant>() == propertyType) {
void *a[] = { (void *)&value, 0, &status, &flags };
QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, a);
@@ -858,7 +860,7 @@ bool QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data
return false;
QObject *o = *(QObject **)value.constData();
- const QMetaObject *propMo = rawMetaObjectForType(enginePriv, t);
+ const QMetaObject *propMo = rawMetaObjectForType(enginePriv, propertyType);
if (o) valMo = o->metaObject();
@@ -914,25 +916,25 @@ bool QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data
}
} else {
- Q_ASSERT(vt != t);
+ Q_ASSERT(variantType != propertyType);
QVariant v = value;
- if (v.convert((QVariant::Type)t)) {
+ if (v.convert((QVariant::Type)propertyType)) {
void *a[] = { (void *)v.constData(), 0, &status, &flags};
QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, a);
- } else if ((uint)t >= QVariant::UserType && vt == QVariant::String) {
- QmlMetaType::StringConverter con = QmlMetaType::customStringConverter(t);
+ } else if ((uint)propertyType >= QVariant::UserType && variantType == QVariant::String) {
+ QmlMetaType::StringConverter con = QmlMetaType::customStringConverter(propertyType);
if (!con)
return false;
QVariant v = con(value.toString());
- if (v.userType() == t) {
+ if (v.userType() == propertyType) {
void *a[] = { (void *)v.constData(), 0, &status, &flags};
QMetaObject::metacall(object, QMetaObject::WriteProperty, coreIdx, a);
}
- } else if (vt == QVariant::String) {
+ } else if (variantType == QVariant::String) {
bool ok = false;
- QVariant v = QmlStringConverters::variantFromString(value.toString(), t, &ok);
+ QVariant v = QmlStringConverters::variantFromString(value.toString(), propertyType, &ok);
if (!ok)
return false;