52 #ifndef VGRAPHICSSIMPLETEXTITEM_H
53 #define VGRAPHICSSIMPLETEXTITEM_H
55 #include <qcompilerdetection.h>
56 #include <QGraphicsItem>
57 #include <QGraphicsSimpleTextItem>
58 #include <QMetaObject>
66 #include "../vmisc/def.h"
80 virtual int type() const Q_DECL_OVERRIDE {
return Type;}
83 virtual void paint(QPainter *painter,
const QStyleOptionGraphicsItem *option,
84 QWidget *widget =
nullptr) Q_DECL_OVERRIDE;
111 virtual QVariant
itemChange (GraphicsItemChange change, const QVariant &value ) Q_DECL_OVERRIDE;
112 virtual
void hoverEnterEvent (QGraphicsSceneHoverEvent *event ) Q_DECL_OVERRIDE;
113 virtual
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event ) Q_DECL_OVERRIDE;
114 virtual
void contextMenuEvent (QGraphicsSceneContextMenuEvent *event ) Q_DECL_OVERRIDE;
115 virtual
void mousePressEvent(QGraphicsSceneMouseEvent * event ) Q_DECL_OVERRIDE;
116 virtual
void mouseReleaseEvent (QGraphicsSceneMouseEvent * event ) Q_DECL_OVERRIDE;
The VGraphicsSimpleTextItem class pointer label.
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE
void setTextColor(const QColor &color)
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE
itemChange handle item change.
virtual int type() const Q_DECL_OVERRIDE
void scalePointName(const qreal &scale)
scalePointName handle point name scaling to maintain same size when scene scale changes.
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
hoverEnterEvent handle hover enter events.
QColor getTextBrushColor()
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
hoverLeaveEvent handle hover leave events.
qint32 m_fontSize
fontSize label font size.
void setEnabled(bool enabled)
void setPosition(QPointF pos)
void textSelectionType(const SelectionType &type)
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE
void showContextMenu(QGraphicsSceneContextMenuEvent *event)
showContextMenu emit when need show tool context menu.
qint32 BaseFontSize() const
FontSize return label font size.
SelectionType selectionType
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) Q_DECL_OVERRIDE
virtual void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE
void setShowParentTooltip(bool show)
VGraphicsSimpleTextItem(QColor color, QGraphicsItem *parent=nullptr)
VGraphicsSimpleTextItem default constructor.
virtual ~VGraphicsSimpleTextItem()=default
void nameChangedPosition(const QPointF &pos)
nameChangedPosition emit when label change position.
void pointSelected(bool selected)
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) Q_DECL_OVERRIDE
contextMenuEvent handle context menu events.
void scalePosition()
scalePosition handle point name position scaling to maintain same distance when scene scale changes.