11#include <QGraphicsScene>
15 const QPolygonF &polygon) :
16 QGraphicsPolygonItem (polygon),
17 m_graphicsPoint (graphicsPoint),
26 setOpacityForSubtree (m_graphicsPoint.highlightOpacity ());
30 QGraphicsPolygonItem::hoverEnterEvent (event);
40 QGraphicsPolygonItem::hoverLeaveEvent (event);
44 const QVariant &value)
46 if (change == QGraphicsItem::ItemPositionHasChanged) {
50 <<
" positionHasChanged";
55 return QGraphicsPolygonItem::itemChange(change,
59void GraphicsPointPolygon::setOpacityForSubtree (
double opacity)
64 if (m_shadow !=
nullptr) {
67 m_shadow->setOpacity (opacity <
MAX_OPACITY ? 0.0 : opacity);
74 if (boundingRect().width() > 0) {
75 double scale = (2 * radius) / boundingRect().width();
@ DATA_KEY_POSITION_HAS_CHANGED
log4cpp::Category * mainCat
void setRadius(int radius)
Update the radius.
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
Unhighlight this point.
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
Accept hover so point can be highlighted when cursor is over it as a guide to user.
QVariant itemChange(GraphicsItemChange change, const QVariant &value)
Intercept moves by dragging so moved items can be identified. This replaces unreliable hit tests.
void signalPointHoverEnter(QString)
Signal for geometry window to highlight the current point upon hover enter.
GraphicsPointPolygon(GraphicsPoint &graphicsPoint, const QPolygonF &polygon)
Single constructor.
void signalPointHoverLeave(QString)
Signal for geometry window to unhighlight the current point upon hover leave.
void setShadow(GraphicsPointPolygon *shadow)
Bind this graphics item to its shadow.
Graphics item for drawing a circular or polygonal Point.
#define LOG4CPP_INFO_S(logger)
#define LOG4CPP_DEBUG_S(logger)