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 *,
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:56
Definition diagramtextitem.h:34
void fontChanged(QFont font)
QString m_previous_html_text
Definition diagramtextitem.h:116
QPointF mapMovementFromParent(const QPointF &) const
Definition diagramtextitem.cpp:146
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
DiagramTextItem::mouseReleaseEvent.
Definition diagramtextitem.cpp:374
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:75
void hoverLeaveEvent(QGraphicsSceneHoverEvent *) override
Definition diagramtextitem.cpp:495
bool isHtml() const
Definition diagramtextitem.cpp:232
bool m_first_move
Definition diagramtextitem.h:111
virtual void fromXml(const QDomElement &)=0
QPointF mapMovementToScene(const QPointF &) const
Definition diagramtextitem.cpp:86
void build()
DiagramTextItem::build Build this item with default value.
Definition diagramtextitem.cpp:48
QPointF m_mouse_to_origin_movement
Definition diagramtextitem.h:119
void colorChanged(QColor color)
int type() const override
Definition diagramtextitem.h:58
QColor color
Definition diagramtextitem.h:37
void focusInEvent(QFocusEvent *) override
DiagramTextItem::focusInEvent.
Definition diagramtextitem.cpp:276
void setColor(const QColor &color)
Definition diagramtextitem.cpp:174
void edit()
Edit the text with HtmlEditor.
Definition diagramtextitem.cpp:462
void finishAlignment()
DiagramTextItem::finishAlignment Call this function after changing the bounding rect of this text to ...
Definition diagramtextitem.cpp:419
void prepareAlignment()
DiagramTextItem::prepareAlignment Call this function before changing the bounding rect of this text.
Definition diagramtextitem.cpp:409
QPointF mapMovementFromScene(const QPointF &) const
Definition diagramtextitem.cpp:106
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override
Definition diagramtextitem.cpp:312
void setHtml(const QString &text)
Definition diagramtextitem.cpp:220
virtual void applyRotation(const qreal &)
Definition diagramtextitem.cpp:401
bool m_no_editable
Definition diagramtextitem.h:112
bool m_mouse_hover
Definition diagramtextitem.h:110
@ Type
Definition diagramtextitem.h:57
QRectF frameRect() const
DiagramTextItem::frameRect.
Definition diagramtextitem.cpp:200
QFont font
Definition diagramtextitem.h:40
void hoverEnterEvent(QGraphicsSceneHoverEvent *) override
Definition diagramtextitem.cpp:481
QRectF m_alignment_rect
Definition diagramtextitem.h:122
QString plainText
Definition diagramtextitem.h:39
QString m_previous_text
Definition diagramtextitem.h:117
void setFont(const QFont &font)
Definition diagramtextitem.cpp:160
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
DiagramTextItem::mousePressEvent.
Definition diagramtextitem.cpp:328
void textEdited(const QString &old_str, const QString &new_str)
void focusOutEvent(QFocusEvent *) override
DiagramTextItem::focusOutEvent.
Definition diagramtextitem.cpp:290
void setAlignment(const Qt::Alignment &alignment)
Definition diagramtextitem.cpp:185
void alignmentChanged(Qt::Alignment alignment)
Qt::Alignment alignment
Definition diagramtextitem.h:38
bool m_block_alignment
Definition diagramtextitem.h:79
QPointF mapMovementToParent(const QPointF &) const
Definition diagramtextitem.cpp:126
void setPlainText(const QString &text)
Definition diagramtextitem.cpp:226
void hoverMoveEvent(QGraphicsSceneHoverEvent *) override
Definition diagramtextitem.cpp:505
Qt::Alignment m_alignment
Definition diagramtextitem.h:123
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
DiagramTextItem::paint Draw this text field. This method draws the text by calling QGraphicsTextItem:...
Definition diagramtextitem.cpp:245
Diagram * diagram() const
DiagramTextItem::diagram.
Definition diagramtextitem.cpp:64
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
DiagramTextItem::mouseMoveEvent.
Definition diagramtextitem.cpp:343
void setNoEditable(bool e=true)
Definition diagramtextitem.h:75
bool m_is_html
Definition diagramtextitem.h:113