summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-02-01 23:03:34 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-02-01 23:03:34 (GMT)
commit35a211cd95e0d09ef0b547b57f01f0a9ff41da2f (patch)
treea74bdf9eedee7ae0eba4ddb2fe13064cd79db81e /src
parente93f76cc533751944e66c02d868f3c527814efa0 (diff)
downloadQt-35a211cd95e0d09ef0b547b57f01f0a9ff41da2f.zip
Qt-35a211cd95e0d09ef0b547b57f01f0a9ff41da2f.tar.gz
Qt-35a211cd95e0d09ef0b547b57f01f0a9ff41da2f.tar.bz2
Fix QList<QObject*> as a model. Add docs and example.
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
index 70e3a43..bd60562 100644
--- a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
@@ -462,7 +462,8 @@ int QmlGraphicsVisualDataModelDataMetaObject::createProperty(const char *name, c
QmlGraphicsVisualDataModelPrivate *model = QmlGraphicsVisualDataModelPrivate::get(data->m_model);
if ((!model->m_listModelInterface || !model->m_abstractItemModel) && model->m_listAccessor) {
- if (model->m_listAccessor->type() == QmlListAccessor::QmlList) {
+ if (model->m_listAccessor->type() == QmlListAccessor::QmlList
+ || model->m_listAccessor->type() == QmlListAccessor::QListPtr) {
model->ensureRoles();
QObject *object = model->m_listAccessor->at(data->m_index).value<QObject*>();
if (object && object->property(name).isValid())
@@ -724,7 +725,7 @@ void QmlGraphicsVisualDataModel::setModel(const QVariant &model)
}
d->m_listAccessor = new QmlListAccessor;
d->m_listAccessor->setList(model, d->m_context?d->m_context->engine():qmlEngine(this));
- if (d->m_listAccessor->type() != QmlListAccessor::QmlList)
+ if (d->m_listAccessor->type() != QmlListAccessor::QmlList && d->m_listAccessor->type() != QmlListAccessor::QListPtr)
d->m_metaDataCacheable = true;
if (d->m_delegate && d->modelCount()) {
emit itemsInserted(0, d->modelCount());