summaryrefslogtreecommitdiffstats
path: root/examples/widgets/itemviews/fetchmore/filelistmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/itemviews/fetchmore/filelistmodel.cpp')
-rw-r--r--examples/widgets/itemviews/fetchmore/filelistmodel.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/widgets/itemviews/fetchmore/filelistmodel.cpp b/examples/widgets/itemviews/fetchmore/filelistmodel.cpp
index cd21712e04..086d45eca3 100644
--- a/examples/widgets/itemviews/fetchmore/filelistmodel.cpp
+++ b/examples/widgets/itemviews/fetchmore/filelistmodel.cpp
@@ -103,6 +103,9 @@ void FileListModel::fetchMore(const QModelIndex & /* index */)
int remainder = fileList.size() - fileCount;
int itemsToFetch = qMin(100, remainder);
+ if (itemsToFetch <= 0)
+ return;
+
beginInsertRows(QModelIndex(), fileCount, fileCount+itemsToFetch-1);
fileCount += itemsToFetch;