29 #include <QTreeWidget>
31 #include <yui/YTree.h>
38 class YQTree :
public QFrame,
public YTree
47 YQTree( YWidget * parent,
const std::string & label,
bool multiSelection,
bool recursiveSelection );
59 virtual void setLabel(
const std::string & label );
76 virtual void selectItem( YItem * item,
bool selected =
true );
119 virtual void setSize(
int newWidth,
int newHeight );
154 void slotItemClicked( QTreeWidgetItem * item,
int column );
194 void selectItem(QTreeWidgetItem * item,
bool selected,
bool recursive);
215 QTreeWidget * _qt_treeWidget;
228 QTreeWidget * parent,
250 virtual void setOpen(
bool open );
259 YTreeItem * yTreeItem,
270 QString
key(
int column,
bool ascending )
const;
278 YTreeItem * _origItem;
284 #endif // ifndef YQTree_h
virtual void rebuildTree()
Rebuild the displayed tree from the internally stored YTreeItems.
virtual void setSize(int newWidth, int newHeight)
Set the new size of the widget.
virtual void selectItem(YItem *item, bool selected=true)
Select or deselect an item.
virtual int preferredHeight()
Preferred height of the widget.
YQTreeItem(YQTree *tree, QTreeWidget *parent, YTreeItem *origItem, int serial)
Constructor for a top level item.
virtual void setEnabled(bool enabled)
Set enabled/disbled state.
void slotItemCollapsed(QTreeWidgetItem *item)
Propagate an "item collapsed" event to the underlying YTreeItem.
virtual ~YQTree()
Destructor.
void buildDisplayTree(YQTreeItem *parentItem, YItemIterator begin, YItemIterator end)
Build a tree of items that will be displayed (YQTreeItems) from the original items between iterators ...
void slotActivated(QTreeWidgetItem *item)
Propagate a double click or pressing the space key on a tree item.
virtual void setOpen(bool open)
Open this item.
void slotContextMenu(const QPoint &pos)
Propagate a context menu selection.
void slotItemExpanded(QTreeWidgetItem *item)
Propagate an "item expanded" event to the underlying YTreeItem.
void slotSelectionChanged()
Propagate a tree item selection.
void slotItemChanged(QTreeWidgetItem *item)
Propagate a tree item change.
virtual int preferredWidth()
Preferred width of the widget.
YQTree(YWidget *parent, const std::string &label, bool multiSelection, bool recursiveSelection)
Constructor.
virtual YTreeItem * currentItem()
Return the the item that currently has the keyboard focus or 0 if no item currently has the keyboard ...
void openBranch(YQTreeItem *item)
Open the branch of 'item' recursively to its toplevel item.
virtual bool setKeyboardFocus()
Accept the keyboard focus.
virtual void deleteAllItems()
Delete all items.
virtual void setLabel(const std::string &label)
Change the label text.
YTreeItem * origItem()
Returns the original YTreeItem of which this item is a clone.
virtual void deselectAllItems()
Deselect all items.
QString key(int column, bool ascending) const
Sort key of this item.