23#include "moc_qgsmaptoolzoom.cpp"
36 , mNativeZoomOut( zoomOut )
58 if ( !( e->buttons() & Qt::LeftButton ) )
61 setZoomMode( e->modifiers().testFlag( Qt::AltModifier ) ^
mNativeZoomOut );
68 QColor color( Qt::blue );
85 if ( e->button() != Qt::LeftButton )
95 if ( e->button() != Qt::LeftButton )
105 setZoomMode( e->modifiers().testFlag( Qt::AltModifier ) ^
mNativeZoomOut );
136 const QSize &canvasSize = mapSettings.
outputSize();
137 const double sfx =
static_cast<double>( zoomRectSize.width() ) / canvasSize.width();
138 const double sfy =
static_cast<double>( zoomRectSize.height() ) / canvasSize.height();
139 const double sf = std::max( sfx, sfy );
158void QgsMapToolZoom::setZoomMode(
bool zoomOut,
bool force )
160 if ( !force && zoomOut ==
mZoomOut )
169 if ( e->key() == Qt::Key_Alt )
180 if ( e->key() == Qt::Key_Alt )
185 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