TinkerCell Core 1.0
TinkerCell's Core library providing all basic functionalities
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes
Tinkercell::TextGraphicsItem Class Reference

editable text item More...

#include <TextGraphicsItem.h>

Collaboration diagram for Tinkercell::TextGraphicsItem:
Collaboration graph
[legend]

List of all members.

Public Types

enum  { Type = UserType + 8 }
 for enabling dynamic_cast More...

Public Member Functions

virtual ItemHandlehandle () const
 this text item's handle
void setHandle (ItemHandle *)
 set this text item's handle
 TextGraphicsItem (const QString &text, QGraphicsItem *parent=0)
 Constructor.
 TextGraphicsItem (QGraphicsItem *parent=0)
 Constructor.
 TextGraphicsItem (const TextGraphicsItem &copy)
 Copy Constructor.
virtual TextGraphicsItemclone ()
 Clone this item.
 TextGraphicsItem (ItemHandle *handle, QGraphicsItem *parent=0)
 Copy Constructor.
virtual ~TextGraphicsItem ()
 Destructor.
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
 Paint this text item with or without a border.
virtual void showBorder (bool show=true)
 whether or not to paint this item with a border
virtual QString text () const
 the string painted by this text graphics item. same as toPlainText
virtual void setText (const QString &)
 set the string painted by this text graphics item. same as setPlainText
QGraphicsItem * closestItem () const
 get the closest item inside the same handle's graphics items list
int type () const
 for enabling dynamic_cast

Static Public Member Functions

static TextGraphicsItemcast (QGraphicsItem *)
 cast a graphics item to a text item using qgraphicsitem_cast
static QList< TextGraphicsItem * > cast (const QList< QGraphicsItem * > &)
 cast a list of graphics items to text items using qgraphicsitem_cast

Public Attributes

QPair< QGraphicsItem *, QPointF > relativePosition
 relative position with a target item
QString groupID
 for identifying which group this item belongs in

Protected Attributes

QGraphicsRectItem * boundingRectItem
 draws a border around the text item. hide or show using showBorder()
ItemHandleitemHandle
 the handle in which this item belongs

Detailed Description

editable text item

Definition at line 27 of file TextGraphicsItem.h.


Member Enumeration Documentation

anonymous enum

for enabling dynamic_cast

Enumerator:
Type 

Definition at line 93 of file TextGraphicsItem.h.


Constructor & Destructor Documentation

Tinkercell::TextGraphicsItem::TextGraphicsItem ( const QString &  text,
QGraphicsItem *  parent = 0 
)

Constructor.

Parameters:
QStringtext
QGraphicsItem*parent

Constructor: sets text edit interaction

Definition at line 49 of file TextGraphicsItem.cpp.

Here is the caller graph for this function:

Tinkercell::TextGraphicsItem::TextGraphicsItem ( QGraphicsItem *  parent = 0)

Constructor.

Parameters:
QGraphicsItem*parent

Constructor: sets text edit interaction

Definition at line 62 of file TextGraphicsItem.cpp.

Tinkercell::TextGraphicsItem::TextGraphicsItem ( const TextGraphicsItem copy)

Copy Constructor.

Parameters:
TextGraphicsItem*copy

Copy Constructor

Definition at line 90 of file TextGraphicsItem.cpp.

Here is the call graph for this function:

Tinkercell::TextGraphicsItem::TextGraphicsItem ( ItemHandle handle,
QGraphicsItem *  parent = 0 
)

Copy Constructor.

Parameters:
ItemHandle*handle to which this item belongs
QGraphicsItem*parent

Constructor: sets text edit interaction and name of handle

Definition at line 75 of file TextGraphicsItem.cpp.

Here is the call graph for this function:

Tinkercell::TextGraphicsItem::~TextGraphicsItem ( ) [virtual]

Destructor.

Definition at line 120 of file TextGraphicsItem.cpp.

Here is the call graph for this function:


Member Function Documentation

TextGraphicsItem * Tinkercell::TextGraphicsItem::cast ( QGraphicsItem *  item) [static]

cast a graphics item to a text item using qgraphicsitem_cast

Parameters:
QGraphicsItemgraphics item
Returns:
TextGraphicsItem this will be 0 if the cast is invalid

Definition at line 148 of file TextGraphicsItem.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QList< TextGraphicsItem * > Tinkercell::TextGraphicsItem::cast ( const QList< QGraphicsItem * > &  items) [static]

cast a list of graphics items to text items using qgraphicsitem_cast

Parameters:
QGraphicsItemgraphics item
Returns:
TextGraphicsItem this will be 0 if the cast is invalid

Definition at line 155 of file TextGraphicsItem.cpp.

Here is the call graph for this function:

TextGraphicsItem * Tinkercell::TextGraphicsItem::clone ( ) [virtual]

Clone this item.

Definition at line 116 of file TextGraphicsItem.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QGraphicsItem * Tinkercell::TextGraphicsItem::closestItem ( ) const

get the closest item inside the same handle's graphics items list

Returns:
QGraphicsItem graphics item

Definition at line 168 of file TextGraphicsItem.cpp.

Here is the call graph for this function:

ItemHandle * Tinkercell::TextGraphicsItem::handle ( ) const [virtual]

this text item's handle

Definition at line 22 of file TextGraphicsItem.cpp.

Here is the caller graph for this function:

void Tinkercell::TextGraphicsItem::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
) [virtual]

Paint this text item with or without a border.

Definition at line 126 of file TextGraphicsItem.cpp.

void Tinkercell::TextGraphicsItem::setHandle ( ItemHandle handle)

set this text item's handle

Definition at line 27 of file TextGraphicsItem.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Tinkercell::TextGraphicsItem::setText ( const QString &  s) [virtual]

set the string painted by this text graphics item. same as setPlainText

Parameters:
QString

Definition at line 143 of file TextGraphicsItem.cpp.

void Tinkercell::TextGraphicsItem::showBorder ( bool  show = true) [virtual]

whether or not to paint this item with a border

Definition at line 131 of file TextGraphicsItem.cpp.

Here is the caller graph for this function:

QString Tinkercell::TextGraphicsItem::text ( ) const [virtual]

the string painted by this text graphics item. same as toPlainText

Returns:
QString

Definition at line 138 of file TextGraphicsItem.cpp.

Here is the caller graph for this function:

int Tinkercell::TextGraphicsItem::type ( ) const [inline]

for enabling dynamic_cast

Definition at line 95 of file TextGraphicsItem.h.


Member Data Documentation

QGraphicsRectItem* Tinkercell::TextGraphicsItem::boundingRectItem [protected]

draws a border around the text item. hide or show using showBorder()

Definition at line 114 of file TextGraphicsItem.h.

for identifying which group this item belongs in

Definition at line 102 of file TextGraphicsItem.h.

the handle in which this item belongs

Definition at line 117 of file TextGraphicsItem.h.

QPair<QGraphicsItem*,QPointF> Tinkercell::TextGraphicsItem::relativePosition

relative position with a target item

Definition at line 86 of file TextGraphicsItem.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines