Logo Search packages:      
Sourcecode: kdbg version File versions

bool KTreeView::insertItem ( const char *  text,
const QPixmap &  pixmap,
const KPath &  path,
bool  prefix = true 
)

This overloaded function inserts a new item into the tree, but a path through the tree specifies the reference insert position. If there is no item at the specified path, the item is simply appended to the tree at the topmost level.

Parameters:
text specifies text for the new item; must not be 0
pixmap specifies a pixmap for the new item
path specifies the insert position
prefix if true, the new item is inserted before the reference item, otherwise after it
Returns:
true if the item has been successfully inserted in the tree, otherwise false.
See also:
insertItem

Definition at line 854 of file ktreeview.cpp.

References insertItem(), itemAt(), and KTreeViewItem::setDeleteChildren().

{
    KTreeViewItem* refItem = itemAt(path);

    KTreeViewItem* item = new KTreeViewItem(theText, thePixmap);
    item->setDeleteChildren(true);

    bool success = insertItem(refItem, item, prefix);
    if (!success)
      delete item;
    return success;
}


Generated by  Doxygen 1.6.0   Back to index