QCAD
Open Source 2D CAD
REventHandler.h
Go to the documentation of this file.
1 
20 #ifndef REVENTHANDLER_H
21 #define REVENTHANDLER_H
22 
23 #include "gui_global.h"
24 
25 #include <QObject>
26 #include <QMetaObject>
27 #include <QMetaType>
28 
29 class QScrollBar;
30 class QUrl;
31 class QWidget;
32 class QPainter;
33 class QMimeData;
34 class QDragEnterEvent;
35 
36 class RDocumentInterface;
37 class RGraphicsView;
38 class RRulerQt;
39 class RSnap;
40 class RVector;
41 class RTextLabel;
42 class RSnapRestriction;
43 
53 class QCADGUI_EXPORT REventHandler : public QObject {
54  Q_OBJECT
55 
56 public:
57  REventHandler(QWidget* widget = NULL, RDocumentInterface* documentInterface = NULL);
58 
59  static bool isUrl(const QString& urlString);
60  static QList<QUrl> getUrlsFromMimeData(QMimeData* mimeData);
61 
62  void drawInfoLabel(QPainter *painter, const RTextLabel &textLabel);
63  void drawSnapLabel(QPainter *painter, const RVector &pos, const RVector &posRestriction, const QString &text);
64 
65 public slots:
66  void dragEnter(QDragEnterEvent *event);
67 
68  void updateTextLabel(QPainter *painter, const RTextLabel &textLabel);
69  void updateSnapInfo(QPainter *painter, RSnap *snap, RSnapRestriction *restriction);
70  void viewportChanged();
71 
72  void horizontalScrolled(double pos);
73  void verticalScrolled(double pos);
74 
75 private:
76  QWidget* widget;
78  QScrollBar* hsb;
79  QScrollBar* vsb;
83 };
84 
86 
87 #endif
RDocumentInterface * documentInterface
Definition: REventHandler.h:77
Abstract base class for all grid and object snap implementations.
Definition: RSnap.h:44
QScrollBar * vsb
Definition: REventHandler.h:79
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
Text label.
Definition: RTextLabel.h:42
#define QCADGUI_EXPORT
Definition: gui_global.h:10
Abstract base class for all snap restriction implementations.
Definition: RSnapRestriction.h:37
Widget that displays the current mouse position.
Definition: RRulerQt.h:42
Q_DECLARE_METATYPE(RMath *)
RRulerQt * hruler
Definition: REventHandler.h:81
QScrollBar * hsb
Definition: REventHandler.h:78
Event handler class.
Definition: REventHandler.h:53
RGraphicsView * graphicsView
Definition: REventHandler.h:80
QWidget * widget
Definition: REventHandler.h:76
RRulerQt * vruler
Definition: REventHandler.h:82
Interface for interaction between a graphics document and a user.
Definition: RDocumentInterface.h:84
void getUrlsFromMimeData(void mimeData)
Definition: library.js:713
void isUrl(void urlString)
Definition: library.js:198
Graphics view.
Definition: RGraphicsView.h:58