QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
qgsmaptooltouch.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmaptooltouch.h - map tool for zooming and panning using qgestures
3  ----------------------
4  begin : February 2012
5  copyright : (C) 2012 by Marco Bernasocchi
6  email : marco at bernawebdesign.ch
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSMAPTOOLTOUCH_H
17 #define QGSMAPTOOLTOUCH_H
18 
19 #include "qgsmaptool.h"
20 #include <QGestureEvent>
21 #include <QPinchGesture>
22 
23 class QgsMapCanvas;
24 
25 
30 class GUI_EXPORT QgsMapToolTouch : public QgsMapTool
31 {
32  public:
34  QgsMapToolTouch( QgsMapCanvas* canvas );
35 
36  ~QgsMapToolTouch();
37 
38  void activate();
39  void deactivate();
40 
42  virtual void canvasMoveEvent( QMouseEvent * e );
43 
45  virtual void canvasReleaseEvent( QMouseEvent * e );
46 
48  virtual void canvasDoubleClickEvent( QMouseEvent * e );
49 
50  virtual bool isTransient() { return true; }
51 
52  bool gestureEvent( QGestureEvent *event );
53 
54  private:
55 
57  bool mDragging;
59  bool mPinching;
60  void pinchTriggered( QPinchGesture *gesture );
61 };
62 
63 #endif
virtual void canvasMoveEvent(QMouseEvent *e)
Mouse move event for overriding. Default implementation does nothing.
Definition: qgsmaptool.cpp:138
virtual void canvasDoubleClickEvent(QMouseEvent *e)
Mouse double click event for overriding. Default implementation does nothing.
Definition: qgsmaptool.cpp:143
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:104
virtual void activate()
called when set as currently active map tool
Definition: qgsmaptool.cpp:77
virtual void deactivate()
called when map tool is being deactivated
Definition: qgsmaptool.cpp:93
virtual bool isTransient()
Check whether this MapTool performs a zoom or pan operation.
Definition: qgsmaptooltouch.h:50
A map tool for panning the map.
Definition: qgsmaptooltouch.h:30
Abstract base class for all map tools.
Definition: qgsmaptool.h:48
virtual void canvasReleaseEvent(QMouseEvent *e)
Mouse release event for overriding. Default implementation does nothing.
Definition: qgsmaptool.cpp:153