Logo Search packages:      
Sourcecode: kdbg version File versions

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

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

Parameters:
item specifies the item to expand.
emitSignal specifies whether the signal expanded should be emitted.

Definition at line 1316 of file ktreeview.cpp.

References KTreeViewItem::delayedExpanding, expanded(), expanding(), KTreeViewItem::isExpanded(), KTreeViewItem::isVisible(), itemAt(), itemRow(), KTreeViewItem::owner, setCurrentItem(), and KTreeViewItem::setExpanded().

Referenced by expandItem(), 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;

    bool allow = true;

    if (subRoot->delayedExpanding) {
      emit expanding(subRoot, allow);
    }
    if (!allow)
      return;

    subRoot->setExpanded(true);

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


Generated by  Doxygen 1.6.0   Back to index