Envision
A visual programming IDE for object-oriented languages
|
Public Types | |
enum | ApproximateUpdate : int { Unknown = 0 , Approximate = 1 , Exact = 2 } |
typedef TextStyle | StyleType |
Public Member Functions | |
TextRenderer (Item *parent, const StyleType *style, const QString &text={}) | |
virtual QList< Visualization::VisualizationAddOn * > | addOns () override |
virtual Visualization::InteractionHandler * | handler () const override |
virtual bool | ignoresCopyAndPaste () override |
bool | isEditable () |
bool | isHtml () const |
virtual bool | moveCursor (CursorMoveDirection dir=MoveDefault, QRect reference={}, CursorMoveOptions options=None) override |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override |
QString | selectedText () |
void | setEditable (bool editable) |
virtual void | setStyle (const Visualization::ItemStyle *itemStyle) override |
void | setSuppressDefaultCopyPasteHandler (bool suppress) |
virtual bool | setText (const QString &newText) |
Sets the text of this item to newText. More... | |
void | setTextFormat (Qt::TextFormat textFormat) |
const StyleType * | style () const |
QString | text () |
Returns the text that is currently cached in this TextRenderer item. More... | |
qreal | textXOffset () |
qreal | textYOffset () |
Static Public Member Functions | |
static void | addAddOn (Visualization::VisualizationAddOn *addOn) |
static Visualization::InteractionHandler * | defaultClassHandler () |
static Visualization::StyleSet< TextRenderer > & | itemStyles () |
static bool | removeAddOn (Visualization::VisualizationAddOn *addOn) |
static void | setDefaultClassHandler (Visualization::InteractionHandler *handler) |
Protected Member Functions | |
virtual QString | currentText ()=0 |
Returns the text of that is represented by the current item. More... | |
virtual void | determineChildren () override |
virtual void | updateGeometry (int availableWidth, int availableHeight) override |
Private Member Functions | |
QRectF | nonStaticTextBound () |
QSize | staticTextSize (QFontMetrics &qfm) |
Static Private Member Functions | |
static QList< Visualization::VisualizationAddOn * > & | staticAddOns () |
Private Attributes | |
ApproximateUpdate | drawApproximately_ {Unknown} |
bool | editable_ {} |
QStaticText | staticText_ |
bool | suppressDefaultCopyPasteHandler_ {} |
qreal | textXOffset_ |
qreal | textYOffset_ |
Static Private Attributes | |
static Visualization::InteractionHandler * | defaultClassHandler_ = nullptr |
static const int | MIN_TEXT_WIDTH = 10 |
Additional Inherited Members | |
Protected Types inherited from Core::Reflect< Base > | |
using | Super = Reflect< Base > |
Visualization::TextRenderer::TextRenderer | ( | Item * | parent, |
const StyleType * | style, | ||
const QString & | text = {} |
||
) |
|
static |
|
overridevirtual |
|
protectedpure virtual |
Returns the text of that is represented by the current item.
This is an up-to-date value that may differ from the value of text(). E.G. If this is an instance of ItemWithNode<TextRenderer, Text> and the text of the node has just changed, this method will returned the current value of the node, whereas text() will still return the old value.
When the TextRenderer is updated the value returned by currentText() is cached and will be subsequently returned by text() and visualized on the screen.
|
inlinestatic |
|
overrideprotectedvirtual |
|
overridevirtual |
|
overridevirtual |
|
inline |
|
inline |
|
static |
|
overridevirtual |
|
inlineprivate |
|
overridevirtual |
|
static |
QString Visualization::TextRenderer::selectedText | ( | ) |
|
inlinestatic |
|
inline |
|
overridevirtual |
|
inline |
|
virtual |
Sets the text of this item to newText.
Returns true if the text has been set, false otherwise.
void Visualization::TextRenderer::setTextFormat | ( | Qt::TextFormat | textFormat | ) |
|
staticprivate |
|
inlineprivate |
|
inline |
|
inline |
Returns the text that is currently cached in this TextRenderer item.
This is the last string that was visualized by this TextRenderer. This could be different compared to the value of the text represented by this Item. For example if this is an instance of ItemWithNode<TextRenderer, Text> and the text of the node has changed, this change is not automatically reflected. Only when the TextRenderer is updated will the new text be cached.
|
inline |
|
inline |
|
overrideprotectedvirtual |
|
staticprivate |
|
private |
|
private |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |