8 #include "GraphicsPoint.h" 9 #include "GraphicsPointEllipse.h" 12 #include <QGraphicsScene> 13 #include "QtToString.h" 17 QGraphicsEllipseItem (rect),
18 m_graphicsPoint (graphicsPoint),
21 LOG4CPP_INFO_S ((*mainCat)) <<
"GraphicsPointEllipse::GraphicsPointEllipse";
31 QGraphicsEllipseItem::hoverEnterEvent (event);
37 setOpacityForSubtree (MAX_OPACITY);
41 QGraphicsEllipseItem::hoverLeaveEvent (event);
45 const QVariant &value)
47 if (change == QGraphicsItem::ItemPositionHasChanged) {
49 LOG4CPP_DEBUG_S ((*mainCat)) <<
"GraphicsPointEllipse::itemChange" 50 <<
" identifier=" << data (DATA_KEY_IDENTIFIER).toString().toLatin1().data()
51 <<
" positionHasChanged";
53 setData (DATA_KEY_POSITION_HAS_CHANGED, QVariant (
true));
56 return QGraphicsEllipseItem::itemChange(change,
60 void GraphicsPointEllipse::setOpacityForSubtree (
double opacity)
68 m_shadow->setOpacity (opacity < MAX_OPACITY ? 0.0 : opacity);
75 double scale = (2 * radius) / boundingRect().width();
void signalPointHoverEnter(QString)
Signal for geometry window to highlight the current point upon hover enter.
This class add event handling to QGraphicsEllipseItem.
double highlightOpacity() const
Get method for highlight opacity.
Graphics item for drawing a circular or polygonal Point.
void setShadow(GraphicsPointEllipse *shadow)
Bind this graphics item to its shadow.
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 signalPointHoverLeave(QString)
Signal for geometry window to unhighlight the current point upon hover leave.
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
Unhighlight this point.
GraphicsPointEllipse(GraphicsPoint &graphicsPoint, const QRect &rect)
Single constructor.
void setRadius(int radius)
Update the radius.