GraphTool
1.0
Tool for analyzing and graphically visualizing code dependencies for Ericsson.
|
Public Member Functions | |
NodeWidget (const QString &node_text, QGraphicsItem *parent=0) | |
~NodeWidget () | |
void | set_marked (bool marked) |
bool | is_marked () |
void | set_color (QColor) |
void | set_opacity (int) |
QColor | color () |
int | opacity () |
QPainterPath | shape () const |
The outline of the node. More... | |
QRectF | boundingRect () const |
Required methods for drawing. More... | |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) |
Paints the node. More... | |
void | add_edge (EdgeWidget *w) |
Keep a list of edges in order to notify the edges when this item changes. More... | |
QString | node_text () |
Accessor functions. More... | |
qreal | height () |
qreal | width () |
void | unmark_path () |
void | mark_path () |
QModelIndex | get_index_in_model () |
void | set_index_in_model (QModelIndex) |
Protected Member Functions | |
QVariant | itemChange (GraphicsItemChange change, const QVariant &value) |
Event handler for changes to the item. More... | |
void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) |
Event handler for double clicks. More... | |
void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
Event handler for mouse clicks. More... | |
NodeWidget::NodeWidget | ( | const QString & | node_text, |
QGraphicsItem * | parent = 0 |
||
) |
The constructor for the NodeWidget class.
QString | text that is displayed for node. |
Geometry changes are sent to the edges so that they can be redrawn when node size is altered
|
inline |
Destructor.
void NodeWidget::add_edge | ( | EdgeWidget * | w | ) |
Keep a list of edges in order to notify the edges when this item changes.
Add an edge to another node widget.
The | edge widget to make the new node connection with. |
QRectF NodeWidget::boundingRect | ( | ) | const |
Required methods for drawing.
Provides the bounding rectangle of the node.
Bounding rect provides the outlines - need to take into account the pen_width The size here is in relation to item space
QColor NodeWidget::color | ( | ) |
Returns the color of the node.
qreal NodeWidget::height | ( | ) |
Returns the height of the node.
bool NodeWidget::is_marked | ( | ) |
Returns true if node is marked.
|
protected |
Event handler for changes to the item.
This is an event handler to deal with the instance if an event has changed.
void NodeWidget::mark_path | ( | ) |
Mark connecting nodes and edges.
|
protected |
Event handler for double clicks.
Call the native event handler
|
protected |
Event handler for mouse clicks.
Call the native event handler
QString NodeWidget::node_text | ( | ) |
Accessor functions.
Returns the text of the node.
int NodeWidget::opacity | ( | ) |
Returns the opacity of the node.
void NodeWidget::paint | ( | QPainter * | painter, |
const QStyleOptionGraphicsItem * | option, | ||
QWidget * | widget = 0 |
||
) |
Paints the node.
Overrides the parent method for drawing the node.
Set the color
Draw the ellipse
void NodeWidget::set_color | ( | QColor | color | ) |
Set the color of the node.
Color | which should be applied. |
void NodeWidget::set_marked | ( | bool | marked | ) |
Set node as marked Node is marked if true, otherwise node is unmarked.
bool | Set as marked if true, unmarked if false. |
void NodeWidget::set_opacity | ( | int | opacity | ) |
Set the opacity of the node.
Opacity | that the node should have. |
QPainterPath NodeWidget::shape | ( | ) | const |
The outline of the node.
Provides the shape of the node.
void NodeWidget::unmark_path | ( | ) |
Unmark connecting nodes and edges.
qreal NodeWidget::width | ( | ) |
Returns the width of the node.