src/hbwidgets/itemviews/hbtreeview.cpp
branchGCC_SURGE
changeset 15 f378acbc9cfb
parent 6 c3690ec91ef8
equal deleted inserted replaced
9:730c025d4b77 15:f378acbc9cfb
   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 {
   535     qobject_cast<HbTreeItemContainer*>(d->mContainer)->setIndentation(indentation);
   532     qobject_cast<HbTreeItemContainer*>(d->mContainer)->setIndentation(indentation);
   536 }
   533 }
   537 
   534 
   538 /*!
   535 /*!
   539     Returns indentation of tree view items. 
   536     Returns indentation of tree view items. 
   540     The returned value is either default value or set by setIndentation().
   537     The returned value is either default value or value set by setIndentation().
   541 
   538 
   542     Default value is -1. In this case indentation from style sheet is used.
   539     Default value is -1. In this case indentation from style sheet is used.
   543 
   540 
   544     \sa setIndentation()
   541     \sa setIndentation()
   545 */
   542 */