31#include "moc_qgsmaptoolzoom.cpp"
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 );
133 const QSize &zoomRectSize =
mZoomRect.size();
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,...
A mouse event which is the result of a user interaction with a QgsMapCanvas.
Contains configuration for rendering maps.
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.
Responsible for drawing transient features (e.g.
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