src/hbwidgets/itemviews/hbabstractitemcontainer_p.cpp
changeset 6 c3690ec91ef8
parent 5 627c4a0fd0e7
child 7 923ff622b8b9
equal deleted inserted replaced
5:627c4a0fd0e7 6:c3690ec91ef8
   277             break;
   277             break;
   278         }
   278         }
   279     }
   279     }
   280 
   280 
   281     int itemsAdded = 0;
   281     int itemsAdded = 0;
   282     // in practise following conditions must apply: itemview is empty and scrollTo() has been called.
   282     // in practize following conditions must apply: itemview is empty and scrollTo() has been called.
   283     // Starts populating items from given mFirstItemIndex
   283     // Starts populating items from given mFirstItemIndex
   284     if (    !index.isValid()
   284     if (    !index.isValid()
   285         &&  mFirstItemIndex.isValid()) {
   285         &&  mFirstItemIndex.isValid()) {
   286         index = mFirstItemIndex;
   286         index = mFirstItemIndex;
   287         q->insertItem(mItems.count(), index);
   287         q->insertItem(mItems.count(), index);
   288         itemsAdded++;
   288         itemsAdded++;
   289 
   289 
   290         mFirstItemIndex = QModelIndex();
   290         mFirstItemIndex = QModelIndex();
   291     }
   291     }
   292  
   292 
   293     while (itemsAdded < amount) {
   293     while (itemsAdded < amount) {
   294         index = mItemView->modelIterator()->nextIndex(index);
   294         index = mItemView->modelIterator()->nextIndex(index);
   295         if (!index.isValid()) {
   295         if (!index.isValid()) {
   296             break;
   296             break;
   297         }
   297         }