summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2009-05-26 07:07:33 (GMT)
committerKai Koehne <kai.koehne@nokia.com>2009-05-26 07:07:33 (GMT)
commita04c23c7731c5c96d066fccdccec6b738265b774 (patch)
tree3df1b7dabf14f2223dc14cc8acbd55faf7198596 /src/declarative
parent4c1cdb0bf25847a8ebf42cf573faf5b2386000b9 (diff)
downloadQt-a04c23c7731c5c96d066fccdccec6b738265b774.zip
Qt-a04c23c7731c5c96d066fccdccec6b738265b774.tar.gz
Qt-a04c23c7731c5c96d066fccdccec6b738265b774.tar.bz2
Do not expect QListModelInterface::data to return ONLY the roles requested
It is often convenient to always return the full set of data, even if only some roles are requested. Reviewed-by: Martin Jones
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/fx/qfxvisualitemmodel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/declarative/fx/qfxvisualitemmodel.cpp b/src/declarative/fx/qfxvisualitemmodel.cpp
index 039998a..3e06ff8 100644
--- a/src/declarative/fx/qfxvisualitemmodel.cpp
+++ b/src/declarative/fx/qfxvisualitemmodel.cpp
@@ -235,7 +235,7 @@ QFxVisualItemModelDataMetaObject::propertyCreated(int, QMetaPropertyBuilder &pro
if (values.isEmpty())
return QVariant();
else
- return *values.begin();
+ return values.value(iter.key());
}
}
} else if (data->m_model->m_abstractItemModel) {
@@ -644,7 +644,7 @@ void QFxVisualItemModel::_q_itemsChanged(int index, int count,
int role = data->role(prop);
if (roles.contains(role)) {
if (d->m_listModelInterface) {
- data->setValue(prop, *d->m_listModelInterface->data(ii, QList<int>() << role).begin());
+ data->setValue(prop, d->m_listModelInterface->data(ii, QList<int>() << role).value(role));
} else if (d->m_abstractItemModel) {
QModelIndex index = d->m_abstractItemModel->index(ii, 0);
data->setValue(prop, d->m_abstractItemModel->data(index, role));