Engauge Digitizer  2
SegmentLine.h
1 #ifndef SEGMENT_LINE_H
2 #define SEGMENT_LINE_H
3 
4 #include "DocumentModelSegments.h"
5 #include <QGraphicsLineItem>
6 
7 class QGraphicsScene;
8 class Segment;
9 
11 class SegmentLine : public QObject, public QGraphicsLineItem
12 {
13  Q_OBJECT;
14 
15 public:
17  SegmentLine(QGraphicsScene &scene,
18  const DocumentModelSegments &modelSegments,
19  Segment *segment);
20  ~SegmentLine();
21 
23  virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
24 
26  virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
27 
29  virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
30 
32  Segment *segment() const;
33 
35  void setHover (bool hover);
36 
38  void updateModelSegment(const DocumentModelSegments &modelSegments);
39 
40 signals:
42  void signalHover (bool);
43 
44 private:
45  SegmentLine();
46 
47  DocumentModelSegments m_modelSegments;
48  Segment *m_segment;
49 };
50 
51 #endif // SEGMENT_LINE_H
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.
Definition: SegmentLine.cpp:83
Segment * segment() const
Segment that owns this line.
Definition: SegmentLine.cpp:62
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
Highlight this and all other SegmentLines belonging to the same Segment upon hover enter...
Definition: SegmentLine.cpp:41
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
Create points along this curve.
Definition: SegmentLine.cpp:55
Selectable piecewise-defined line that follows a filtered line in the image.
Definition: Segment.h:15
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
Unset highlighting triggered by hover enter.
Definition: SegmentLine.cpp:48
Model for DlgSettingsSegments and CmdSettingsSegments.
This class is a special case of the standard QGraphicsLineItem for segments.
Definition: SegmentLine.h:11
void setHover(bool hover)
Apply/remove highlighting triggered by hover enter/leave.
Definition: SegmentLine.cpp:67