A sidebar to manage the nodes in a tree structure. More...
#include <treeview.h>
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 |
TreeModel * | getTreeModel () |
void | selectItem (QModelIndex &item) |
void | selectItem (NodeId id) |
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.
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.
TreeView::~TreeView | ( | ) |
The destructor.
Destroys the object.
QList< QAction * > * TreeView::getNodeActions | ( | ) | const |
TreeModel * TreeView::getTreeModel | ( | ) |
Get the TreeModel to use it as a source for other models.
void TreeView::nodeSelected | ( | Node * | node | ) | [signal] |
This signal is emited in case a node is selected.
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 | ) |
void TreeView::selectItem | ( | QModelIndex & | item | ) |
Select a node by a given QModelIndex.
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.