From 67b89083b2d8667a89276488968873585790b868 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 18 Dec 2009 09:11:52 +1000 Subject: Section properties can only be model data. --- src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp index d4d07cc..8131b4c 100644 --- a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp @@ -895,16 +895,11 @@ QVariant QmlGraphicsVisualDataModel::value(int index, const QString &name) QVariant val; QObject *nobj = d->m_cache.item(index); if (nobj) { - val = QmlEngine::contextForObject(nobj)->contextProperty(name); + val = d->data(nobj)->property(name.toUtf8()); } else { - QmlContext *ccontext = d->m_context; - if (!ccontext) ccontext = qmlContext(this); - QmlContext *ctxt = new QmlContext(ccontext); QmlGraphicsVisualDataModelData *data = new QmlGraphicsVisualDataModelData(index, this); - ctxt->addDefaultObject(data); - val = ctxt->contextProperty(name); + val = data->property(name.toUtf8()); delete data; - delete ctxt; } return val; -- cgit v0.12