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
REventHandler::vsb
QScrollBar * vsb
Definition: REventHandler.h:79
getUrlsFromMimeData
void getUrlsFromMimeData(void mimeData)
Definition: library.js:598
gui_global.h
RVector
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
REventHandler
Event handler class.
Definition: REventHandler.h:53
REventHandler::documentInterface
RDocumentInterface * documentInterface
Definition: REventHandler.h:77
RSnapRestriction
Abstract base class for all snap restriction implementations.
Definition: RSnapRestriction.h:37
RGraphicsView
Graphics view.
Definition: RGraphicsView.h:58
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(RMath *)
REventHandler::widget
QWidget * widget
Definition: REventHandler.h:76
REventHandler::hruler
RRulerQt * hruler
Definition: REventHandler.h:81
RSnap
Abstract base class for all grid and object snap implementations.
Definition: RSnap.h:44
RRulerQt
Widget that displays the current mouse position.
Definition: RRulerQt.h:44
REventHandler::graphicsView
RGraphicsView * graphicsView
Definition: REventHandler.h:80
REventHandler::hsb
QScrollBar * hsb
Definition: REventHandler.h:78
RTextLabel
Text label.
Definition: RTextLabel.h:42
QCADGUI_EXPORT
#define QCADGUI_EXPORT
Definition: gui_global.h:10
REventHandler::vruler
RRulerQt * vruler
Definition: REventHandler.h:82
RDocumentInterface
Interface for interaction between a graphics document and a user.
Definition: RDocumentInterface.h:85
isUrl
void isUrl(void urlString)
Definition: library.js:865