The VGraphicsSimpleTextItem class pointer label. More...
#include <vgraphicssimpletextitem.h>
Public Types | |
enum | { Type = UserType + static_cast<int>(Vis::GraphicsSimpleTextItem) } |
Signals | |
void | nameChangedPosition (const QPointF &pos) |
nameChangedPosition emit when label change position. More... | |
void | showContextMenu (QGraphicsSceneContextMenuEvent *event) |
showContextMenu emit when need show tool context menu. More... | |
void | deleteTool () |
void | pointChosen () |
void | pointSelected (bool selected) |
Public Member Functions | |
VGraphicsSimpleTextItem (QColor color, QGraphicsItem *parent=nullptr) | |
VGraphicsSimpleTextItem default constructor. More... | |
VGraphicsSimpleTextItem (const QString &text, QColor textColor, QGraphicsItem *parent=nullptr) | |
VGraphicsSimpleTextItem constructor. More... | |
virtual | ~VGraphicsSimpleTextItem ()=default |
qint32 | BaseFontSize () const |
FontSize return label font size. More... | |
virtual int | type () const Q_DECL_OVERRIDE |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) Q_DECL_OVERRIDE |
void | setEnabled (bool enabled) |
void | textSelectionType (const SelectionType &type) |
void | setShowParentTooltip (bool show) |
QColor | getTextBrushColor () |
void | setTextColor (const QColor &color) |
void | setPosition (QPointF pos) |
Protected Member Functions | |
virtual QVariant | itemChange (GraphicsItemChange change, const QVariant &value) Q_DECL_OVERRIDE |
itemChange handle item change. More... | |
virtual void | hoverEnterEvent (QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE |
hoverEnterEvent handle hover enter events. More... | |
virtual void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE |
hoverLeaveEvent handle hover leave events. More... | |
virtual void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event) Q_DECL_OVERRIDE |
contextMenuEvent handle context menu events. More... | |
virtual void | mousePressEvent (QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE |
virtual void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) Q_DECL_OVERRIDE |
virtual void | keyReleaseEvent (QKeyEvent *event) Q_DECL_OVERRIDE |
Private Member Functions | |
void | initItem () |
void | scalePointName (const qreal &scale) |
scalePointName handle point name scaling to maintain same size when scene scale changes. More... | |
void | scalePosition () |
scalePosition handle point name position scaling to maintain same distance when scene scale changes. More... | |
void | updateLeader () |
Private Attributes | |
qint32 | m_fontSize |
fontSize label font size. More... | |
qreal | m_scale |
QColor | m_textColor |
bool | m_isNameHovered |
SelectionType | selectionType |
bool | m_showParentTooltip |
QPointF | m_pointNamePos {} |
The VGraphicsSimpleTextItem class pointer label.
Definition at line 71 of file vgraphicssimpletextitem.h.
anonymous enum |
Enumerator | |
---|---|
Type |
Definition at line 81 of file vgraphicssimpletextitem.h.
|
explicit |
VGraphicsSimpleTextItem default constructor.
parent | parent object. |
Definition at line 81 of file vgraphicssimpletextitem.cpp.
References ByMouseRelease, and initItem().
|
explicit |
VGraphicsSimpleTextItem constructor.
text | text. |
parent | parent object. |
Definition at line 99 of file vgraphicssimpletextitem.cpp.
References ByMouseRelease, and initItem().
|
virtualdefault |
|
inline |
FontSize return label font size.
Definition at line 140 of file vgraphicssimpletextitem.h.
References m_fontSize.
|
protectedvirtual |
contextMenuEvent handle context menu events.
event | context menu event. |
Definition at line 291 of file vgraphicssimpletextitem.cpp.
References showContextMenu().
|
signal |
Referenced by keyReleaseEvent(), VSimplePoint::VSimplePoint(), and VToolSinglePoint::VToolSinglePoint().
QColor VGraphicsSimpleTextItem::getTextBrushColor | ( | ) |
Definition at line 362 of file vgraphicssimpletextitem.cpp.
References correctColor(), m_textColor, and qApp.
Referenced by initItem(), paint(), setEnabled(), and setTextColor().
|
protectedvirtual |
hoverEnterEvent handle hover enter events.
event | hover enter event. |
Definition at line 249 of file vgraphicssimpletextitem.cpp.
References cursorArrowOpenHand, m_isNameHovered, m_showParentTooltip, qApp, and SetItemOverrideCursor().
|
protectedvirtual |
hoverLeaveEvent handle hover leave events.
event | hover leave event. |
Definition at line 275 of file vgraphicssimpletextitem.cpp.
References m_isNameHovered.
|
private |
Definition at line 392 of file vgraphicssimpletextitem.cpp.
References getTextBrushColor(), m_fontSize, m_scale, and qApp.
Referenced by VGraphicsSimpleTextItem().
|
protectedvirtual |
itemChange handle item change.
change | change. |
value | value. |
Definition at line 178 of file vgraphicssimpletextitem.cpp.
References VMainGraphicsScene::getScenePos(), m_pointNamePos, nameChangedPosition(), pointSelected(), SCASSERT, sceneScale(), and VMainGraphicsView::SceneVisibleArea().
|
protectedvirtual |
Definition at line 349 of file vgraphicssimpletextitem.cpp.
References deleteTool().
|
protectedvirtual |
Definition at line 297 of file vgraphicssimpletextitem.cpp.
References ByMouseRelease, cursorArrowCloseHand, pointChosen(), selectionType, and SetItemOverrideCursor().
|
protectedvirtual |
Definition at line 330 of file vgraphicssimpletextitem.cpp.
References ByMouseRelease, cursorArrowOpenHand, pointChosen(), selectionType, and SetItemOverrideCursor().
|
signal |
nameChangedPosition emit when label change position.
pos | new posotion. |
Referenced by itemChange(), VNodePoint::VNodePoint(), VSimplePoint::VSimplePoint(), and VToolSinglePoint::VToolSinglePoint().
|
virtual |
Definition at line 112 of file vgraphicssimpletextitem.cpp.
References getTextBrushColor(), m_isNameHovered, m_scale, VMainGraphicsView::NewSceneRect(), qApp, scalePointName(), sceneScale(), and VFuzzyComparePossibleNulls().
|
signal |
|
signal |
Referenced by itemChange(), VSimplePoint::VSimplePoint(), and VToolSinglePoint::VToolSinglePoint().
|
private |
scalePointName handle point name scaling to maintain same size when scene scale changes.
scale | parent scene scale. |
Definition at line 415 of file vgraphicssimpletextitem.cpp.
References m_scale, scalePosition(), and updateLeader().
Referenced by paint().
|
private |
scalePosition handle point name position scaling to maintain same distance when scene scale changes.
Definition at line 427 of file vgraphicssimpletextitem.cpp.
References m_pointNamePos, and sceneScale().
Referenced by scalePointName(), and setPosition().
void VGraphicsSimpleTextItem::setEnabled | ( | bool | enabled | ) |
Definition at line 153 of file vgraphicssimpletextitem.cpp.
References getTextBrushColor().
Referenced by VToolSinglePoint::Disable(), and VSimplePoint::SetEnabled().
void VGraphicsSimpleTextItem::setPosition | ( | QPointF | pos | ) |
Definition at line 385 of file vgraphicssimpletextitem.cpp.
References m_pointNamePos, and scalePosition().
Referenced by VScenePoint::refreshPointGeometry(), VToolSinglePoint::setPointNamePosition(), and VNodePoint::setPointNamePosition().
void VGraphicsSimpleTextItem::setShowParentTooltip | ( | bool | show | ) |
Definition at line 166 of file vgraphicssimpletextitem.cpp.
References m_showParentTooltip.
Referenced by VNodePoint::VNodePoint().
void VGraphicsSimpleTextItem::setTextColor | ( | const QColor & | color | ) |
Definition at line 378 of file vgraphicssimpletextitem.cpp.
References getTextBrushColor(), and m_textColor.
Referenced by VScenePoint::refreshPointGeometry().
|
signal |
showContextMenu emit when need show tool context menu.
event | context menu event. |
Referenced by contextMenuEvent(), VNodePoint::VNodePoint(), VSimplePoint::VSimplePoint(), and VToolSinglePoint::VToolSinglePoint().
void VGraphicsSimpleTextItem::textSelectionType | ( | const SelectionType & | type | ) |
Definition at line 160 of file vgraphicssimpletextitem.cpp.
References selectionType, and type().
Referenced by VToolSinglePoint::ToolSelectionType(), and VSimplePoint::ToolSelectionType().
|
inlinevirtual |
Definition at line 80 of file vgraphicssimpletextitem.h.
References Type.
Referenced by textSelectionType().
|
private |
Definition at line 447 of file vgraphicssimpletextitem.cpp.
Referenced by scalePointName().
|
private |
fontSize label font size.
Definition at line 121 of file vgraphicssimpletextitem.h.
Referenced by BaseFontSize(), and initItem().
|
private |
Definition at line 124 of file vgraphicssimpletextitem.h.
Referenced by hoverEnterEvent(), hoverLeaveEvent(), and paint().
|
private |
Definition at line 127 of file vgraphicssimpletextitem.h.
Referenced by itemChange(), scalePosition(), and setPosition().
|
private |
Definition at line 122 of file vgraphicssimpletextitem.h.
Referenced by initItem(), paint(), and scalePointName().
|
private |
Definition at line 126 of file vgraphicssimpletextitem.h.
Referenced by hoverEnterEvent(), and setShowParentTooltip().
|
private |
Definition at line 123 of file vgraphicssimpletextitem.h.
Referenced by getTextBrushColor(), and setTextColor().
|
private |
Definition at line 125 of file vgraphicssimpletextitem.h.
Referenced by mousePressEvent(), mouseReleaseEvent(), and textSelectionType().