summaryrefslogtreecommitdiffstats
path: root/src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp
diff options
context:
space:
mode:
authorBogDan Vatra <bogdan.vatra.ford@kdab.com>2016-05-16 18:10:04 +0300
committerBogDan Vatra <bogdan@kdab.com>2016-05-17 16:08:22 +0000
commit7f4a65964c7f132bc7ebe09630e56dfe71307996 (patch)
tree83649f29cb333920d6ce7421a4eb702c16b09eb4 /src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp
parentb951672d04ed3fcc4608e224269da3ae0bad9c0c (diff)
Ensure the item is in cache when reqest it
Change-Id: Ic739c4e761350fc38b42485b18b5b4c3a30c946b Reviewed-by: Continuous Integration (KDAB) <build@kdab.com> Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Diffstat (limited to 'src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp')
-rw-r--r--src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp b/src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp
index baac62c..0ecae46 100644
--- a/src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp
+++ b/src/remoteobjects/qremoteobjectabstractitemmodelreplica.cpp
@@ -285,7 +285,8 @@ void QAbstractItemModelReplicaPrivate::onRowsRemoved(const IndexList &parent, in
auto parentItem = cacheData(parentIndex);
q->beginRemoveRows(parentIndex, start, end);
- parentItem->removeChildren(start, end);
+ if (parentItem)
+ parentItem->removeChildren(start, end);
q->endRemoveRows();
}
@@ -762,7 +763,7 @@ QVariant QAbstractItemModelReplica::data(const QModelIndex & index, int role) co
IndexList parentList = toModelIndexList(index.parent(), this);
IndexList start = IndexList() << parentList << ModelIndex(row, 0);
IndexList end = IndexList() << parentList << ModelIndex(row, std::max(0, parentItem->columnCount - 1));
-// parentItem->ensureChildren(low, high);
+ parentItem->ensureChildren(row, row);
Q_ASSERT(toQModelIndex(start, this).isValid());
RequestedData data;