![]() |
QElectroTech 0.200.1-dev
|
#include <parttext.h>


Public Types | |
| enum | { Type = UserType + 1107 } |
Public Slots | |
| void | adjustItemPosition (int=0) |
| void | setEditable (bool) |
| void | startEdition () |
| void | endEdition () |
Signals | |
| void | fontChanged (const QFont &font) |
| void | colorChanged (const QColor &color) |
| void | plainTextChanged (const QString &text) |
| void | alignmentChanged (Qt::Alignment alignment) |
Public Member Functions | |
| PartText (QETElementEditor *, QGraphicsItem *=nullptr) | |
| ~PartText () override | |
| Destructeur. | |
| int | type () const override |
| QString | name () const override |
| QString | xmlName () const override |
| void | fromXml (const QDomElement &) override |
| const QDomElement | toXml (QDomDocument &) const override |
| void | setRotation (qreal angle) |
| void | mirror (qreal axis_x=0) |
| void | flip (qreal axis_y=0) |
| bool | isUseless () const override |
| QRectF | sceneGeometricRect () const override |
| void | startUserTransformation (const QRectF &) override |
| void | handleUserTransformation (const QRectF &, const QRectF &) override |
| void | setProperty (const char *name, const QVariant &value) override |
| QVariant | property (const char *name) const override |
| qreal | realSize () const |
| void | setRealSize (qreal rs) |
| void | setDefaultTextColor (const QColor &color) |
| void | setPlainText (const QString &text) |
| void | setFont (const QFont &font) |
| void | setAlignment (const Qt::Alignment &alignment) |
| PartText::setAlignment Set how this text is anchored to its position: when the content later changes, the given corner/center of the bounding rect keeps its place (the historical behaviour, and the default, is top-left). The horizontal part also aligns the lines of a multi-line text relative to each other. Changing the alignment never moves the text itself. | |
| Qt::Alignment | alignment () const |
| Public Member Functions inherited from CustomElementPart | |
| CustomElementPart (QETElementEditor *editor) | |
| CustomElementPart Constructor. | |
| virtual | ~CustomElementPart () |
| ~CustomElementPart Destructor | |
| virtual QETElementEditor * | elementEditor () const |
| virtual void | updateCurrentPartEditor () const |
| virtual ElementScene * | elementScene () const |
| virtual QUndoStack & | undoStack () const |
| virtual QGraphicsItem * | toItem () |
| virtual QET::ScalingMethod | preferredScalingMethod () const |
Protected Member Functions | |
| void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) override |
| void | mousePressEvent (QGraphicsSceneMouseEvent *event) override |
| void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override |
| void | focusInEvent (QFocusEvent *) override |
| PartText::focusInEvent. | |
| void | focusOutEvent (QFocusEvent *) override |
| PartText::focusOutEvent. | |
| void | keyPressEvent (QKeyEvent *) override |
| PartText::keyPressEvent Used to handle the escape key when the event is delivered to the field, not to the decorator. | |
| void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *) override |
| QVariant | itemChange (GraphicsItemChange, const QVariant &) override |
| QRectF | boundingRect () const override |
| Protected Member Functions inherited from CustomElementPart | |
| QList< QPointF > | mapPoints (const QRectF &, const QRectF &, const QList< QPointF > &) |
Properties | |
| qreal | real_size |
| QColor | color |
| QString | text |
| QFont | font |
| Qt::Alignment | alignment |
Private Member Functions | |
| PartText (const PartText &) | |
| QPointF | margin () const |
| void | applyLineAlignment () |
| PartText::applyLineAlignment Align the lines of a multi-line text relative to each other according to the horizontal part of the alignment property. QGraphicsTextItem only honors the document text option when a text width is set, hence the idealWidth() dance; -1 restores the free (historical) layout. | |
| void | prepareAlignment () |
| PartText::prepareAlignment Call before a change of the bounding rect (see finishAlignment). | |
| void | finishAlignment () |
| PartText::finishAlignment Call after a change of the bounding rect: moves the text so that the point selected by the alignment property stays where it was (same logic as DiagramTextItem::finishAlignment). | |
Private Attributes | |
| QString | previous_text |
| qreal | real_font_size_ |
| QPointF | saved_point_ |
| qreal | saved_font_size_ |
| QGraphicsItem * | decorator_ |
| QPointF | m_origin_pos |
| Qt::Alignment | m_alignment = (Qt::AlignTop | Qt::AlignLeft) |
| QRectF | m_alignment_rect |
This class represents an static text primitive which may be used to compose the drawing of an electrical element within the element editor.
| PartText::PartText | ( | QETElementEditor * | editor, |
| QGraphicsItem * | parent = nullptr ) |
Constructeur
| editor | L'editeur d'element concerne |
| parent | Le QGraphicsItem parent de ce texte statique |


