src/hbwidgets/itemviews/hblistitemcontainer_p.cpp
changeset 6 c3690ec91ef8
parent 3 11d3954df52a
child 7 923ff622b8b9
equal deleted inserted replaced
5:627c4a0fd0e7 6:c3690ec91ef8
   167     }
   167     }
   168 
   168 
   169     if (minHeight == 0.0) {
   169     if (minHeight == 0.0) {
   170         QModelIndex index;
   170         QModelIndex index;
   171         while (mItems.isEmpty()) {
   171         while (mItems.isEmpty()) {
   172             // in practise following conditions must apply: itemview is empty and scrollTo() has been called.
   172             // in practize following conditions must apply: itemview is empty and scrollTo() has been called.
   173             // Starts populating items from given mFirstItemIndex
   173             // Starts populating items from given mFirstItemIndex
   174             if ( mFirstItemIndex.isValid()) {
   174             if ( mFirstItemIndex.isValid()) {
   175                 index = mFirstItemIndex;
   175                 index = mFirstItemIndex;
   176                 const_cast<QPersistentModelIndex&>(mFirstItemIndex) = QModelIndex();
   176                 const_cast<QPersistentModelIndex&>(mFirstItemIndex) = QModelIndex();
   177             } else {
   177             } else {
   238     if (animate) {
   238     if (animate) {
   239         Q_D(HbListItemContainer);
   239         Q_D(HbListItemContainer);
   240 
   240 
   241         HbAbstractViewItem *viewItem = d->item(index);
   241         HbAbstractViewItem *viewItem = d->item(index);
   242         if (viewItem) {
   242         if (viewItem) {
   243             QPair<HbAbstractViewItem *, int> pair(viewItem, d->mapToLayoutIndex(d->mItems.indexOf(viewItem)));
   243             if (HbEffect::effectRunning(viewItem)) {
   244             d->mAnimatedItems.append(pair);
   244                 QPair<HbAbstractViewItem *, int> pair(viewItem, d->mapToLayoutIndex(d->mItems.indexOf(viewItem)));
       
   245                 d->mAnimatedItems.append(pair);
       
   246             }
   245         } else {
   247         } else {
   246             return;
   248             return;
   247         }
   249         }
   248     }
   250     }
   249 
   251 
   391                 // need to be checked - important case is only when new
   393                 // need to be checked - important case is only when new
   392                 // containerHeight is smaller than old containerHeight
   394                 // containerHeight is smaller than old containerHeight
   393                 // because only then container can go out of bounds
   395                 // because only then container can go out of bounds
   394                 qreal viewSize = itemView()->boundingRect().size().height();
   396                 qreal viewSize = itemView()->boundingRect().size().height();
   395                 if (layoutPreferredHeight + pos().y() < viewSize) {
   397                 if (layoutPreferredHeight + pos().y() < viewSize) {
   396                     // position is allways negative
   398                     // position is always negative
   397                     // view out of bounds
   399                     // view out of bounds
   398                     if (diff > 0.0) {
   400                     if (diff > 0.0) {
   399                         QPointF posDiff(pos().x(), 0.0);
   401                         QPointF posDiff(pos().x(), 0.0);
   400                         while (item
   402                         while (item
   401                                && layoutPreferredHeight - d->mItems.at(0)->size().height() > viewSize
   403                                && layoutPreferredHeight - d->mItems.at(0)->size().height() > viewSize