src/hbwidgets/itemviews/hbtreeview.cpp
changeset 5 627c4a0fd0e7
parent 2 06ff229162e9
child 6 c3690ec91ef8
equal deleted inserted replaced
3:11d3954df52a 5:627c4a0fd0e7
   176         return;
   176         return;
   177     }
   177     }
   178 
   178 
   179     if (d->isParentValid(parent)) {
   179     if (d->isParentValid(parent)) {
   180         if (isExpanded(parent) || parent == d->mModelIterator->rootIndex()) {
   180         if (isExpanded(parent) || parent == d->mModelIterator->rootIndex()) {
   181             int lastStartPoint = 0;
       
   182             for (int i = start; i <= end; ++i) {
   181             for (int i = start; i <= end; ++i) {
   183                 QModelIndex newParent = d->treeModelIterator()->index(i, parent);
   182                 HbAbstractItemView::rowsInserted(parent, i, i);
       
   183                 // if there is expanded parent under expanding parent, handle it recursively
       
   184                 QModelIndex newParent = d->treeModelIterator()->model()->index(i, 0, parent);
   184                 int childCount = d->treeModelIterator()->childCount(newParent);
   185                 int childCount = d->treeModelIterator()->childCount(newParent);
   185                 if (childCount > 0 && isExpanded(newParent)) {
   186                 if (childCount > 0 && isExpanded(newParent)) {
   186                     HbAbstractItemView::rowsInserted(parent, lastStartPoint, i);
       
   187                     lastStartPoint = i;
       
   188                     rowsInserted(newParent, 0, childCount - 1);
   187                     rowsInserted(newParent, 0, childCount - 1);
   189                 }
   188                 } 
   190             }
   189             }
   191 
       
   192             HbAbstractItemView::rowsInserted(parent, lastStartPoint, end);
       
   193 
   190 
   194             if (d->animationEnabled(true)) {
   191             if (d->animationEnabled(true)) {
   195                 if (d->mInSetExpanded) {
   192                 if (d->mInSetExpanded) {
   196                     d->startAppearEffect("treeviewitem", "expand", parent, start, end);
   193                     d->startAppearEffect("treeviewitem", "expand", parent, start, end);
   197                 } else {
   194                 } else {