9 #include "GraphicsItemType.h" 11 #include <QGraphicsScene> 14 #include "SegmentLine.h" 20 m_modelSegments (modelSegments),
23 LOG4CPP_DEBUG_S ((*mainCat)) <<
"SegmentLine::SegmentLine" 24 <<
" address=0x" << std::hex << (quintptr)
this;
26 setData (DATA_KEY_GRAPHICS_ITEM_TYPE, QVariant (GRAPHICS_ITEM_TYPE_SEGMENT));
30 setPen (QPen (Qt::transparent));
31 setZValue (Z_VALUE_CURVE);
33 setAcceptHoverEvents (
true);
35 setFlags (QGraphicsItem::ItemIsFocusable);
37 connect (
this, SIGNAL (
signalHover (
bool)), segment, SLOT (slotHover (
bool)));
40 SegmentLine::~SegmentLine ()
42 LOG4CPP_DEBUG_S ((*mainCat)) <<
"SegmentLine::~SegmentLine" 43 <<
" address=0x" << std::hex << (quintptr)
this;
48 LOG4CPP_INFO_S ((*mainCat)) <<
"SegmentLine::hoverEnterEvent";
55 LOG4CPP_INFO_S ((*mainCat)) <<
"SegmentLine::hoverLeaveEvent";
62 LOG4CPP_INFO_S ((*mainCat)) <<
"SegmentLine::mousePressEvent";
76 QColor color (ColorPaletteToQColor (m_modelSegments.
lineColor()));
78 setPen (QPen (QBrush (color),
83 setPen (QPen (Qt::transparent));
90 LOG4CPP_INFO_S ((*mainCat)) <<
"SegmentLine::updateModelSegment";
92 m_modelSegments = modelSegments;
SegmentLine(QGraphicsScene &scene, const DocumentModelSegments &modelSegments, Segment *segment)
Single constructor.
void signalHover(bool)
Pass hover enter/leave events to Segment that owns this.
void updateModelSegment(const DocumentModelSegments &modelSegments)
Update this segment line with new settings.
double lineWidth() const
Get method for line width.
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
Highlight this and all other SegmentLines belonging to the same Segment upon hover enter...
Segment * segment() const
Segment that owns this line.
void forwardMousePress()
Forward mouse press event from a component SegmentLine that was just clicked on.
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
Create points along this curve.
Selectable piecewise-defined line that follows a filtered line in the image.
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
Unset highlighting triggered by hover enter.
ColorPalette lineColor() const
Get method for line color.
Model for DlgSettingsSegments and CmdSettingsSegments.
void setHover(bool hover)
Apply/remove highlighting triggered by hover enter/leave.