31#include "moc_qgsmaptoolzoom.cpp"
55 if ( !( e->buttons() & Qt::LeftButton ) )
58 setZoomMode( e->modifiers().testFlag( Qt::AltModifier ) ^
mNativeZoomOut );
65 QColor color( Qt::blue );
82 if ( e->button() != Qt::LeftButton )
92 if ( e->button() != Qt::LeftButton )
102 setZoomMode( e->modifiers().testFlag( Qt::AltModifier ) ^
mNativeZoomOut );
131 const QSize &zoomRectSize =
mZoomRect.size();
133 const QSize &canvasSize = mapSettings.
outputSize();
134 const double sfx =
static_cast<double>( zoomRectSize.width() ) / canvasSize.width();
135 const double sfy =
static_cast<double>( zoomRectSize.height() ) / canvasSize.height();
136 const double sf = std::max( sfx, sfy );
155void QgsMapToolZoom::setZoomMode(
bool zoomOut,
bool force )
157 if ( !force && zoomOut ==
mZoomOut )
166 if ( e->key() == Qt::Key_Alt )
177 if ( e->key() == Qt::Key_Alt )
182 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