This item holds text such as the state name, transition names, commentary blocks, etc. More...
#include <selectabletextblock.h>
Inherits SelectableBoxGraphic.
Public Member Functions | |
SelectableTextBlock (QGraphicsObject *parent=NULL, TextBlock *textBlockModel=NULL) | |
~SelectableTextBlock () | |
virtual void | setSize (QPoint size) |
from base class | |
Protected Member Functions | |
void | keyPressEvent (QKeyEvent *event) |
void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) |
This item holds text such as the state name, transition names, commentary blocks, etc.
This text block is selectable, movable, re-sizable, (TBD: and it can be given a fill color and border design). The text attributes are stored into the scxml file.
The amount of viewable text is determined by the box size. It is used to display text for state, state transitions, commentary text, or any other text in the scene. Another class, TextEditBox, allows users to edit and save the text. But the text box in this class is only for displaying text. The user can move the text box and re-size it for optimal placement in the scene.
The class is named SelecableTextBlock. It is derived from the base SelectableBoxGraphic. SelectableBoxGraphic provides a basic box with four corner-grabbers which provides the moving and resizing of the box. The SelectableTextBlock class adds a QGraphicsTextItem for text display.
This trick to making this work is re-sizing the QGraphicsTextItem when the user re-sizes the base SelectableBoxGraphic. This is accomplished via the setSize() virtual method in the base class. The derived SelectableTextBlock class re-implements the setSize() method, but the base class calls this method when the user re-sizes the block.
SelectableTextBlock::SelectableTextBlock | ( | QGraphicsObject * | parent = NULL , |
|
TextBlock * | textBlockModel = NULL | |||
) |
SelectableTextBlock::~SelectableTextBlock | ( | ) |
void SelectableTextBlock::keyPressEvent | ( | QKeyEvent * | event | ) | [protected] |
void SelectableTextBlock::mouseDoubleClickEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected] |
void SelectableTextBlock::setSize | ( | QPoint | size | ) | [virtual] |
from base class
Reimplemented from SelectableBoxGraphic.