QElectroTech 0.100.0-dev
|
#include <conductortextitem.h>
Public Types | |
enum | { Type = UserType + 1006 } |
Public Types inherited from DiagramTextItem | |
enum | { Type = UserType + 1004 } |
Public Member Functions | |
ConductorTextItem (Conductor *=nullptr) | |
ConductorTextItem (const QString &, Conductor *=nullptr) | |
~ConductorTextItem () override | |
Conductor * | parentConductor () const |
void | fromXml (const QDomElement &) override |
ConductorTextItem::fromXml Read the properties stored in the xml element given in parameter. | |
int | type () const override |
virtual bool | wasMovedByUser () const |
virtual bool | wasRotateByUser () const |
ConductorTextItem::wasRotateByUser. | |
virtual void | forceMovedByUser (bool) |
virtual void | forceRotateByUser (bool) |
ConductorTextItem::forceRotateByUser. | |
virtual void | setPos (const QPointF &pos) |
ConductorTextItem::setPos. | |
virtual void | setPos (qreal x, qreal y) |
ConductorTextItem::setPos. | |
Public Member Functions inherited from DiagramTextItem | |
DiagramTextItem (QGraphicsItem *=nullptr) | |
DiagramTextItem::DiagramTextItem. | |
DiagramTextItem (const QString &, QGraphicsItem *=nullptr) | |
DiagramTextItem::DiagramTextItem. | |
int | type () const override |
Diagram * | diagram () const |
DiagramTextItem::diagram. | |
virtual QDomElement | toXml (QDomDocument &) const |
DiagramTextItem::toXml This method do nothing and return an empty DomElement This is used to be inherited by child class. | |
void | edit () |
Edit the text with HtmlEditor. | |
QPointF | mapMovementToScene (const QPointF &) const |
QPointF | mapMovementFromScene (const QPointF &) const |
QPointF | mapMovementToParent (const QPointF &) const |
QPointF | mapMovementFromParent (const QPointF &) const |
void | setFont (const QFont &font) |
void | setColor (const QColor &color) |
QColor | color () const |
void | setNoEditable (bool e=true) |
void | setAlignment (const Qt::Alignment &alignment) |
Qt::Alignment | alignment () const |
QRectF | frameRect () const |
DiagramTextItem::frameRect. | |
void | setHtml (const QString &text) |
void | setPlainText (const QString &text) |
bool | isHtml () const |
Protected Member Functions | |
void | mousePressEvent (QGraphicsSceneMouseEvent *event) override |
ConductorTextItem::mousePressEvent. | |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) override |
ConductorTextItem::mouseMoveEvent. | |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override |
ConductorTextItem::mouseReleaseEvent. | |
void | hoverEnterEvent (QGraphicsSceneHoverEvent *) override |
void | hoverLeaveEvent (QGraphicsSceneHoverEvent *) override |
void | hoverMoveEvent (QGraphicsSceneHoverEvent *) override |
Protected Member Functions inherited from DiagramTextItem | |
void | paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override |
DiagramTextItem::paint Draw this text field. This method draws the text by calling QGraphicsTextItem::paint. If text is hovered, this method draws the bounding rect in grey. | |
void | focusInEvent (QFocusEvent *) override |
DiagramTextItem::focusInEvent. | |
void | focusOutEvent (QFocusEvent *) override |
DiagramTextItem::focusOutEvent. | |
void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override |
void | mousePressEvent (QGraphicsSceneMouseEvent *event) override |
DiagramTextItem::mousePressEvent. | |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) override |
DiagramTextItem::mouseMoveEvent. | |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override |
DiagramTextItem::mouseReleaseEvent. | |
void | hoverEnterEvent (QGraphicsSceneHoverEvent *) override |
void | hoverLeaveEvent (QGraphicsSceneHoverEvent *) override |
void | hoverMoveEvent (QGraphicsSceneHoverEvent *) override |
virtual void | applyRotation (const qreal &) |
void | prepareAlignment () |
DiagramTextItem::prepareAlignment Call this function before changing the bounding rect of this text. | |
void | finishAlignment () |
DiagramTextItem::finishAlignment Call this function after changing the bounding rect of this text to set the position of this text according to the alignment property. | |
Private Member Functions | |
ConductorTextItem (const ConductorTextItem &) | |
Private Attributes | |
Conductor * | parent_conductor_ |
bool | moved_by_user_ |
bool | rotate_by_user_ |
QPointF | before_mov_pos_ |
Additional Inherited Members | |
Signals inherited from DiagramTextItem | |
void | colorChanged (QColor color) |
void | alignmentChanged (Qt::Alignment alignment) |
void | textEdited (const QString &old_str, const QString &new_str) |
void | fontChanged (QFont font) |
Public Attributes inherited from DiagramTextItem | |
bool | m_block_alignment = false |
Protected Attributes inherited from DiagramTextItem | |
bool | m_mouse_hover = false |
bool | m_first_move = true |
bool | m_no_editable |
bool | m_is_html = false |
QString | m_previous_html_text |
QString | m_previous_text |
QPointF | m_mouse_to_origin_movement |
Properties inherited from DiagramTextItem | |
QColor | color |
Qt::Alignment | alignment |
QString | plainText |
QFont | font |
This class represents a text item attached to a parent conductor. It may be moved and edited by users. It may also be rotated to any angle. Its movements are however limited to a particular distance around its parent conductor.
ConductorTextItem::ConductorTextItem | ( | Conductor * | parent_conductor = nullptr | ) |
Constructeur
parent_conductor | Conducteur auquel ce texte est rattache |
ConductorTextItem::ConductorTextItem | ( | const QString & | text, |
Conductor * | parent_conductor = nullptr |
||
) |
Constructeur
text | Le texte affiche par le champ de texte |
parent_conductor | Conducteur auquel ce texte est rattache |
|
override |
Destructeur
|
private |
|
virtual |
moved_by_user | true pour que la position du texte soit consideree comme ayant ete definie par l'utilisateur (et donc soit sauvegardee), false pour remettre le texte a sa position originelle |
|
virtual |
ConductorTextItem::forceRotateByUser.
rotate_by_user | true pour que la rotation du texte soit consideree comme ayant ete definie par l'utilisateur (et donc soit sauvegardee), false pour remettre le texte a sont angle originelle |
|
overridevirtual |
ConductorTextItem::fromXml Read the properties stored in the xml element given in parameter.
e |
Implements DiagramTextItem.
|
overrideprotected |
When mouse over element change m_mouse_hover to true (used in paint() function )
e | QGraphicsSceneHoverEvent |
|
overrideprotected |
When mouse over element leave the position change m_mouse_hover to false(used in paint() function )
e | QGraphicsSceneHoverEvent |
|
overrideprotected |
Do nothing default function .
e | QGraphicsSceneHoverEvent |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
Conductor * ConductorTextItem::parentConductor | ( | ) | const |
|
virtual |
pos |
|
virtual |
|
inlineoverride |
|
virtual |
|
virtual |
ConductorTextItem::wasRotateByUser.
|
private |
|
private |
|
private |
|
private |