ConnectionGraphicsItem Class Reference

Class for graphical representation of connections in the node framework. More...

#include <ConnectionGraphicsItem.h>

Collaboration diagram for ConnectionGraphicsItem:

Collaboration graph
[legend]

List of all members.

Signals

void nodeGraphicsItemSelected (const QString &name)
void destroyed (Connection *connection)
 Signal that is emitted when the connection item is being destroyed.
void destroyed (ConnectionGraphicsItem *connectionItem)
 Signal that is emitted when the connection item is being destroyed.

Public Member Functions

 ConnectionGraphicsItem (const QString &name, const QColor &color, const QPointF &startPoint, const QPointF &endPoint)
 Constructor of the ConnectionGraphicsItem class.
 ~ConnectionGraphicsItem ()
 Destructor of the ConnectionGraphicsItem class.
virtual QRectF boundingRect () const
 Returns the bounding rectangle of the graphics item.
virtual QPainterPath shape () const
 Returns the shape path of an item.
void setEnabled (bool enabled)
 Enables or disables the graphics item.
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
 Paints the graphics item into a graphics view.
void updatePath ()
 Updates the path end points according to the positions of start and end nodes.
ConnectiongetConnection () const
 Returns the Connection object that the connection graphics item represents.
void setConnection (Connection *connection)
 Sets the Connection object that the connection graphics item represents.
NodeGraphicsItemgetStartNodeItem ()
 Gets the startnode of the connection.
void setStartNodeItem (NodeGraphicsItem *item)
 Sets the startnode of the connection.
NodeGraphicsItemgetEndNodeItem () const
 Gets the endnode of the connection.
void setEndNodeItem (NodeGraphicsItem *item)
 Sets the endnode of the connection.
QPointF getStartPoint () const
 Gets the start point of the connection.
void setStartPoint (const QPointF &startPos)
 Sets the start point of the connection.
QPointF getEndPoint () const
 Gets the end point of the connection.
void setEndPoint (const QPointF &endPos)
 Sets the end point of the connection.
void updatePosition (const QPointF &scenePosition)
 Updates the position of an end point for a connection that is currently being created.

Static Public Member Functions

static ConnectionGraphicsItemgetTempItem ()
 Returns the temporary Connection object that is used when creating a connection between nodes.
static void setTempItem (ConnectionGraphicsItem *connection)
 Sets the temporary Connection object that is used when creating a connection between nodes to the given object.
static bool isConnectionCreated ()
 Returns whether a connection between nodes is currently being created.

Protected Member Functions

void hoverEnterEvent (QGraphicsSceneHoverEvent *event)
 Process hover enter events.
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
 Process hover leave events.

Private Member Functions

void setTemp (bool temp)

Private Attributes

QString m_name
 The name of the connection.
QColor m_color
 The color to use for painting the item.
QPainterPath m_mainPath
 The path to use for painting the curved path.
QPainterPath m_shadowPath
 The path to use for painting the shadow of the curved path.
QPolygonF m_arrowHeadPolygon
 The arrow head shape to use for painting the item.
QPainterPath m_shapePath
 The path to return when the shape of the item is requested.
QPointF m_startPoint
 The start point of the path.
QPointF m_endPoint
 The end point of the path.
bool m_selfInitiated
 Flag that states whether a current update has been initiated by this object itself.
Connectionm_connection
 Pointer to Connection. (Deprecated.).
QMap< QString, Connection * > m_connections
 List of Connections.
NodeGraphicsItemm_startNodeItem
 Pointer to NodeGraphicsItem.
NodeGraphicsItemm_endNodeItem
 Pointer to NodeGraphicsItem.
bool m_temp
 Flag for temporary connection item.
bool m_hovered
 Flag for mouse hovers over item.

Static Private Attributes

static ConnectionGraphicsItems_tempItem = 0
 Temporary Connection object that is used when creating a connection between nodes.


Detailed Description

Class for graphical representation of connections in the node framework.

Inheritance Diagram

inline_dotgraph_3.dot
[legend]

Constructor & Destructor Documentation

ConnectionGraphicsItem::ConnectionGraphicsItem ( const QString &  name,
const QColor &  color,
const QPointF &  startPoint,
const QPointF &  endPoint 
)

Constructor of the ConnectionGraphicsItem class.

Constructors and Destructors.

Parameters:
name The name of the item.
color The color to use for painting the item.
startPoint The point where the connection line begins.
endPoint The point where the connection line ends.
Constructor of the ConnectionGraphicsItem class.

Parameters:
name The name of the item.
color The color to use for painting the item.
startPoint The point where the connection line begins.
endPoint The point where the connection line ends.

ConnectionGraphicsItem::~ConnectionGraphicsItem (  ) 

Destructor of the ConnectionGraphicsItem class.


Member Function Documentation

ConnectionGraphicsItem * ConnectionGraphicsItem::getTempItem (  )  [static]

Returns the temporary Connection object that is used when creating a connection between nodes.

Public Static Functions.

Returns:
The temporary Connection object that is used when creating a connection between nodes.
Returns the temporary Connection object that is used when creating a connection between nodes.

