From c41f7c7a4dbb2ac0c76e20628aaedeabec6f4497 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Mon, 22 Feb 2010 17:26:20 +1000 Subject: Better support modelData for object list models. modelData will now correctly return the actual object. --- src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); - if (object && object->property(name).isValid()) + if (object && (object->property(name).isValid() || qstrcmp(name,"modelData")==0)) return QmlOpenMetaObject::createProperty(name, type); } } -- cgit v0.12