summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2011-04-08 04:20:17 (GMT)
committerBea Lam <bea.lam@nokia.com>2011-04-12 01:07:48 (GMT)
commit6ec7695eaa02c923b90d72e3918b9ab50da63e41 (patch)
tree79730f4d1e6ef69f5ccaf87b14d9bc9ee38d40cb /src
parent051a76c1d65d698f71dc75c89f91ae9021357eae (diff)
downloadQt-6ec7695eaa02c923b90d72e3918b9ab50da63e41.zip
Qt-6ec7695eaa02c923b90d72e3918b9ab50da63e41.tar.gz
Qt-6ec7695eaa02c923b90d72e3918b9ab50da63e41.tar.bz2
ListModel::clear() should not clear roles
Clearing a model and then appending a new object with a subset of the previous roles was causing a crash since ListModel cleared the roles and VisualDataModel did not, so VisualDataModel was requesting invalid roles. This could have been fixed by clearing the meta object and its property cache in in VisualDataModel but this is less efficient, and also the general use case is for model data to always have the same roles. Task-number: QTBUG-18587 Change-Id: Ib11d2292888ab7a41e772b1e11700cd665e94ae7 Reviewed-by: Michael Brasser
Diffstat (limited to 'src')
-rw-r--r--src/declarative/util/qdeclarativelistmodel.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp
index 9332de4..1d03842 100644
--- a/src/declarative/util/qdeclarativelistmodel.cpp
+++ b/src/declarative/util/qdeclarativelistmodel.cpp
@@ -1301,9 +1301,6 @@ int NestedListModel::count() const
void NestedListModel::clear()
{
- _rolesOk = false;
- roleStrings.clear();
-
if (_root)
_root->clear();
}