diff options
-rw-r--r-- | common/modelresult.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/modelresult.cpp b/common/modelresult.cpp index d13f867..9f3e662 100644 --- a/common/modelresult.cpp +++ b/common/modelresult.cpp | |||
@@ -155,6 +155,13 @@ bool ModelResult<T, Ptr>::hasChildren(const QModelIndex &parent) const | |||
155 | if (mQuery.parentProperty.isEmpty() && parent.isValid()) { | 155 | if (mQuery.parentProperty.isEmpty() && parent.isValid()) { |
156 | return false; | 156 | return false; |
157 | } | 157 | } |
158 | //Figure out whether we have children | ||
159 | if (canFetchMore(parent)) { | ||
160 | //Since we don't retrieve that information as part of the entity, | ||
161 | //we have to query for the children to see if we have some | ||
162 | auto p = const_cast<ModelResult<T, Ptr>*>(this); | ||
163 | p->fetchMore(parent); | ||
164 | } | ||
158 | return QAbstractItemModel::hasChildren(parent); | 165 | return QAbstractItemModel::hasChildren(parent); |
159 | } | 166 | } |
160 | 167 | ||