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 | Protected Member Functions | List of all members
GraphView Class Reference

#include <graph_view.h>

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

Public Slots

void zoomIn (int level=1)
 
void zoomOut (int level=1)
 
void onCustomContextMenu (const QPoint &point)
 

Signals

void itemDoubleClicked (QGraphicsItem *item)
 
void itemCtrlClicked (QGraphicsItem *item)
 
void right_click_menu (const QPoint &point, std::string name)
 
void item_selected_in_graph (std::string name, bool first)
 

Public Member Functions

 GraphView (QWidget *parent=0)
 
 GraphView (GraphScene *scene, QWidget *parent=0)
 
void set_zoom_level (uint value)
 
void reset_prev_marked ()
 
std::vector< NodeWidget * > get_prev_marked ()
 
QRectF visibleRect ()
 
void fitInView (QRectF scene, Qt::AspectRatioMode aspectRatio)
 

Protected Member Functions

void resizeEvent (QResizeEvent *)
 
void setupView ()
 
void wheelEvent (QWheelEvent *event)
 
void mousePressEvent (QMouseEvent *event)
 
void mouseDoubleClickEvent (QMouseEvent *event)
 
void mouseMoveEvent (QMouseEvent *event)
 
void mouseReleaseEvent (QMouseEvent *event)
 

Detailed Description

GraphView inherits QGraphicsView and is responsible for all user interaction with the graph. GraphView updates it's GraphScene according to the user interactions.

See Also
http://qt-project.org/doc/qt-4.8/qgraphicsview.html

Constructor & Destructor Documentation

GraphView::GraphView ( QWidget *  parent = 0)

Constructor for the GraphView

Parameters
parentParent widget for the GraphView, default is null
GraphView::GraphView ( GraphScene scene,
QWidget *  parent = 0 
)

Constructor for the GraphView

Parameters
sceneThe GraphScene used by the GraphView
parentparent widget for the GraphView, default is null

Member Function Documentation

std::vector< NodeWidget * > GraphView::get_prev_marked ( )

A method for accessing all previously marked nodes.

Returns
A vector of all the previously marked nodes
void GraphView::item_selected_in_graph ( std::string  name,
bool  first 
)
signal

Signal used for notifying MainWindow that a certain item (or several) was selected in the graph. This signal will be emitted several times if several items

Parameters
nameThe name of the item
firstTrue if this is the first item, otherwise false
void GraphView::itemCtrlClicked ( QGraphicsItem *  item)
signal

Signal for notifying MainWindow that a single click occurred for a certain item

Parameters
itemThe item that was single clicked
void GraphView::itemDoubleClicked ( QGraphicsItem *  item)
signal

Signal for notifying MainWindow that a double click occurred for a certain item

Parameters
itemThe item that was double clicked
void GraphView::mouseDoubleClickEvent ( QMouseEvent *  event)
protected

This method handles mouse double click events

Parameters
eventThe mouse click event that was triggered
void GraphView::mouseMoveEvent ( QMouseEvent *  event)
protected

Mouse move event, used to handle rubber band actions

void GraphView::mousePressEvent ( QMouseEvent *  event)
protected

This method handles mouse single click events

Parameters
eventThe mouse click event that was triggered
void GraphView::mouseReleaseEvent ( QMouseEvent *  event)
protected

Mouse release event, use to handle rubber band actions for zoom

void GraphView::onCustomContextMenu ( const QPoint &  point)
slot

Slot used for telling the MainWindow to create a right click menu on the point where the right click occurred

Parameters
pointThe point where the right click event occurred
void GraphView::reset_prev_marked ( )

Resets the previously marked node(used to back focus in the MainWindow)

void GraphView::resizeEvent ( QResizeEvent *  event)
protected

Catch resize event in order to be able to resize the graph when it happens.

void GraphView::right_click_menu ( const QPoint &  point,
std::string  name 
)
signal

Signal for notifying MainWindow that it should create a right click menu at a specific point and, if the click occurred above an item, name of an item

Parameters
pointThe point where the right click occurred
nameThe name of the item that was below the right click
void GraphView::set_zoom_level ( uint  value)

Method for setting the zoom slider value to a specific value value The zoom level, a value between 1 and 100

void GraphView::setupView ( )
protected

This method sets up some basic parameters for the view.

QRectF GraphView::visibleRect ( )

Gets the visible portion of the scene as a QRectF in scene coordinates.

void GraphView::wheelEvent ( QWheelEvent *  event)
protected

This method handles wheel events to allow zooming

Parameters
eventThe mouse wheel event that was triggered
void GraphView::zoomIn ( int  level = 1)
slot

Slot used for zoom in events

Parameters
levelThe level to zoom in, defaults to 1
void GraphView::zoomOut ( int  level = 1)
slot

Slot used for zoom out events

Parameters
levelThe level to zoom out, defaults to 1

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