3 #include "GraphicsItemType.h"
5 #include <QGraphicsScene>
8 #include "SegmentLine.h"
10 const double ZVALUE_SEGMENT = 50;
15 m_modelSegments (modelSegments),
18 LOG4CPP_DEBUG_S ((*mainCat)) <<
"SegmentLine::SegmentLine"
19 <<
" address=0x" << std::hex << (quintptr)
this;
21 setData (DATA_KEY_GRAPHICS_ITEM_TYPE, QVariant (GRAPHICS_ITEM_TYPE_SEGMENT));
25 setPen (QPen (Qt::transparent));
26 setZValue (ZVALUE_SEGMENT);
28 setAcceptHoverEvents (
true);
30 setFlags (QGraphicsItem::ItemIsFocusable);
32 connect (
this, SIGNAL (
signalHover (
bool)), segment, SLOT (slotHover (
bool)));
35 SegmentLine::~SegmentLine ()
37 LOG4CPP_DEBUG_S ((*mainCat)) <<
"SegmentLine::~SegmentLine"
38 <<
" address=0x" << std::hex << (quintptr)
this;
43 LOG4CPP_INFO_S ((*mainCat)) <<
"SegmentLine::hoverEnterEvent";
50 LOG4CPP_INFO_S ((*mainCat)) <<
"SegmentLine::hoverLeaveEvent";
57 LOG4CPP_INFO_S ((*mainCat)) <<
"SegmentLine::mousePressEvent";
71 QColor color (ColorPaletteToQColor (m_modelSegments.
lineColor()));
73 setPen (QPen (QBrush (color),
78 setPen (QPen (Qt::transparent));
85 LOG4CPP_INFO_S ((*mainCat)) <<
"SegmentLine::updateModelSegment";
87 m_modelSegments = modelSegments;
ColorPalette lineColor() const
Get method for line color.
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.
Segment * segment() const
Segment that owns this line.
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
Highlight this and all other SegmentLines belonging to the same Segment upon hover enter...
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.
double lineWidth() const
Get method for line width.
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
Unset highlighting triggered by hover enter.
Model for DlgSettingsSegments and CmdSettingsSegments.
void setHover(bool hover)
Apply/remove highlighting triggered by hover enter/leave.