diff options
author | Girish Ramakrishnan <girish@forwardbias.in> | 2011-04-27 05:53:43 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2011-04-27 05:53:43 (GMT) |
commit | f6b7ce204ee88be0fedb4cfcff382f208fa4ed33 (patch) | |
tree | 69ce401113d1e5e665d02a0560ae589048b7b73e /src | |
parent | dcf9a1f2f20248de0da9549af54bc3a4844eaf5b (diff) | |
download | Qt-f6b7ce204ee88be0fedb4cfcff382f208fa4ed33.zip Qt-f6b7ce204ee88be0fedb4cfcff382f208fa4ed33.tar.gz Qt-f6b7ce204ee88be0fedb4cfcff382f208fa4ed33.tar.bz2 |
Clear the root index when the model is reset.
Task-number: QTBUG-18839
Change-Id: I46608d7481d820fa74a9be60df1e018e70a761c6
Merge-request: 2598
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index 97ce059..4c839a1 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -1398,7 +1398,12 @@ void QDeclarativeVisualDataModel::_q_layoutChanged() void QDeclarativeVisualDataModel::_q_modelReset() { + Q_D(QDeclarativeVisualDataModel); + d->m_root = QModelIndex(); emit modelReset(); + emit rootIndexChanged(); + if (d->m_abstractItemModel && d->m_abstractItemModel->canFetchMore(d->m_root)) + d->m_abstractItemModel->fetchMore(d->m_root); } void QDeclarativeVisualDataModel::_q_createdPackage(int index, QDeclarativePackage *package) |