libyui-qt
Loading...
Searching...
No Matches
YQTree Class Reference
Inheritance diagram for YQTree:
Collaboration diagram for YQTree:

Public Member Functions

 YQTree (YWidget *parent, const std::string &label, bool multiSelection, bool recursiveSelection)
 
virtual ~YQTree ()
 
virtual void setLabel (const std::string &label)
 
virtual void rebuildTree ()
 
virtual void selectItem (YItem *item, bool selected=true)
 
virtual void deselectAllItems ()
 
virtual void deleteAllItems ()
 
virtual void setEnabled (bool enabled)
 
virtual int preferredWidth ()
 
virtual int preferredHeight ()
 
virtual void setSize (int newWidth, int newHeight)
 
virtual bool setKeyboardFocus ()
 
virtual YTreeItem * currentItem ()
 
virtual void activate ()
 

Protected Slots

void slotSelectionChanged ()
 
void slotItemChanged (QTreeWidgetItem *item)
 
void slotItemClicked (QTreeWidgetItem *item, int column)
 
void slotActivated (QTreeWidgetItem *item)
 
void slotItemExpanded (QTreeWidgetItem *item)
 
void slotItemCollapsed (QTreeWidgetItem *item)
 
void slotContextMenu (const QPoint &pos)
 

Protected Member Functions

void selectItem (YQTreeItem *item)
 
void selectItem (QTreeWidgetItem *item, bool selected, bool recursive)
 
void openBranch (YQTreeItem *item)
 
void buildDisplayTree (YQTreeItem *parentItem, YItemIterator begin, YItemIterator end)
 

Protected Attributes

YQWidgetCaption_caption
 
QTreeWidget * _qt_treeWidget
 
int _nextSerialNo
 

Constructor & Destructor Documentation

◆ YQTree()

YQTree::YQTree ( YWidget * parent,
const std::string & label,
bool multiSelection,
bool recursiveSelection )

Constructor.

◆ ~YQTree()

YQTree::~YQTree ( )
virtual

Destructor.

Member Function Documentation

◆ activate()

void YQTree::activate ( )
virtual

Activate the item selected in the tree. Can be used in tests to simulate user input.

Derived classes are required to implement this.

◆ buildDisplayTree()

void YQTree::buildDisplayTree ( YQTreeItem * parentItem,
YItemIterator begin,
YItemIterator end )
protected

Build a tree of items that will be displayed (YQTreeItems) from the original items between iterators 'begin' and 'end' as child items of 'parentItem' (or as toplevel items if 'parentItem' is 0).

◆ currentItem()

YTreeItem * YQTree::currentItem ( )
virtual

Return the the item that currently has the keyboard focus or 0 if no item currently has the keyboard focus.

Reimplemented from YMultiSelectionBox.

◆ deleteAllItems()

void YQTree::deleteAllItems ( )
virtual

Delete all items.

Reimplemented from YSelectionWidget.

◆ deselectAllItems()

void YQTree::deselectAllItems ( )
virtual

Deselect all items.

Reimplemented from YSelectionWidget.

◆ openBranch()

void YQTree::openBranch ( YQTreeItem * item)
protected

Open the branch of 'item' recursively to its toplevel item.

◆ preferredHeight()

int YQTree::preferredHeight ( )
virtual

Preferred height of the widget.

Reimplemented from YWidget.

◆ preferredWidth()

int YQTree::preferredWidth ( )
virtual

Preferred width of the widget.

Reimplemented from YWidget.

◆ rebuildTree()

void YQTree::rebuildTree ( )
virtual

Rebuild the displayed tree from the internally stored YTreeItems.

The application should call this (once) after all items have been added with addItem(). YTree::addItems() calls this automatically.

Implemented from YTree.

◆ selectItem() [1/3]

void YQTree::selectItem ( QTreeWidgetItem * item,
bool selected,
bool recursive )
protected

Select or deselect an item, recursively

◆ selectItem() [2/3]

void YQTree::selectItem ( YItem * item,
bool selected = true )
virtual

Select or deselect an item.

Reimplemented from YSelectionWidget.

◆ selectItem() [3/3]

void YQTree::selectItem ( YQTreeItem * item)
protected

Select an item via the corresponding YQTreItem.

◆ setEnabled()

void YQTree::setEnabled ( bool enabled)
virtual

Set enabled/disbled state.

Reimplemented from YWidget.

◆ setKeyboardFocus()

bool YQTree::setKeyboardFocus ( )
virtual

Accept the keyboard focus.

◆ setLabel()

void YQTree::setLabel ( const std::string & label)
virtual

Change the label text.

Reimplemented from YSelectionWidget.

◆ setSize()

void YQTree::setSize ( int newWidth,
int newHeight )
virtual

Set the new size of the widget.

Reimplemented from YWidget.

◆ slotActivated

void YQTree::slotActivated ( QTreeWidgetItem * item)
protectedslot

Propagate a double click or pressing the space key on a tree item.

This will trigger an 'Activated' event if 'notify' is set.

◆ slotContextMenu

void YQTree::slotContextMenu ( const QPoint & pos)
protectedslot

Propagate a context menu selection

This will trigger an 'ContextMenuActivated' event if 'notifyContextMenu' is set.

◆ slotItemChanged

void YQTree::slotItemChanged ( QTreeWidgetItem * item)
protectedslot

Propagate a tree item change.

This will trigger a 'ValueChanged' event if 'notify' is set.

◆ slotItemCollapsed

void YQTree::slotItemCollapsed ( QTreeWidgetItem * item)
protectedslot

Propagate an "item collapsed" event to the underlying YTreeItem.

◆ slotItemExpanded

void YQTree::slotItemExpanded ( QTreeWidgetItem * item)
protectedslot

Propagate an "item expanded" event to the underlying YTreeItem.

◆ slotSelectionChanged

void YQTree::slotSelectionChanged ( )
protectedslot

Propagate a tree item selection.

This will trigger a 'SelectionChanged' event if 'notify' is set.


The documentation for this class was generated from the following files: