GraphTool  1.0
Tool for analyzing and graphically visualizing code dependencies for Ericsson.
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Public Slots | Signals | Public Member Functions | List of all members
TreeView Class Reference

#include <treeview.h>

Inheritance diagram for TreeView:
Inheritance graph
[legend]
Collaboration diagram for TreeView:
Collaboration graph
[legend]

Public Slots

void expand_row (QModelIndex item)
 
void treeview_column_action (QAction *action)
 
void onCustomContextMenu (const QPoint &point)
 
void item_action (QAction *action)
 
void keyPressEvent (QKeyEvent *event)
 
void keyReleaseEvent (QKeyEvent *event)
 
void mouseEvent (QModelIndex item)
 

Signals

void expand_item_in_graph (std::string item_name, bool last)
 
void contract_item_in_graph (std::string item_name, bool last)
 
void item_selected_in_treeview (std::string item_name, bool first, bool multiple)
 
void focus_item_in_graph (std::string item_name)
 
void exclude_item_in_graph (std::string item_name, bool last)
 

Public Member Functions

 TreeView (QWidget *parent=0)
 
void setModel (QSortFilterProxyModel *new_model_dependents, QSortFilterProxyModel *new_model_depenencies, QSortFilterProxyModel *new_model_both, std::string root_name)
 
QSortFilterProxyModel * model_dependencies ()
 
QSortFilterProxyModel * model_dependents ()
 
QSortFilterProxyModel * model_both ()
 
void select_row_in_treeview (std::string item, bool last)
 
void deselect_all_rows_in_treeview ()
 
std::vector< QTreeView * > tree_views ()
 
int column_index (QString str)
 
void resize_columns_to_fit ()
 

Detailed Description

The TreeView is a tab widget for the three QTreeViews visualizing dependents, dependencies and both. Inherits QWidget.

Constructor & Destructor Documentation

TreeView::TreeView ( QWidget *  parent = 0)

Contructor for the TreeView

Parameters
parentParent widget for the TreeView, default null

Member Function Documentation

int TreeView::column_index ( QString  str)

Fetches the index in the model (ie. the column number) of a named column from the model. name The name / title of the column.

Returns
The index if successfull, -1 otherwise.
void TreeView::contract_item_in_graph ( std::string  item_name,
bool  last 
)
signal

Signal for contracting an item in the graph (opposite to expand).

Parameters
item_nameName of the item
lastTrue if last item to be expanded for batch processing, false if not
void TreeView::deselect_all_rows_in_treeview ( )

Deselect all current selected rows in the TreeViews

void TreeView::exclude_item_in_graph ( std::string  item_name,
bool  last 
)
signal

Signal for excluding a specific item in the graph

Parameters
item_nameName of the item
excludeTrue if the last item to be excluded, false if not
void TreeView::expand_item_in_graph ( std::string  item_name,
bool  last 
)
signal

Signal for expanding a specific item in the graph

Parameters
item_nameName of the item
lastTrue if last item to be expanded, false if not
void TreeView::expand_row ( QModelIndex  item)
slot

Slot for expanding a row belonging to a specific item

Parameters
itemIndex of the item to expand
void TreeView::focus_item_in_graph ( std::string  item_name)
signal

Signal for focusing a specific item in the graph

Parameters
item_nameName of the item
void TreeView::item_action ( QAction *  action)
slot

Slot for performing the action ordered by the user through the right click menu

Parameters
actionThe action to be performed
void TreeView::item_selected_in_treeview ( std::string  item_name,
bool  first,
bool  multiple 
)
signal

Signal for selecting a specific item in the graph

Parameters
item_nameName of the item
selectedTrue if first item to be selected, false if not
void TreeView::keyPressEvent ( QKeyEvent *  event)
slot

Slot for registering shift/control down for extended/multi selection

Parameters
eventThe key event
void TreeView::keyReleaseEvent ( QKeyEvent *  event)
slot

Slot for registering shift/control release for extended/multi selection

Parameters
eventThe key event
QSortFilterProxyModel * TreeView::model_both ( )

Get the model containing dependencies and dependents

Returns
Model containing dependencies and dependents
QSortFilterProxyModel * TreeView::model_dependencies ( )

Get the dependencies only model

Returns
Dependencies only model
QSortFilterProxyModel * TreeView::model_dependents ( )

Get the dependents only model

Returns
Dependents only model
void TreeView::mouseEvent ( QModelIndex  item)
slot

Slot for registering mouse clicks on items in the tree view

Parameters
itemItem that was clicked
void TreeView::onCustomContextMenu ( const QPoint &  point)
slot

Creates the right click menu inside the TreeView

Parameters
pointThe point where the right click occurred
void TreeView::resize_columns_to_fit ( )

Resizes all columns in all tree views so that they fit the content.

void TreeView::select_row_in_treeview ( std::string  item,
bool  last 
)

Method for selecting a specific item(row) in the TreeView. If multiple selections are to be made then the boolean last will be set to true or false

Parameters
itemName of the item to be selected
lastTrue if this item is the last, false if not
void TreeView::setModel ( QSortFilterProxyModel *  new_model_dependents,
QSortFilterProxyModel *  new_model_depenencies,
QSortFilterProxyModel *  new_model_both,
std::string  root_name 
)

Set the models to be used for the TreeView. The name of the root item in the graph is needed to display incoming and outgoing dependencies properly. If the root item(focused node) is "*" as it is when there is a run-block search or a search for "*" then the tree view will display nodes as if there is no root.

Parameters
new_model_dependentsModel consisting of only dependents for the corresponding QTreeView
new_model_dependenciesModel consisting of only dependencies for the corresponding QTreeView
new_model_bothModel containing dependencies and dependents for the corresponding QTreeView
root_namename of the focused node
std::vector< QTreeView * > TreeView::tree_views ( )

Accessor for the internal treeView widgets. This graph has multiple treeviews in tabs.

void TreeView::treeview_column_action ( QAction *  action)
slot

Slot for enabling/disabling disabled/enabled columns in the treeviews

Parameters
actionQAction containing the name of the column to adjust

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