30 parent_conductor_(parent_conductor),
31 moved_by_user_(false),
32 rotate_by_user_(false)
34 setAcceptHoverEvents(
true);
45 parent_conductor_(parent_conductor),
46 moved_by_user_(false),
47 rotate_by_user_(false)
70 if (e.hasAttribute(
"userx")) {
71 setPos(e.attribute(
"userx").toDouble(),
72 e.attribute(
"usery").toDouble());
75 if (e.hasAttribute(
"rotation")) {
76 setRotation(e.attribute(
"rotation").toDouble());
140 DiagramTextItem::setPos(pos);
141 if(toPlainText().isEmpty() && (scenePos().x() < 0 || scenePos().y() < 0))
145 DiagramTextItem::setPos(cond->
boundingRect().topLeft());
147 DiagramTextItem::setPos(0,0);
176 if (textInteractionFlags() & Qt::TextEditable) QGraphicsTextItem::mouseMoveEvent(event);
178 else if ((flags() & QGraphicsItem::ItemIsMovable) && (event -> buttons() & Qt::LeftButton)) {
193 else event -> ignore();
201 if (flags() & QGraphicsItem::ItemIsMovable) {
206 if (!applied_movement.isNull()) {
213 diagram_ptr -> undoStack().push(undo_object);
221 if (!(e -> modifiers() & Qt::ControlModifier)) {
222 QGraphicsTextItem::mouseReleaseEvent(e);
237 QString str_ToolTip = toPlainText();
238 setToolTip( str_ToolTip );
260 QGraphicsTextItem::hoverMoveEvent(e);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *) override
virtual bool wasMovedByUser() const
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
ConductorTextItem::mousePressEvent.
virtual void setPos(const QPointF &pos)
ConductorTextItem::setPos.
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
ConductorTextItem::mouseMoveEvent.
virtual void forceMovedByUser(bool)
~ConductorTextItem() override
void fromXml(const QDomElement &) override
ConductorTextItem::fromXml Read the properties stored in the xml element given in parameter...
virtual void forceRotateByUser(bool)
ConductorTextItem::forceRotateByUser.
QRectF boundingRect() const override
Conductor::boundingRect.
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
ConductorTextItem::mouseReleaseEvent.
ConductorTextItem(Conductor *=nullptr)
QPointF m_mouse_to_origin_movement
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
DiagramTextItem::mousePressEvent.
void hoverEnterEvent(QGraphicsSceneHoverEvent *) override
virtual bool wasRotateByUser() const
ConductorTextItem::wasRotateByUser.
static QPointF snapToGrid(const QPointF &p)
Diagram::snapToGrid Return a nearest snap point of p.
void hoverMoveEvent(QGraphicsSceneHoverEvent *) override
Conductor * parentConductor() const
virtual QPainterPath nearShape() const
Conductor::nearShape.
Conductor * parent_conductor_
Diagram * diagram() const
DiagramTextItem::diagram.