diff options
Diffstat (limited to 'examples/widgets/itemviews/fetchmore')
-rw-r--r-- | examples/widgets/itemviews/fetchmore/filelistmodel.cpp | 3 |
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; |