Engauge Digitizer  2
GridLine.h
1 /******************************************************************************************************
2  * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5  ******************************************************************************************************/
6 
7 #ifndef GRID_LINE_H
8 #define GRID_LINE_H
9 
10 #include <QList>
11 
12 class QGraphicsItem;
13 class QGraphicsScene;
14 class QPen;
15 
16 typedef QList<QGraphicsItem *> SegmentContainer;
17 
20 class GridLine
21 {
22 public:
24  GridLine ();
25  virtual ~GridLine ();
26 
28  GridLine (const GridLine &other);
29 
31  GridLine &operator= (GridLine &other);
32 
34  void add (QGraphicsItem *item);
35 
37  void setPen (const QPen &pen);
38 
40  void setVisible (bool visible);
41 
42 private:
43 
44  SegmentContainer m_segments;
45 };
46 
47 #endif // GRID_LINE_H
GridLine()
Default constructor for storage in containers.
Definition: GridLine.cpp:14
GridLine & operator=(GridLine &other)
Assignment constructor. This will assert if called since copying of pointer containers is problematic...
Definition: GridLine.cpp:35
void setPen(const QPen &pen)
Set the pen style.
Definition: GridLine.cpp:47
Single grid line drawn a straight or curved line.
Definition: GridLine.h:20
void setVisible(bool visible)
Set each grid line as visible or hidden.
Definition: GridLine.cpp:65
void add(QGraphicsItem *item)
Add graphics item which represents one segment of the line.
Definition: GridLine.cpp:42