Returns:
The temporary Connection object that is used when creating a connection between nodes.

void ConnectionGraphicsItem::setTempItem ( ConnectionGraphicsItem item  )  [static]

Sets the temporary Connection object that is used when creating a connection between nodes to the given object.

Parameters:
connection The temporary Connection object that is used when creating a connection between nodes.
item The temporary Connection object that is used when creating a connection between nodes.

bool ConnectionGraphicsItem::isConnectionCreated (  )  [static]

Returns whether a connection between nodes is currently being created.

Returns:
True if a connection between nodes is currently being created, otherwise False.

QRectF ConnectionGraphicsItem::boundingRect (  )  const [virtual]

Returns the bounding rectangle of the graphics item.

Public Slots.

Returns:
The bounding rectangle of the graphics item.
Public Functions Returns the bounding rectangle of the graphics item.

Returns:
The bounding rectangle of the graphics item.

QPainterPath ConnectionGraphicsItem::shape (  )  const [virtual]

Returns the shape path of an item.

Returns the shape of the item as QPainterPath.

Parameters:
The shape of the item as QPainterPath.

void ConnectionGraphicsItem::setEnabled ( bool  enabled  ) 

Enables or disables the graphics item.

Parameters:
enabled The new enabled state for the item.

void ConnectionGraphicsItem::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
) [virtual]

Paints the graphics item into a graphics view.

Parameters:
painter The object to use for painting.
option Style options for painting the graphics item.
widget The widget into which to paint the graphics item.

void ConnectionGraphicsItem::updatePath (  ) 

Updates the path end points according to the positions of start and end nodes.

Connection * ConnectionGraphicsItem::getConnection (  )  const

Returns the Connection object that the connection graphics item represents.

Returns:
The Connection object that the connection graphics item represents.

void ConnectionGraphicsItem::setConnection ( Connection connection  ) 

Sets the Connection object that the connection graphics item represents.

Parameters:
connection The Connection object that the connection graphics item represents.

NodeGraphicsItem * ConnectionGraphicsItem::getStartNodeItem (  ) 

Gets the startnode of the connection.

void ConnectionGraphicsItem::setStartNodeItem ( NodeGraphicsItem item  ) 

Sets the startnode of the connection.

NodeGraphicsItem * ConnectionGraphicsItem::getEndNodeItem (  )  const

Gets the endnode of the connection.

void ConnectionGraphicsItem::setEndNodeItem ( NodeGraphicsItem item  ) 

Sets the endnode of the connection.

QPointF ConnectionGraphicsItem::getStartPoint (  )  const

Gets the start point of the connection.

Gets the startpoint of the connection.

void ConnectionGraphicsItem::setStartPoint ( const QPointF &  startPos  ) 

Sets the start point of the connection.

QPointF ConnectionGraphicsItem::getEndPoint (  )  const

Gets the end point of the connection.

Gets the endpoint of the connection.

void ConnectionGraphicsItem::setEndPoint ( const QPointF &  endPos  ) 

Sets the end point of the connection.

void ConnectionGraphicsItem::updatePosition ( const QPointF &  scenePosition  ) 

Updates the position of an end point for a connection that is currently being created.

Parameters:
scenePosition The position of the mouse pointer over the graphics view in scene coordinates.

void ConnectionGraphicsItem::nodeGraphicsItemSelected ( const QString &  name  )  [signal]

void ConnectionGraphicsItem::destroyed ( Connection connection  )  [signal]

Signal that is emitted when the connection item is being destroyed.

void ConnectionGraphicsItem::destroyed ( ConnectionGraphicsItem connectionItem  )  [signal]

Signal that is emitted when the connection item is being destroyed.

void ConnectionGraphicsItem::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event  )  [protected]

Process hover enter events.

Protected Functions.

void ConnectionGraphicsItem::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event  )  [protected]

Process hover leave events.

void ConnectionGraphicsItem::setTemp ( bool  temp  )  [private]

Sets the temp flag of the connection.

Private Functions Sets the temp flag.


Member Data Documentation

Temporary Connection object that is used when creating a connection between nodes.

Private Static Data.

Temporary Connection object that is created when a connection is set up.

QString ConnectionGraphicsItem::m_name [private]

The name of the connection.

The color to use for painting the item.

QPainterPath ConnectionGraphicsItem::m_mainPath [private]

The path to use for painting the curved path.

QPainterPath ConnectionGraphicsItem::m_shadowPath [private]

The path to use for painting the shadow of the curved path.

The arrow head shape to use for painting the item.

QPainterPath ConnectionGraphicsItem::m_shapePath [private]

The path to return when the shape of the item is requested.

The start point of the path.

The end point of the path.

Flag that states whether a current update has been initiated by this object itself.

Pointer to Connection. (Deprecated.).

List of Connections.

Pointer to NodeGraphicsItem.

Pointer to NodeGraphicsItem.

Flag for temporary connection item.

Flag for mouse hovers over item.


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

Generated on Wed Feb 24 15:01:00 2010 for Frapper by  doxygen 1.5.9