examples/itemviews/fetchmore/filelistmodel.cpp
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
equal deleted inserted replaced
30:5dc02b23752f 33:3e2da88830cd
    90 void FileListModel::fetchMore(const QModelIndex & /* index */)
    90 void FileListModel::fetchMore(const QModelIndex & /* index */)
    91 {
    91 {
    92     int remainder = fileList.size() - fileCount;
    92     int remainder = fileList.size() - fileCount;
    93     int itemsToFetch = qMin(100, remainder);
    93     int itemsToFetch = qMin(100, remainder);
    94 
    94 
    95     beginInsertRows(QModelIndex(), fileCount, fileCount+itemsToFetch);
    95     beginInsertRows(QModelIndex(), fileCount, fileCount+itemsToFetch-1);
    96     
    96     
    97     fileCount += itemsToFetch;
    97     fileCount += itemsToFetch;
    98 
    98 
    99     endInsertRows();
    99     endInsertRows();
   100 
   100