Logo Search packages:      
Sourcecode: kdbg version File versions

void KTreeView::appendChildItem ( KTreeViewItem parent,
KTreeViewItem child 
) [protected]

Appends a new child item to a parent item as a new direct child. All internal state is updated and the widget is repainted as necessary. The new child remains invisible if any ancestor of it (including the parent) is collapsed.

Parameters:
parent specifies the parent of which the new item will become a child
child specifies the new child item
See also:
appendChildItem

Definition at line 1218 of file ktreeview.cpp.

References KTreeViewItem::appendChild(), KTreeViewItem::childCount(), KTreeViewItem::hasChild(), KTreeViewItem::isVisible(), KTreeViewItem::setDrawExpandButton(), KTreeViewItem::setDrawText(), KTreeViewItem::setDrawTree(), and KTreeViewItem::setExpanded().

{
    theParent->appendChild(newItem);

    // set item state
    newItem->setDrawExpandButton(drawExpandButton);
    newItem->setDrawTree(drawTree);
    newItem->setDrawText(showText);
    if (level(newItem) < expansion) {
      newItem->setExpanded(true);
    }

    // fix up branch levels of any children that the new item may already have
    if(newItem->hasChild()) {
      fixChildren(newItem);
    }

    // if necessary, adjust cell width, number of rows and repaint
    if (newItem->isVisible() || theParent->childCount() == 1) {
      bool autoU = autoUpdate();
      setAutoUpdate(false);
      updateVisibleItems();
      setAutoUpdate(autoU);
      if (autoU && isVisible())
          repaint();
    }
}


Generated by  Doxygen 1.6.0   Back to index