QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
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#include <QPainterPath>
28
29#include "RCoordinateListener.h"
30#include "RPaletteListener.h"
31#include "RRuler.h"
32#include "RVector.h"
33
34class RGraphicsView;
36
44class QCADGUI_EXPORT RRulerQt: public QFrame, public RRuler, public RCoordinateListener, public RPaletteListener {
45
46Q_OBJECT
47Q_PROPERTY(Qt::Orientation orientation READ getOrientation WRITE setOrientation);
48
49public:
50 RRulerQt(QWidget* parent=0);
51 virtual ~RRulerQt();
52
53 virtual void setOrientation(Qt::Orientation orientation);
54
55 virtual QSize sizeHint() const;
56
57 virtual void paintTick(int pos, bool major, const QString& label);
58
59 virtual QFont getFont() const;
60
61 virtual void updateViewport();
62
63 virtual void updateCoordinate(RDocumentInterface* documentInterface);
64
65 virtual void updatePalette() {
66 lastSize = QSize(0,0);
67 darkGuiBackground = -1;
68 }
69
70protected:
71 void paintEvent(QPaintEvent *);
72
73private:
74 QPainter *painter;
75 QImage buffer;
76 QSize lastSize;
78 QPainterPath cursorArrowH;
79 QPainterPath cursorArrowV;
82 mutable QSize hint;
83};
84
86
87#endif
Q_DECLARE_METATYPE(RMath *)
Abstract base class for classes that are interested in the current coordinate of the mouse cursor.
Definition RCoordinateListener.h:38
virtual void updateCoordinate(RDocumentInterface *documentInterface)=0
Interface for interaction between a graphics document and a user.
Definition RDocumentInterface.h:97
Graphics view.
Definition RGraphicsView.h:67
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RPaletteListener.h:33
Abstract base class for widgets that display a ruler, usually shown at the top and left of a graphics...
Definition RRuler.h:37
virtual void paintTick(int pos, bool major, const QString &label)=0
virtual QFont getFont() const =0
virtual void updateViewport()=0
void setOrientation(Qt::Orientation orientation)
Definition RRuler.cpp:12
Widget that displays the current mouse position.
Definition RRulerQt.h:44
int darkGuiBackground
Definition RRulerQt.h:81
QPainterPath cursorArrowV
Definition RRulerQt.h:79
virtual void updatePalette()
This method is called whenever the current palette has changed.
Definition RRulerQt.h:65
QImage buffer
Definition RRulerQt.h:75
QSize lastSize
Definition RRulerQt.h:76
QSize hint
Definition RRulerQt.h:82
RVector cursorPosition
Definition RRulerQt.h:80
bool viewportChanged
Definition RRulerQt.h:77
QPainter * painter
Definition RRulerQt.h:74
QPainterPath cursorArrowH
Definition RRulerQt.h:78
Represents a 3d vector (x/y/z).
Definition RVector.h:47
#define QCADGUI_EXPORT
Definition gui_global.h:10