|
QElectroTech
0.8-dev
|
Go to the documentation of this file.
18 #ifndef DIAGRAM_TEXT_ITEM_H
19 #define DIAGRAM_TEXT_ITEM_H
21 #include <QGraphicsTextItem>
46 void textEdited(
const QString &old_str,
const QString &new_str);
57 enum {
Type = UserType + 1004 };
61 virtual void fromXml(
const QDomElement &) = 0;
62 virtual QDomElement
toXml(QDomDocument &)
const;
83 void setHtml(
const QString &text);
88 void paint(QPainter *,
89 const QStyleOptionGraphicsItem *,
int beginMovement(Diagram *, QGraphicsItem *=nullptr)
ElementsMover::beginMovement Start a new movement.
Definition: elementsmover.cpp:65
virtual void fromXml(const QDomElement &)=0
void hoverLeaveEvent(QGraphicsSceneHoverEvent *) override
Definition: diagramtextitem.cpp:486
bool m_is_html
Definition: diagramtextitem.h:113
@ Type
Definition: diagramtextitem.h:57
Definition: richtexteditor_p.h:71
Qt::Alignment m_alignment
Definition: diagramtextitem.h:123
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
DiagramTextItem::mousePressEvent.
Definition: diagramtextitem.cpp:319
int type() const override
Definition: diagramtextitem.h:58
void build()
DiagramTextItem::build Build this item with default value.
Definition: diagramtextitem.cpp:47
QString plainText
Definition: diagramtextitem.h:39
void focusInEvent(QFocusEvent *) override
DiagramTextItem::focusInEvent.
Definition: diagramtextitem.cpp:267
bool m_mouse_hover
Definition: diagramtextitem.h:110
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
DiagramTextItem::mouseMoveEvent.
Definition: diagramtextitem.cpp:334
Diagram * diagram() const
DiagramTextItem::diagram.
Definition: diagramtextitem.cpp:63
QPointF m_mouse_to_origin_movement
Definition: diagramtextitem.h:119
QPointF mapMovementToParent(const QPointF &) const
Definition: diagramtextitem.cpp:121
QColor color
Definition: diagramtextitem.h:37
void setPlainText(const QString &text)
Definition: diagramtextitem.cpp:218
void setHtml(const QString &text)
Definition: diagramtextitem.cpp:212
void endMovement()
ElementsMover::endMovement Ended the current movement by creating an undo added to the undostack of t...
Definition: elementsmover.cpp:150
QString m_previous_text
Definition: diagramtextitem.h:117
virtual void applyRotation(const qreal &)
Definition: diagramtextitem.cpp:392
void colorChanged(QColor color)
Qt::Alignment alignment
Definition: diagramtextitem.h:38
QPointF mapMovementFromScene(const QPointF &) const
Definition: diagramtextitem.cpp:102
bool m_block_alignment
Definition: diagramtextitem.h:79
void continueMovement(const QPointF &)
ElementsMover::continueMovement Add a move to the current movement.
Definition: elementsmover.cpp:112
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition: diagram.h:56
QPointF mapMovementToScene(const QPointF &) const
Definition: diagramtextitem.cpp:83
bool m_first_move
Definition: diagramtextitem.h:111
qreal correctAngle(const qreal &)
Definition: qet.cpp:545
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
DiagramTextItem::mouseReleaseEvent.
Definition: diagramtextitem.cpp:365
bool m_no_editable
Definition: diagramtextitem.h:112
void setAlignment(const Qt::Alignment &alignment)
Definition: diagramtextitem.cpp:177
void hoverMoveEvent(QGraphicsSceneHoverEvent *) override
Definition: diagramtextitem.cpp:496
void fontChanged(QFont font)
virtual QDomElement toXml(QDomDocument &) const
DiagramTextItem::toXml This method do nothing and return an empty DomElement This is used to be inher...
Definition: diagramtextitem.cpp:73
void setColor(const QColor &color)
Definition: diagramtextitem.cpp:167
void applyEditText(const QString &)
void finishAlignment()
DiagramTextItem::finishAlignment Call this function after changing the bouding rect of this text to s...
Definition: diagramtextitem.cpp:410
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
DiagramTextItem::paint Draw this text field. This method draw the text by calling QGraphicsTextItem::...
Definition: diagramtextitem.cpp:236
Definition: diagramtextitem.h:34
QString m_previous_html_text
Definition: diagramtextitem.h:116
void focusOutEvent(QFocusEvent *) override
DiagramTextItem::focusOutEvent.
Definition: diagramtextitem.cpp:281
QPointF mapMovementFromParent(const QPointF &) const
Definition: diagramtextitem.cpp:140
bool isHtml() const
Definition: diagramtextitem.cpp:224
static QFont diagramTextsItemFont(qreal=-1.0)
QETApp::diagramTextsItemFont the font for to use in independent text item.
Definition: qetapp.cpp:1137
void edit()
Edit the text with HtmlEditor.
Definition: diagramtextitem.cpp:453
void alignmentChanged(Qt::Alignment alignment)
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override
Definition: diagramtextitem.cpp:303
ElementsMover & elementsMover()
Diagram::elementsMover.
Definition: diagram.cpp:2057
void setNoEditable(bool e=true)
Definition: diagramtextitem.h:75
void setFont(const QFont &font)
Definition: diagramtextitem.cpp:153
void prepareAlignment()
DiagramTextItem::prepareAlignment Call this function before changing the bounding rect of this text.
Definition: diagramtextitem.cpp:400
static QPointF snapToGrid(const QPointF &p)
Diagram::snapToGrid Return a nearest snap point of p.
Definition: diagram.cpp:2240
DiagramTextItem(QGraphicsItem *=nullptr)
DiagramTextItem::DiagramTextItem.
Definition: diagramtextitem.cpp:28
QRectF frameRect() const
DiagramTextItem::frameRect.
Definition: diagramtextitem.cpp:192
QFont font
Definition: diagramtextitem.h:40
void hoverEnterEvent(QGraphicsSceneHoverEvent *) override
Definition: diagramtextitem.cpp:472
QIcon tr
Definition: qeticons.cpp:206
QRectF m_alignment_rect
Definition: diagramtextitem.h:122
void textEdited(const QString &old_str, const QString &new_str)
void setText(const QString &text)
Definition: richtexteditor.cpp:875