QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RRulerQt.h
Go to the documentation of this file.
1 
20 #ifndef RRULERQT_H
21 #define RRULERQT_H
22 
23 #include "gui_global.h"
24 
25 #include <QFrame>
26 #include <QMetaType>
27 
28 #include "RCoordinateListener.h"
29 #include "RRuler.h"
30 #include "RVector.h"
31 
32 class RGraphicsView;
33 class RDocumentInterface;
34 
42 class QCADGUI_EXPORT RRulerQt: public QFrame, public RRuler, public RCoordinateListener {
43 
44 Q_OBJECT
45 Q_PROPERTY(Qt::Orientation orientation READ getOrientation WRITE setOrientation);
46 
47 public:
48  RRulerQt(QWidget* parent=0);
49  virtual ~RRulerQt();
50 
51  virtual void setOrientation(Qt::Orientation orientation);
52 
53  virtual QSize sizeHint() const;
54 
55  virtual void paintTick(int pos, bool major, const QString& label);
56 
57  virtual QFont getFont() const;
58 
59  void updateViewport();
60 
61  virtual void updateCoordinate(RDocumentInterface* documentInterface);
62 
63 protected:
64  void paintEvent(QPaintEvent *);
65 
66 private:
67  QPainter *painter;
68  QImage buffer;
69  QSize lastSize;
71  QPainterPath cursorArrow;
73  mutable QSize hint;
74 };
75 
77 
78 #endif