Frapper  1.0a
Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Frapper::FlagGraphicsItem Class Reference

Class for graphical representation of node flags. More...

#include <FlagGraphicsItem.h>

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

Public Slots

void setChecked (bool checked)
 Sets the state of the flag to the given value.
 

Signals

void toggled (bool checked)
 Signal that is emitted when the flag has been toggled.
 

Public Member Functions

 FlagGraphicsItem (QGraphicsItem *parent, const QString &name, bool state, const QColor &color, const QPointF &position)
 Constructor of the FlagGraphicsItem class.
 
 ~FlagGraphicsItem ()
 Destructor of the FlagGraphicsItem class.
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
 Paints the graphics item into a graphics view.
 
- Public Member Functions inherited from Frapper::BaseRectItem
 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.
 
QColor getColor () const
 Returns the item's base color.
 

Protected Member Functions

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 Member Functions inherited from Frapper::BaseRectItem
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

bool m_state
 The state of the flag.
 
- Protected Attributes inherited from Frapper::BaseRectItem
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

Class for graphical representation of node flags.

Inheritance Diagram
dot_inline_dotgraph_4.png
[legend]

Constructor & Destructor Documentation

Frapper::FlagGraphicsItem::FlagGraphicsItem ( QGraphicsItem *  parent,
const QString &  name,
bool  state,
const QColor &  color,
const QPointF &  position 
)

Constructor of the FlagGraphicsItem class.

Constructors and Destructors.

Parameters
parentThe graphics item this item will be a child of.
nameThe flag's name.
stateThe initial state of the flag.
colorThe flag's base color.
positionThe flag's relative position in its parent.

Constructor of the FlagGraphicsItem class.

Parameters
parentThe graphics item this item will be a child of.
nameThe flag's name.
stateThe initial state of the flag.
colorThe flag's base color.
positionThe flag's relative position in its parent.
Frapper::FlagGraphicsItem::~FlagGraphicsItem ( )

Destructor of the FlagGraphicsItem class.

Member Function Documentation

void Frapper::FlagGraphicsItem::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
)
virtual

Paints the graphics item into a graphics view.

Public Functions.

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

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.

Implements Frapper::BaseRectItem.

Reimplemented in Frapper::ViewFlagGraphicsItem.

void Frapper::FlagGraphicsItem::setChecked ( bool  checked)
slot

Sets the state of the flag to the given value.

Public Slots.

Parameters
checkedThe new state for the flag.

Sets the state of the flag to the given value.

Parameters
checkedThe new state for the flag.
void Frapper::FlagGraphicsItem::toggled ( bool  checked)
signal

Signal that is emitted when the flag has been toggled.

Parameters
checkedThe new state of the flag.
void Frapper::FlagGraphicsItem::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protected

Event handler that reacts to mouse press events.

Protected Functions.

Parameters
eventThe object containing details about the event.

Event handler that reacts to mouse press events.

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

Event handler that reacts to mouse release events.

Parameters
eventThe object containing details about the event.

Member Data Documentation

bool Frapper::FlagGraphicsItem::m_state
protected

The state of the flag.


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