diff options
| author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-12-23 08:08:28 (GMT) |
|---|---|---|
| committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-12-23 08:08:28 (GMT) |
| commit | af5cda49d5b6fa22e1cb1567ac874787e31a87c2 (patch) | |
| tree | b4f0b826b7a88845938ad074d105efe0d575a424 /src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp | |
| parent | e6694ebe4081b807b1bb0946e17e73840019ec6d (diff) | |
| parent | eb395badcba6eada75ad5e6a72b74f5204170ed9 (diff) | |
| download | Qt-af5cda49d5b6fa22e1cb1567ac874787e31a87c2.zip Qt-af5cda49d5b6fa22e1cb1567ac874787e31a87c2.tar.gz Qt-af5cda49d5b6fa22e1cb1567ac874787e31a87c2.tar.bz2 | |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml:
WorkerScript could starve image loading of CPU.
More docs for FolderListModel
Improve docs on attached properties on view delegates.
Models which load incrementally via fetchMore() don't work.
Try fixing build error on Windows
Ensure PathView doesn't jump when starting to drag.
Nested flickables would react alternately to flicks.
Improve QDeclarativeComponent test coverage.
Add additional QDeclarativeProperty autotests.
Removing all visible items in ListView resulted in blank view.
XmlListModel requests should set 'Accept' header to 'application/xml'
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp')
| -rw-r--r-- | src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp index 4f5213a..bf9263b 100644 --- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp +++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp @@ -773,6 +773,8 @@ void QDeclarativeVisualDataModel::setModel(const QVariant &model) QObject::connect(d->m_abstractItemModel, SIGNAL(modelReset()), this, SLOT(_q_modelReset())); QObject::connect(d->m_abstractItemModel, SIGNAL(layoutChanged()), this, SLOT(_q_layoutChanged())); d->m_metaDataCacheable = true; + if (d->m_abstractItemModel->canFetchMore(d->m_root)) + d->m_abstractItemModel->fetchMore(d->m_root); return; } if ((d->m_visualItemModel = qvariant_cast<QDeclarativeVisualDataModel *>(model))) { @@ -870,6 +872,8 @@ void QDeclarativeVisualDataModel::setRootIndex(const QVariant &root) if (d->m_root != modelIndex) { int oldCount = d->modelCount(); d->m_root = modelIndex; + if (d->m_abstractItemModel && d->m_abstractItemModel->canFetchMore(modelIndex)) + d->m_abstractItemModel->fetchMore(modelIndex); int newCount = d->modelCount(); if (d->m_delegate && oldCount) emit itemsRemoved(0, oldCount); @@ -1094,6 +1098,8 @@ QDeclarativeItem *QDeclarativeVisualDataModel::item(int index, const QByteArray d->m_delegateValidated = true; } } + if (d->modelCount()-1 == index && d->m_abstractItemModel && d->m_abstractItemModel->canFetchMore(d->m_root)) + d->m_abstractItemModel->fetchMore(d->m_root); return item; } |
