QCAD
Open Source 2D CAD
RRuler.h
Go to the documentation of this file.
1 
20 #ifndef RRULER_H
21 #define RRULER_H
22 
23 #include "core_global.h"
24 
25 #include <Qt>
26 #include <QMetaType>
27 
28 class QFont;
29 class RGraphicsView;
30 
38 
39 public:
40  RRuler() :
41  view(NULL), orientation(Qt::Horizontal) {
42  }
43  virtual ~RRuler() {
44  }
45 
47  this->view = view;
48  }
49 
50  Qt::Orientation getOrientation() const {
51  return orientation;
52  }
53 
54  void setOrientation(Qt::Orientation orientation) {
55  this->orientation = orientation;
56  }
57 
58  virtual void paintTick(int pos, bool major, const QString& label) = 0;
59 
60  virtual QFont getFont() const = 0;
61 
62 protected:
64  Qt::Orientation orientation;
65 };
66 
68 
69 #endif
RGraphicsView * view
Definition: RRuler.h:63
#define QCADCORE_EXPORT
Definition: core_global.h:10
void setOrientation(Qt::Orientation orientation)
Definition: RRuler.h:54
Q_DECLARE_METATYPE(RMath *)
Qt::Orientation getOrientation() const
Definition: RRuler.h:50
Qt::Orientation orientation
Definition: RRuler.h:64
void setGraphicsView(RGraphicsView *view)
Definition: RRuler.h:46
Abstract base class for widgets that display a ruler, usually shown at the top and left of a graphics...
Definition: RRuler.h:37
virtual ~RRuler()
Definition: RRuler.h:43
Graphics view.
Definition: RGraphicsView.h:58
RRuler()
Definition: RRuler.h:40