Logo Search packages:      
Sourcecode: kdbg version File versions

void KTreeView::collapseSubTree ( KTreeViewItem item,
bool  emitSignal 
) [protected, virtual]

Collapses the specified subtree and updates the display. The specified item need not be visible. This function does nothing if the item is already collapsed.

Parameters:
item specifies the item to collapse.
emitSignal specifies whether the signal collapsed should be emitted.

Definition at line 1279 of file ktreeview.cpp.

References collapsed(), KTreeViewItem::isExpanded(), KTreeViewItem::isVisible(), itemAt(), itemRow(), KTreeViewItem::owner, setCurrentItem(), and KTreeViewItem::setExpanded().

Referenced by collapseItem(), keyPressEvent(), and mousePressEvent().

{
    assert(subRoot->owner == this);
    if (!subRoot->isExpanded())
      return;

    // must move the current item if it is visible
    KTreeViewItem* cur = current >= 0  ?  itemAt(current)  :  0;

    subRoot->setExpanded(false);
    if (subRoot->isVisible()) {
      bool autoU = autoUpdate();
      setAutoUpdate(false);
      updateVisibleItems();
      // re-seat current item
      if (cur != 0) {
          setCurrentItem(itemRow(cur));
      }
      if (emitSignal) {
          emit collapsed(itemRow(subRoot));
      }
      setAutoUpdate(autoU);
      if (autoU && isVisible())
          repaint();
    }
}


Generated by  Doxygen 1.6.0   Back to index