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 *,
const QStyleOptionGraphicsItem *, QWidget *)
override;
void fontChanged(QFont font)
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override
Qt::Alignment alignment() const
void setHtml(const QString &text)
void textEdited(const QString &old_str, const QString &new_str)
void setColor(const QColor &color)
void hoverLeaveEvent(QGraphicsSceneHoverEvent *) override
QPointF mapMovementFromScene(const QPointF &) const
void finishAlignment()
DiagramTextItem::finishAlignment Call this function after changing the bouding rect of this text to s...
void colorChanged(QColor color)
void focusInEvent(QFocusEvent *) override
DiagramTextItem::focusInEvent.
void build()
DiagramTextItem::build Build this item with default value.
virtual QDomElement toXml(QDomDocument &) const
DiagramTextItem::toXml This method do nothing and return an empty DomElement This is used to be inher...
void prepareAlignment()
DiagramTextItem::prepareAlignment Call this function before changing the bounding rect of this text...
QPointF mapMovementToParent(const QPointF &) const
void setPlainText(const QString &text)
void edit()
Edit the text with HtmlEditor.
void hoverEnterEvent(QGraphicsSceneHoverEvent *) override
QString m_previous_html_text
void setAlignment(const Qt::Alignment &alignment)
virtual void applyRotation(const qreal &)
QPointF m_mouse_to_origin_movement
void alignmentChanged(Qt::Alignment alignment)
QPointF mapMovementToScene(const QPointF &) const
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
DiagramTextItem::mousePressEvent.
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
DiagramTextItem::mouseReleaseEvent.
QPointF mapMovementFromParent(const QPointF &) const
Qt::Alignment m_alignment
virtual void fromXml(const QDomElement &)=0
void focusOutEvent(QFocusEvent *) override
DiagramTextItem::focusOutEvent.
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
DiagramTextItem::paint Draw this text field. This method draw the text by calling QGraphicsTextItem::...
void setFont(const QFont &font)
void hoverMoveEvent(QGraphicsSceneHoverEvent *) override
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
DiagramTextItem::mouseMoveEvent.
QRectF frameRect() const
DiagramTextItem::frameRect.
void setNoEditable(bool e=true)
int type() const override
Diagram * diagram() const
DiagramTextItem::diagram.