QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
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
29class QScrollBar;
30class QUrl;
31class QWidget;
32class QMimeData;
33class QDragEnterEvent;
34
36class RGraphicsView;
37class RRulerQt;
38class RSnap;
39class RVector;
40class RTextLabel;
43
53class QCADGUI_EXPORT REventHandler : public QObject {
54 Q_OBJECT
55
56public:
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(RGraphicsViewWorker* worker, const RTextLabel& textLabel);
63 void drawSnapLabel(RGraphicsViewWorker* worker, const RVector& pos, const RVector& posRestriction, const QString& text);
64
65public slots:
66 void dragEnter(QDragEnterEvent* event);
67
68 void updateTextLabel(RGraphicsViewWorker* worker, const RTextLabel& textLabel);
69 void updateSnapInfo(RGraphicsViewWorker* worker, RSnap* snap, RSnapRestriction* restriction);
70 void viewportChanged();
71
72 void horizontalScrolled(double pos);
73 void verticalScrolled(double pos);
74
75private:
76 QWidget* widget;
78 QScrollBar* hsb;
79 QScrollBar* vsb;
83};
84
86
87#endif
Q_DECLARE_METATYPE(RMath *)
Interface for interaction between a graphics document and a user.
Definition RDocumentInterface.h:97
Event handler class.
Definition REventHandler.h:53
QScrollBar * hsb
Definition REventHandler.h:78
RGraphicsView * graphicsView
Definition REventHandler.h:80
QScrollBar * vsb
Definition REventHandler.h:79
QWidget * widget
Definition REventHandler.h:76
RDocumentInterface * documentInterface
Definition REventHandler.h:77
RRulerQt * hruler
Definition REventHandler.h:81
RRulerQt * vruler
Definition REventHandler.h:82
Graphics view.
Definition RGraphicsView.h:67
Thread worker that draws a part of a document.
Definition RGraphicsViewWorker.h:44
Widget that displays the current mouse position.
Definition RRulerQt.h:44
Abstract base class for all grid and object snap implementations.
Definition RSnap.h:43
Abstract base class for all snap restriction implementations.
Definition RSnapRestriction.h:37
Text label.
Definition RTextLabel.h:44
Represents a 3d vector (x/y/z).
Definition RVector.h:47
#define QCADGUI_EXPORT
Definition gui_global.h:10
void getUrlsFromMimeData(void mimeData)
Definition library.js:91
void isUrl(void urlString)
Definition library.js:249
#define NULL
Definition opennurbs_system.h:256