src/hbwidgets/itemviews/hbtreeitemcontainer_p.cpp
changeset 6 c3690ec91ef8
parent 2 06ff229162e9
child 21 4633027730f5
child 34 ed14f46c0e55
equal deleted inserted replaced
5:627c4a0fd0e7 6:c3690ec91ef8
   185     }
   185     }
   186 
   186 
   187     if (minHeight == 0.0) {
   187     if (minHeight == 0.0) {
   188         QModelIndex index;
   188         QModelIndex index;
   189         while (mItems.isEmpty()) {
   189         while (mItems.isEmpty()) {
   190             // in practise following conditions must apply: itemview is empty and scrollTo() has been called.
   190             // in practize following conditions must apply: itemview is empty and scrollTo() has been called.
   191             // Starts populating items from given mFirstItemIndex
   191             // Starts populating items from given mFirstItemIndex
   192             if ( mFirstItemIndex.isValid()) {
   192             if ( mFirstItemIndex.isValid()) {
   193                 index = mFirstItemIndex;
   193                 index = mFirstItemIndex;
   194                 const_cast<QPersistentModelIndex&>(mFirstItemIndex) = QModelIndex();
   194                 const_cast<QPersistentModelIndex&>(mFirstItemIndex) = QModelIndex();
   195             } else {
   195             } else {
   424                 // need to be checked - important case is only when new
   424                 // need to be checked - important case is only when new
   425                 // containerHeight is smaller than old containerHeight
   425                 // containerHeight is smaller than old containerHeight
   426                 // because only then container can go out of bounds
   426                 // because only then container can go out of bounds
   427                 qreal viewSize = itemView()->boundingRect().size().height();
   427                 qreal viewSize = itemView()->boundingRect().size().height();
   428                 if (layoutPreferredHeight + pos().y() < viewSize) {
   428                 if (layoutPreferredHeight + pos().y() < viewSize) {
   429                     // position is allways negative
   429                     // position is always negative
   430                     // view out of bounds
   430                     // view out of bounds
   431                     if (diff > 0.0) {
   431                     if (diff > 0.0) {
   432                         QPointF posDiff(pos().x(), 0.0);
   432                         QPointF posDiff(pos().x(), 0.0);
   433                         while (item
   433                         while (item
   434                                && layoutPreferredHeight - d->mItems.at(0)->size().height() > viewSize
   434                                && layoutPreferredHeight - d->mItems.at(0)->size().height() > viewSize