28 QGraphicsObject(parent),
42 return(qobject_cast<Diagram *>(scene()));
54 QGraphicsItem::setPos(pp);
82 if (event->button() == Qt::LeftButton)
85 if (event->modifiers() & Qt::ControlModifier) {
86 setSelected(!isSelected());
90 QGraphicsItem::mousePressEvent(event);
111 if (isSelected() && event->buttons() & Qt::LeftButton)
120 QPointF old_pos = pos();
128 QPointF effective_movement = pos() - old_pos;
void continueMovement(const QPointF &)
ElementsMover::continueMovement Add a move to the current movement.
~QetGraphicsItem() override=0
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
QetGraphicsItem::mouseMoveEvent handle mouse movement.
Diagram * diagram() const
QetGraphicsItem::diagram return the diagram of this item.
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
QetGraphicsItem::mouseReleaseEvent handle mouse release click.
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
QetGraphicsItem::mousePressEvent handle the mouse click.
void endMovement()
ElementsMover::endMovement Ended the current movement by creating an undo added to the undostack of t...
QPointF m_mouse_to_origin_movement
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override
QetGraphicsItem::mouseDoubleClickEvent handle the mouse double click.
ElementsMover & elementsMover()
QET::GraphicsItemState m_state
QET::GraphicsItemState state() const
QetGraphicsItem::state.
int beginMovement(Diagram *, QGraphicsItem *=nullptr)
ElementsMover::beginMovement Start a new movement.
QetGraphicsItem(QGraphicsItem *parent=nullptr)
QetGraphicsItem::QetGraphicsItem Default constructor.
virtual void editProperty()
static QPointF snapToGrid(const QPointF &p)
Diagram::snapToGrid Return a nearest snap point of p.
virtual void setPos(const QPointF &p)
QetGraphicsItem::setPos set the position of the item to p.