Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TreeView Class Reference

#include <TreeView.hxx>

Inheritance diagram for TreeView:
Inheritance graph

Signals

void itemListToProcess (QStringList itemNameIdList, int actionId)
 

Public Member Functions

 TreeView (QWidget *parent=0)
 
 ~TreeView ()
 
int addAction (QString label)
 
void clearActions ()
 

Protected Member Functions

void contextMenuEvent (QContextMenuEvent *event)
 

Private Slots

void processMenuAction (QAction *actionSelected)
 

Private Member Functions

QString _idToName (int actionId)
 
int _nameToId (QString actionName)
 

Private Attributes

int _lastActionId
 
QList< QAction * > _listActions
 

Constructor & Destructor Documentation

TreeView::TreeView ( QWidget parent = 0)

References _lastActionId, and addAction().

TreeView::~TreeView ( )

Member Function Documentation

QString TreeView::_idToName ( int  actionId)
private

You must use this function to create the name of an action object from its id.

int TreeView::_nameToId ( QString  actionName)
private

You must use this function to create the id of an action object from its name (stored in objectName() attribute of the QAction).

int TreeView::addAction ( QString  label)

This function defines a menu item to add in the popup menu associated to this TreeView, and return an integer that corresponds to the unique identifier of this action (identifier used in the signal emitted to notify observers that an action has been selected). Then the caller of this function has to take care of this return id (i.e. has to store it in its internal tables) to be able to process the notifications from this TreeView.

References _idToName(), _lastActionId, and _listActions.

void TreeView::clearActions ( )

This function removes all actions previously defined for the popup menu of this TreeView.

References _listActions.

void TreeView::contextMenuEvent ( QContextMenuEvent *  event)
protected
void TreeView::itemListToProcess ( QStringList  itemNameIdList,
int  actionId 
)
signal
void TreeView::processMenuAction ( QAction actionSelected)
privateslot

This SLOT is connected on the signal emited by the menu when an action is selected.

References _nameToId(), TreeModel::getItem(), itemListToProcess(), LOG, and TreeItem::nameId().

Member Data Documentation

int TreeView::_lastActionId
private
QList<QAction*> TreeView::_listActions
private

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