diff options
author | Justin McPherson <justin.mcpherson@nokia.com> | 2010-08-06 00:45:39 (GMT) |
---|---|---|
committer | Justin McPherson <justin.mcpherson@nokia.com> | 2010-08-06 00:45:39 (GMT) |
commit | e7a19af4430b45f371bb33120f0ed39a2c83b733 (patch) | |
tree | c0751ed9a7d0bc77e191db54e8584c9f5814e717 /src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp | |
parent | 262bdce40f7bb38f000eff09ed546a08cfe74fa3 (diff) | |
parent | 719e22c7fd34112460cddecb1491c3575c5a8c86 (diff) | |
download | Qt-e7a19af4430b45f371bb33120f0ed39a2c83b733.zip Qt-e7a19af4430b45f371bb33120f0ed39a2c83b733.tar.gz Qt-e7a19af4430b45f371bb33120f0ed39a2c83b733.tar.bz2 |
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/qt-multimedia-staging into 4.7
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index 79c1c43..ceb1961 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -444,6 +444,9 @@ public: int propForRole(int) const; void setValue(int, const QVariant &); + bool hasValue(int id) const { + return m_meta->hasValue(id); + } void ensureProperties(); @@ -1216,11 +1219,13 @@ void QDeclarativeVisualDataModel::_q_itemsChanged(int index, int count, int role = roles.at(roleIdx); int propId = data->propForRole(role); if (propId != -1) { - if (d->m_listModelInterface) { - data->setValue(propId, d->m_listModelInterface->data(idx, QList<int>() << role).value(role)); - } else if (d->m_abstractItemModel) { - QModelIndex index = d->m_abstractItemModel->index(idx, 0, d->m_root); - data->setValue(propId, d->m_abstractItemModel->data(index, role)); + if (data->hasValue(propId)) { + if (d->m_listModelInterface) { + data->setValue(propId, d->m_listModelInterface->data(idx, QList<int>() << role).value(role)); + } else if (d->m_abstractItemModel) { + QModelIndex index = d->m_abstractItemModel->index(idx, 0, d->m_root); + data->setValue(propId, d->m_abstractItemModel->data(index, role)); + } } } else { QString roleName; |