9 #include "GraphicsItemType.h" 11 #include <QGraphicsScene> 14 #include "SegmentLine.h" 16 const double ZVALUE_SEGMENT = 50;
21 m_modelSegments (modelSegments),
24 LOG4CPP_DEBUG_S ((*mainCat)) <<
"SegmentLine::SegmentLine" 25 <<
" address=0x" << std::hex << (quintptr)
this;
27 setData (DATA_KEY_GRAPHICS_ITEM_TYPE, QVariant (GRAPHICS_ITEM_TYPE_SEGMENT));
31 setPen (QPen (Qt::transparent));
32 setZValue (ZVALUE_SEGMENT);
34 setAcceptHoverEvents (
true);
36 setFlags (QGraphicsItem::ItemIsFocusable);
38 connect (
this, SIGNAL (
signalHover (
bool)), segment, SLOT (slotHover (
bool)));
41 SegmentLine::~SegmentLine ()
43 LOG4CPP_DEBUG_S ((*mainCat)) <<
"SegmentLine::~SegmentLine" 44 <<
" address=0x" << std::hex << (quintptr)
this;
49 LOG4CPP_INFO_S ((*mainCat)) <<
"SegmentLine::hoverEnterEvent";
56 LOG4CPP_INFO_S ((*mainCat)) <<
"SegmentLine::hoverLeaveEvent";
63 LOG4CPP_INFO_S ((*mainCat)) <<
"SegmentLine::mousePressEvent";
77 QColor color (ColorPaletteToQColor (m_modelSegments.
lineColor()));
79 setPen (QPen (QBrush (color),
84 setPen (QPen (Qt::transparent));
91 LOG4CPP_INFO_S ((*mainCat)) <<
"SegmentLine::updateModelSegment";
93 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.