|
override |
Destructeur.
|
private |

|
slot |
Cette methode s'assure que la position du champ de texte est coherente en repositionnant son origine (c-a-d le milieu du bord gauche du champ de texte) a la position originale. Cela est notamment utile lorsque le champ de texte est agrandi ou retreci verticalement (ajout ou retrait de lignes).
| new_block_count | Nombre de blocs dans le PartText |


|
inline |
|
signal |


|
private |
PartText::applyLineAlignment Align the lines of a multi-line text relative to each other according to the horizontal part of the alignment property. QGraphicsTextItem only honors the document text option when a text width is set, hence the idealWidth() dance; -1 restores the free (historical) layout.

|
overrideprotected |

|
signal |


|
slot |
End text edition, potentially generating a ChangePartCommand if the text has changed.


|
private |
PartText::finishAlignment Call after a change of the bounding rect: moves the text so that the point selected by the alignment property stays where it was (same logic as DiagramTextItem::finishAlignment).


| void PartText::flip | ( | qreal | axis_y = 0 | ) |


|
overrideprotected |
| e | : The QFocusEvent object describing the focus gain. Start text edition when the item gains focus. |

|
overrideprotected |
| e | : The QFocusEvent object describing the focus loss. End text edition when the item loses focus. |

|
signal |


|
overridevirtual |
Importe les proprietes d'un texte statique depuis un element XML
| xml_element | Element XML a lire |
Implements CustomElementPart.

|
overridevirtual |
Handle the user-induced transformation from initial_selection_rect to new_selection_rect
Implements CustomElementPart.

|
overridevirtual |
Implements CustomElementPart.
|
overrideprotected |
Gere les changements intervenant sur cette partie
| change | Type de changement |
| value | Valeur numerique relative au changement |

|
overrideprotected |
PartText::keyPressEvent Used to handle the escape key when the event is delivered to the field, not to the decorator.
| event |

|
private |


| void PartText::mirror | ( | qreal | axis_x = 0 | ) |


|
overrideprotected |
Permet a l'element texte de devenir editable lorsqu'on double-clique dessus
| e | Le QGraphicsSceneMouseEvent qui decrit le double-clic |

|
overrideprotected |

|
overrideprotected |
|
overrideprotected |

|
inlineoverridevirtual |
Implements CustomElementPart.

|
signal |


|
private |
PartText::prepareAlignment Call before a change of the bounding rect (see finishAlignment).


|
inlineoverridevirtual |
Get the current value of a specific primitive property
Implements CustomElementPart.

|
inline |

|
overridevirtual |
Implements CustomElementPart.
| void PartText::setAlignment | ( | const Qt::Alignment & | alignment | ) |
PartText::setAlignment Set how this text is anchored to its position: when the content later changes, the given corner/center of the bounding rect keeps its place (the historical behaviour, and the default, is top-left). The horizontal part also aligns the lines of a multi-line text relative to each other. Changing the alignment never moves the text itself.
| alignment |


| void PartText::setDefaultTextColor | ( | const QColor & | color | ) |


|
slot |
| editable | Whether this text item should be interactively editable. |

| void PartText::setFont | ( | const QFont & | font | ) |


| void PartText::setPlainText | ( | const QString & | text | ) |


|
inlineoverridevirtual |
Set a specific property of the primitive
Implements CustomElementPart.


|
inline |
| void PartText::setRotation | ( | qreal | angle | ) |
Redefines setRotation
| angle |


|
slot |
Start text edition by storing the former value of the text.


|
overridevirtual |
Start the user-induced transformation, provided this primitive is contained within the rect bounding rectangle.
Implements CustomElementPart.
|
overridevirtual |
Exporte le texte statique en XML
| xml_document | Document XML a utiliser pour creer l'element XML |
Implements CustomElementPart.

|
inlineoverride |
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a PartText.
|
inlineoverridevirtual |
Implements CustomElementPart.

|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |