TreeView Class Reference

A sidebar to manage the nodes in a tree structure. More...

#include <treeview.h>

List of all members.

Public Slots

void updateActions ()
void selectItem ()

Signals

void nodeSelected (Node *node)

Public Member Functions

 TreeView (const QString &title, QWidget *parent=0, Qt::WindowFlags flags=0)
 ~TreeView ()
QList< QAction * > * getNodeActions () const
TreeModelgetTreeModel ()
void selectItem (QModelIndex &item)
void selectItem (NodeId id)

Detailed Description

A sidebar to manage the nodes in a tree structure.

The nodes are structured as a tree and the TreeView provides a graphical interface to manage the nodes. It uses the TreeModel to access the data. Also it provides the actions to add, remove and move nodes per drag and drop.

This TreeView is allowed to dock at the right and the left docking areas.

Author:
Manuel Unglaub

Constructor & Destructor Documentation

TreeView::TreeView ( const QString &  title,
QWidget *  parent = 0,
Qt::WindowFlags  flags = 0 
)

The constructor.

Constructs a TreeView which is a child of parent and has the providet widow flags. The TreeViw will be placed in the left dock widget area.

The window title is set to title. This title is used when the TreeView is docked and undocked. It is also used in the context menu provided by MainWindow. The parameters will be passed to the QDockWidget constructor.

Parameters:
title The title of the TreeView.
parent The parent of this TreeView.
flags The window flags of this TreeView.
TreeView::~TreeView (  ) 

The destructor.

Destroys the object.


Member Function Documentation

QList< QAction * > * TreeView::getNodeActions (  )  const

Get the node related actions to use them in other menus. The TreeView will not delete the QList, so if you use this function you have to delete the QList. The TreeView will take care of the actions so do not delete them.

Returns:
A pointer to a QList with pointers to node related actions.
TreeModel * TreeView::getTreeModel (  ) 

Get the TreeModel to use it as a source for other models.

Returns:
A pointer to the model of the QTreeView.
void TreeView::nodeSelected ( Node node  )  [signal]

This signal is emited in case a node is selected.

Parameters:
node The node wich is selected.
void TreeView::selectItem (  )  [slot]

Provide different parts of the application with the currently selected node.

void TreeView::selectItem ( NodeId  id  ) 

Select a node by a given NodeId.

Parameters:
id The NodeId of the node wich will be selected.
void TreeView::selectItem ( QModelIndex &  item  ) 

Select a node by a given QModelIndex.

Parameters:
item The QModelIndex of the node which will be selected.
void TreeView::updateActions (  )  [slot]

Check the availability of the node related actions and enable or disable them.


The documentation for this class was generated from the following files:
Generated on Fri May 14 19:12:53 2010 for Silence by  doxygen 1.6.3