![]() |
TinkerCell Core 1.0
TinkerCell's Core library providing all basic functionalities
|
editable text item More...
#include <TextGraphicsItem.h>
Public Types | |
enum | { Type = UserType + 8 } |
for enabling dynamic_cast More... | |
Public Member Functions | |
virtual ItemHandle * | handle () 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 Constructor. | |
virtual TextGraphicsItem * | clone () |
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 TextGraphicsItem * | cast (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() | |
ItemHandle * | itemHandle |
the handle in which this item belongs |
editable text item
Definition at line 27 of file TextGraphicsItem.h.
anonymous enum |
Tinkercell::TextGraphicsItem::TextGraphicsItem | ( | const QString & | text, |
QGraphicsItem * | parent = 0 |
||
) |
Constructor.
QString | text |
QGraphicsItem* | parent |
Constructor: sets text edit interaction
Definition at line 49 of file TextGraphicsItem.cpp.
Tinkercell::TextGraphicsItem::TextGraphicsItem | ( | QGraphicsItem * | parent = 0 | ) |
Constructor.
QGraphicsItem* | parent |
Constructor: sets text edit interaction
Definition at line 62 of file TextGraphicsItem.cpp.
Tinkercell::TextGraphicsItem::TextGraphicsItem | ( | const TextGraphicsItem & | copy | ) |
Copy Constructor.
TextGraphicsItem* | copy |
Copy Constructor
Definition at line 90 of file TextGraphicsItem.cpp.
Tinkercell::TextGraphicsItem::TextGraphicsItem | ( | ItemHandle * | handle, |
QGraphicsItem * | parent = 0 |
||
) |
Copy Constructor.
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.
Tinkercell::TextGraphicsItem::~TextGraphicsItem | ( | ) | [virtual] |
Destructor.
Definition at line 120 of file TextGraphicsItem.cpp.
TextGraphicsItem * Tinkercell::TextGraphicsItem::cast | ( | QGraphicsItem * | item | ) | [static] |
cast a graphics item to a text item using qgraphicsitem_cast
QGraphicsItem | graphics item |
Definition at line 148 of file TextGraphicsItem.cpp.
QList< TextGraphicsItem * > Tinkercell::TextGraphicsItem::cast | ( | const QList< QGraphicsItem * > & | items | ) | [static] |
cast a list of graphics items to text items using qgraphicsitem_cast
QGraphicsItem | graphics item |
Definition at line 155 of file TextGraphicsItem.cpp.
TextGraphicsItem * Tinkercell::TextGraphicsItem::clone | ( | ) | [virtual] |
Clone this item.
Definition at line 116 of file TextGraphicsItem.cpp.
QGraphicsItem * Tinkercell::TextGraphicsItem::closestItem | ( | ) | const |
get the closest item inside the same handle's graphics items list
Definition at line 168 of file TextGraphicsItem.cpp.
ItemHandle * Tinkercell::TextGraphicsItem::handle | ( | ) | const [virtual] |
this text item's handle
Definition at line 22 of file TextGraphicsItem.cpp.
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.
void Tinkercell::TextGraphicsItem::setText | ( | const QString & | s | ) | [virtual] |
set the string painted by this text graphics item. same as setPlainText
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.
QString Tinkercell::TextGraphicsItem::text | ( | ) | const [virtual] |
the string painted by this text graphics item. same as toPlainText
Definition at line 138 of file TextGraphicsItem.cpp.
int Tinkercell::TextGraphicsItem::type | ( | ) | const [inline] |
for enabling dynamic_cast
Definition at line 95 of file TextGraphicsItem.h.
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.
ItemHandle* Tinkercell::TextGraphicsItem::itemHandle [protected] |
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.