-
Notifications
You must be signed in to change notification settings - Fork 2
/
cMouseEvents.h
executable file
·80 lines (65 loc) · 2.25 KB
/
cMouseEvents.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* QRAP Project
*
* Version : 0.1
* Date : 2008/04/01
* License : GNU GPLv3
* File : cMouseEvents.h
* Copyright : University of Pretoria
* Author : Dirk van der Merwe
* : email: magdaleen.ballot@up.ac.za
* Description : This probably come from QGIS ... sorry maggie doesn't
* know true origin
*
**************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef MOUSEEVENTS_H_
#define MOUSEEVENTS_H_
#include <QString>
#include <QObject>
#include <QMouseEvent>
#include <QSettings>
#include <QCursor>
#include <QPixmap>
#include <QPointer>
#include <qgsmaptool.h>
#include <qgsmapcanvas.h>
#include <qgsmaptopixel.h>
#include <qgsmaptoolemitpoint.h>
//class QgsMapLayer;
//class QgsMapCanvas;
//class QMouseEvent;
//class QgsPoint;
//class QgsMapTool;
class MouseEvents : public QgsMapTool
{ Q_OBJECT
public:
explicit MouseEvents(QgsMapCanvas* canvas);
virtual ~MouseEvents();
public slots:
//! Overridden mouse move event
virtual void canvasMoveEvent( QgsMapMouseEvent* e ) override;
//! Overridden mouse press event
virtual void canvasPressEvent( QgsMapMouseEvent* e ) override;
//! Overridden mouse release event
virtual void canvasReleaseEvent( QgsMapMouseEvent* e ) override;
//! called when map tool is being deactivated
virtual void deactivate() override;
signals:
void RightPoint(QgsPoint &Point);
void LeftPoint(QgsPoint &Point);
void MouseMove(QgsPoint &Point);
private:
//! pointer to map canvas
//QgsMapCanvas* mCanvas;
QPointer<QgsMapCanvas> mCanvas;
//! cursor used in map tool
//QCursor mCursor;
};
#endif /*MOUSEEVENTS_H_*/