QGIS API Documentation
3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
src
gui
maptools
qgsmaptoolzoom.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsmaptoolzoom.h - map tool for zooming
3
----------------------
4
begin : January 2006
5
copyright : (C) 2006 by Martin Dobias
6
email : wonder.sk at gmail dot com
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 QGSMAPTOOLZOOM_H
17
#define QGSMAPTOOLZOOM_H
18
19
#include "qgis_gui.h"
20
#include "
qgsmaptool.h
"
21
22
#include <QRect>
23
24
class
QgsRubberBand
;
25
31
class
GUI_EXPORT
QgsMapToolZoom
:
public
QgsMapTool
32
{
33
Q_OBJECT
34
35
public
:
37
QgsMapToolZoom
(
QgsMapCanvas
*
canvas
,
bool
zoomOut );
38
~QgsMapToolZoom
()
override
;
39
40
Flags
flags
()
const override
;
41
void
canvasMoveEvent
(
QgsMapMouseEvent
*e )
override
;
42
void
canvasPressEvent
(
QgsMapMouseEvent
*e )
override
;
43
void
canvasReleaseEvent
(
QgsMapMouseEvent
*e )
override
;
44
void
keyPressEvent
( QKeyEvent *e )
override
;
45
void
keyReleaseEvent
( QKeyEvent *e )
override
;
46
void
deactivate
()
override
;
47
48
protected
:
50
QRect
mZoomRect
;
51
// minimum pixel size of diagonal of the zoom rectangle
52
int
mMinPixelZoom
= 20;
53
55
bool
mZoomOut
;
57
bool
mNativeZoomOut
;
58
60
bool
mDragging
=
false
;
61
63
bool
mCanceled
=
false
;
64
65
QgsRubberBand
*
mRubberBand
=
nullptr
;
66
67
QCursor
mZoomOutCursor
;
68
QCursor
mZoomInCursor
;
69
70
private
:
71
void
setZoomMode(
bool
zoomOut,
bool
force =
false
);
72
};
73
74
#endif
QgsMapMouseEvent
A mouse event which is the result of a user interaction with a QgsMapCanvas.
Definition
qgsmapmouseevent.h:38
QgsMapToolZoom::mDragging
bool mDragging
Flag to indicate a map canvas drag operation is taking place.
Definition
qgsmaptoolzoom.h:60
QgsMapToolZoom::mNativeZoomOut
bool mNativeZoomOut
native tool
Definition
qgsmaptoolzoom.h:57
QgsMapToolZoom::mZoomRect
QRect mZoomRect
stores actual zoom rect
Definition
qgsmaptoolzoom.h:50
QgsMapToolZoom::mCanceled
bool mCanceled
Flag to indicate the user has canceled the current zoom operation.
Definition
qgsmaptoolzoom.h:63
QgsMapToolZoom::mRubberBand
QgsRubberBand * mRubberBand
Definition
qgsmaptoolzoom.h:65
QgsMapToolZoom::mZoomOutCursor
QCursor mZoomOutCursor
Definition
qgsmaptoolzoom.h:67
QgsMapToolZoom::mZoomInCursor
QCursor mZoomInCursor
Definition
qgsmaptoolzoom.h:68
QgsMapToolZoom::mMinPixelZoom
int mMinPixelZoom
Definition
qgsmaptoolzoom.h:52
QgsMapToolZoom::QgsMapToolZoom
QgsMapToolZoom(QgsMapCanvas *canvas, bool zoomOut)
constructor
Definition
qgsmaptoolzoom.cpp:33
QgsMapToolZoom::mZoomOut
bool mZoomOut
indicates whether we're zooming in or out
Definition
qgsmaptoolzoom.h:55
QgsMapTool::canvas
QgsMapCanvas * canvas() const
returns pointer to the tool's map canvas
Definition
qgsmaptool.cpp:223
QgsMapTool::QgsMapTool
QgsMapTool(QgsMapCanvas *canvas)
Constructor takes a map canvas as a parameter.
Definition
qgsmaptool.cpp:30
QgsMapTool::Flags
QFlags< Flag > Flags
Definition
qgsmaptool.h:115
QgsMapTool::QgsMapCanvas
friend class QgsMapCanvas
Definition
qgsmaptool.h:380
QgsMapTool::canvasPressEvent
virtual void canvasPressEvent(QgsMapMouseEvent *e)
Mouse press event for overriding. Default implementation does nothing.
Definition
qgsmaptool.cpp:186
QgsMapTool::canvasMoveEvent
virtual void canvasMoveEvent(QgsMapMouseEvent *e)
Mouse move event for overriding. Default implementation does nothing.
Definition
qgsmaptool.cpp:176
QgsMapTool::keyPressEvent
virtual void keyPressEvent(QKeyEvent *e)
Key event for overriding. Default implementation does nothing.
Definition
qgsmaptool.cpp:201
QgsMapTool::keyReleaseEvent
virtual void keyReleaseEvent(QKeyEvent *e)
Key event for overriding. Default implementation does nothing.
Definition
qgsmaptool.cpp:206
QgsMapTool::flags
virtual Flags flags() const
Returns the flags for the map tool.
Definition
qgsmaptool.h:120
QgsMapTool::canvasReleaseEvent
virtual void canvasReleaseEvent(QgsMapMouseEvent *e)
Mouse release event for overriding. Default implementation does nothing.
Definition
qgsmaptool.cpp:191
QgsMapTool::deactivate
virtual void deactivate()
called when map tool is being deactivated
Definition
qgsmaptool.cpp:113
QgsRubberBand
Responsible for drawing transient features (e.g.
Definition
qgsrubberband.h:53
qgsmaptool.h
Generated on
for QGIS API Documentation by
1.15.0