Frapper  1.0a
Public Member Functions | List of all members
PainterPanel::PaintItem Class Reference

PaintItem class. More...

#include <PainterGraphicsItems.h>

Inheritance diagram for PainterPanel::PaintItem:
Inheritance graph
[legend]
Collaboration diagram for PainterPanel::PaintItem:
Collaboration graph
[legend]

Public Member Functions

 PaintItem (QPointF startPos, QPen pen, QBrush brush)
 Constructor of the PaintItem class.
 
void updatePosition (QPointF pos)
 Handle position updates.
 
void addPosition (QPointF pos)
 Append position to the shape.
 
virtual ItemType GetItemType ()
 Get the type of this item.
 
- Public Member Functions inherited from PainterPanel::BaseShapeItem
 BaseShapeItem (QPen pen=QPen(), QBrush brush=QBrush())
 Constructor of the BaseShapeItem class.
 
virtual ~BaseShapeItem ()
 Destructor of the PainterPanel class.
 
virtual int type () const
 Enable the use of qgraphicsitem_cast with this item.
 
virtual void skipLastPosition (bool &emptyItem)
 Forget the last position provided by add-/updatePosition()
 
virtual QRectF boundingRect () const
 Get the bounding-rect of the shape.
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 Paint the item with the specified pen and brush Use a yellow pen when the item is selected.
 
QString getDescriptionText ()
 

Additional Inherited Members

- Public Types inherited from PainterPanel::BaseShapeItem
enum  ItemType {
  BASE =0, PAINT, LINE, RECT,
  CIRCLE, ELLIPSE, POLYGON, POLYLINE,
  CURVE, CLOSEDCURVE, NUM_ITEMTYPES
}
 
enum  { Type = UserType + 1 }
 
- Protected Member Functions inherited from PainterPanel::BaseShapeItem
virtual void updateShape ()
 Call this function to update the shape of the item. This function updates the position of the translation and rotation handle.
 
virtual QVariant itemChange (GraphicsItemChange change, const QVariant &value)
 React on changes of the item.
 
- Protected Attributes inherited from PainterPanel::BaseShapeItem
QPainterPath m_shape
 The shape of the item to draw.
 
QList< PointHandle * > m_points
 The list of point handles.
 
RotationHandlem_rotateHandle
 The handle to rotate this shape item.
 
TranslationHandlem_translateHandle
 The handle to translate this shape item.
 

Detailed Description

PaintItem class.

This class implements an item which stores all incoming positions in its shape and therefore follows the mouse events like a painter

Constructor & Destructor Documentation

PainterPanel::PaintItem::PaintItem ( QPointF  startPos,
QPen  pen,
QBrush  brush 
)
inline

Constructor of the PaintItem class.

Member Function Documentation

void PainterPanel::PaintItem::updatePosition ( QPointF  pos)
inlinevirtual

Handle position updates.

Parameters
posThe position to append to the shape

Implements PainterPanel::BaseShapeItem.

void PainterPanel::PaintItem::addPosition ( QPointF  pos)
inlinevirtual

Append position to the shape.

Parameters
posThe position to append to the shape

Implements PainterPanel::BaseShapeItem.

virtual ItemType PainterPanel::PaintItem::GetItemType ( )
inlinevirtual

Get the type of this item.

Reimplemented from PainterPanel::BaseShapeItem.


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