57 #include <QGraphicsLineItem>
58 #include <QGraphicsScene>
59 #include <QGraphicsSceneMouseEvent>
68 #include "../vgeometry/vgobject.h"
69 #include "../vgeometry/vpointf.h"
71 #include "../vmisc/vabstractapplication.h"
77 , m_visualizationMode(false)
78 , m_alwaysHovered(false)
118 m_pointName->setFlag(QGraphicsItem::ItemIsMovable, move);
130 m_pointName->setFlag(QGraphicsItem::ItemIsSelectable, enabled);
155 setSelected(selected);
174 QGraphicsEllipseItem::mousePressEvent(event);
177 if (not (flags() & ItemIsSelectable) && scene())
179 scene()->clearSelection();
188 if (event->button() == Qt::LeftButton)
203 if (event->button() == Qt::LeftButton)
208 VScenePoint::mouseReleaseEvent(event);
216 QGraphicsEllipseItem::hoverEnterEvent(event);
226 QGraphicsEllipseItem::hoverLeaveEvent(event);
232 switch (event->key())
240 VScenePoint::keyReleaseEvent ( event );
246 if (change == QGraphicsItem::ItemSelectedChange)
254 return VScenePoint::itemChange(change, value);
void showContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 id=null_id)
SelectionType selectionType
virtual void ToolSelectionType(const SelectionType &type)
void setEnabled(bool enabled)
void textSelectionType(const SelectionType &type)
void showContextMenu(QGraphicsSceneContextMenuEvent *event)
showContextMenu emit when need show tool context menu.
void nameChangedPosition(const QPointF &pos)
nameChangedPosition emit when label change position.
void pointSelected(bool selected)
VGraphicsSimpleTextItem * m_pointName
QColor m_pointColor
pointL line that we see if Text is moved too away from point.
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) Q_DECL_OVERRIDE
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE
VSimplePoint(quint32 id, const QColor ¤tColor, QObject *parent=nullptr)
void nameChangedPosition(const QPointF &pos, quint32 id)
void SetEnabled(bool enabled)
void SetPointHighlight(bool value)
void EnableToolMove(bool move)
void Choosed(quint32 id)
Choosed send id when clicked.
void SetVisualizationMode(bool value)
void allowTextHover(bool enabled)
void allowTextSelectable(bool enabled)
bool IsVisualizationMode() const
virtual int type() const Q_DECL_OVERRIDE
void Selected(bool selected, quint32 id)
virtual void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE
void pointnameChangedPosition(const QPointF &pos)
void pointSelected(bool selected)
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE
virtual void ToolSelectionType(const SelectionType &type) Q_DECL_OVERRIDE