summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-02-22 07:26:20 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-02-23 02:30:21 (GMT)
commitc41f7c7a4dbb2ac0c76e20628aaedeabec6f4497 (patch)
tree1291757ddd418da7c35d01237520815755b87236
parentce78e4124d57a3c517e6de88696a09ad399c703f (diff)
downloadQt-c41f7c7a4dbb2ac0c76e20628aaedeabec6f4497.zip
Qt-c41f7c7a4dbb2ac0c76e20628aaedeabec6f4497.tar.gz
Qt-c41f7c7a4dbb2ac0c76e20628aaedeabec6f4497.tar.bz2
Better support modelData for object list models.
modelData will now correctly return the actual object.
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
index b96f399..9216793 100644
--- a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
@@ -415,7 +415,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);
}
}