Frapper  1.0a
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Frapper::BaseRectItem Class Referenceabstract

Abstract base class for the graphical representation of nodes, node flags and node connector pins. More...

#include <BaseRectItem.h>

Inheritance diagram for Frapper::BaseRectItem:
Inheritance graph
[legend]
Collaboration diagram for Frapper::BaseRectItem:
Collaboration graph
[legend]

Public Member Functions

 BaseRectItem (const QColor &color, bool actAsButton=false, QGraphicsItem *parent=0)
 Constructor of the BaseRectItem class.
 
 ~BaseRectItem ()
 Destructor of the BaseRectItem class.
 
QRectF boundingRect () const
 Returns the bounding rectangle of the graphics item.
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)=0
 Paints the graphics item into a graphics view.
 
QColor getColor () const
 Returns the item's base color.
 

Protected Member Functions

void hoverEnterEvent (QGraphicsSceneHoverEvent *event)
 Event handler that reacts to hover enter events.
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
 Event handler that reacts to hover leave events.
 
void mousePressEvent (QGraphicsSceneMouseEvent *event)
 Event handler that reacts to mouse press events.
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
 Event handler that reacts to mouse release events.
 

Protected Attributes

QColor m_color
 The item's base color.
 
bool m_actAsButton
 Flag that states whether the item should act as a button.
 
bool m_hovered
 Flag that states whether the item is currently hovered by the mouse pointer.
 
bool m_clicked
 Flag that states whether the item is currently clicked by the mouse pointer (i.e. a mouse button is pressed).
 

Detailed Description

Abstract base class for the graphical representation of nodes, node flags and node connector pins.

Inheritance Diagram
dot_inline_dotgraph_2.png
[legend]

Constructor & Destructor Documentation

Frapper::BaseRectItem::BaseRectItem ( const QColor &  color,
bool  actAsButton = false,
QGraphicsItem *  parent = 0 
)

Constructor of the BaseRectItem class.

Constructors and Destructors.

Parameters
colorThe base color for the graphics item.
actAsButtonFlag that states whether the item should act as a button.
parentThe graphics item this item will be a child of.

Constructor of the BaseRectItem class.

Parameters
colorThe base color for the graphics item.
actAsButtonFlag that states whether the item should act as a button.
parentThe graphics item this item will be a child of.
Frapper::BaseRectItem::~BaseRectItem ( )

Destructor of the BaseRectItem class.

Member Function Documentation

QRectF Frapper::BaseRectItem::boundingRect ( ) const

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.

Returns
The bounding rectangle of the graphics item.
virtual void Frapper::BaseRectItem::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
)
pure virtual

Paints the graphics item into a graphics view.

Parameters
painterThe object to use for painting.
optionStyle options for painting the graphics item.
widgetThe widget into which to paint the graphics item.

Implemented in Frapper::NodeGraphicsItem, Frapper::PinGraphicsItem, Frapper::FlagGraphicsItem, and Frapper::ViewFlagGraphicsItem.

QColor Frapper::BaseRectItem::getColor ( ) const

Returns the item's base color.

Returns
The item's base color.
void Frapper::BaseRectItem::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
protected

Event handler that reacts to hover enter events.

Protected Functions.

Parameters
eventThe object containing details about the event.

Event handler that reacts to hover enter events.

Parameters
eventThe object containing details about the event.
void Frapper::BaseRectItem::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event)
protected

Event handler that reacts to hover leave events.

Parameters
eventThe object containing details about the event.
void Frapper::BaseRectItem::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protected

Event handler that reacts to mouse press events.

Parameters
eventThe object containing details about the event.
void Frapper::BaseRectItem::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
protected

Event handler that reacts to mouse release events.

Parameters
eventThe object containing details about the event.

Member Data Documentation

QColor Frapper::BaseRectItem::m_color
protected

The item's base color.

bool Frapper::BaseRectItem::m_actAsButton
protected

Flag that states whether the item should act as a button.

bool Frapper::BaseRectItem::m_hovered
protected

Flag that states whether the item is currently hovered by the mouse pointer.

bool Frapper::BaseRectItem::m_clicked
protected

Flag that states whether the item is currently clicked by the mouse pointer (i.e. a mouse button is pressed).


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