23#include "moc_qgsmaptoolzoom.cpp"
35 , mNativeZoomOut( zoomOut )
57 if ( !( e->buttons() & Qt::LeftButton ) )
60 setZoomMode( e->modifiers().testFlag( Qt::AltModifier ) ^
mNativeZoomOut );
67 QColor color( Qt::blue );
84 if ( e->button() != Qt::LeftButton )
94 if ( e->button() != Qt::LeftButton )
104 setZoomMode( e->modifiers().testFlag( Qt::AltModifier ) ^
mNativeZoomOut );
135 const QSize &canvasSize = mapSettings.
outputSize();
136 const double sfx =
static_cast<double>( zoomRectSize.width() ) / canvasSize.width();
137 const double sfy =
static_cast<double>( zoomRectSize.height() ) / canvasSize.height();
138 const double sf = std::max( sfx, sfy );
157void QgsMapToolZoom::setZoomMode(
bool zoomOut,
bool force )
159 if ( !force && zoomOut ==
mZoomOut )
168 if ( e->key() == Qt::Key_Alt )
179 if ( e->key() == Qt::Key_Alt )
184 if ( e->key() == Qt::Key_Escape &&
mDragging )
Extends QApplication to provide access to QGIS specific resources such as theme paths,...
Map canvas is a class for displaying all GIS data types on a canvas.
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
The QgsMapSettings class contains configuration for rendering of the map.
QSize outputSize() const
Returns the size of the resulting map image, in pixels.
Perform transforms between map coordinates and device coordinates.
QgsPointXY toMapCoordinates(int x, int y) const
Transforms device coordinates to map (world) coordinates.
A class to represent a 2D point.
A class for drawing transient features (e.g.
int size() const
Returns number of geometries.
void setColor(const QColor &color)
Sets the color for the rubberband.
void setToCanvasRectangle(QRect rect)
Sets this rubber band to a map canvas rectangle.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c