QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
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 )
93 if ( e->button() != Qt::LeftButton )
96 setZoomMode( e->modifiers().testFlag( Qt::AltModifier ) ^
mNativeZoomOut );
125 const QSize &zoomRectSize =
mZoomRect.size();
127 const QSize &canvasSize = mapSettings.
outputSize();
128 double sfx =
static_cast<double>( zoomRectSize.width() ) / canvasSize.width();
129 double sfy =
static_cast<double>( zoomRectSize.height() ) / canvasSize.height();
130 double sf = std::max( sfx, sfy );
149 void QgsMapToolZoom::setZoomMode(
bool zoomOut,
bool force )
151 if ( !force && zoomOut ==
mZoomOut )
160 if ( e->key() == Qt::Key_Alt )
171 if ( e->key() == Qt::Key_Alt )
void refresh()
Repaints the canvas map.
QSize outputSize() const
Returns the size of the resulting map image.
void zoomByFactor(double scaleFactor, const QgsPointXY *center=nullptr, bool ignoreScaleLock=false)
Zoom with the factor supplied.
const QgsMapSettings & mapSettings() const
Gets access to properties used for map rendering.
A class for drawing transient features (e.g.
Map canvas is a class for displaying all GIS data types on a canvas.
void zoomWithCenter(int x, int y, bool zoomIn)
Zooms in/out with a given center.
QgsPointXY toMapCoordinates(int x, int y) const
Transform device coordinates to map (world) coordinates.
void setColor(const QColor &color)
Sets the color for the rubberband.
const QgsMapToPixel * getCoordinateTransform()
Gets the current coordinate transform.
Extends QApplication to provide access to QGIS specific resources such as theme paths,...
A class to represent a 2D point.
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
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
Perform transforms between map coordinates and device coordinates.
void setToCanvasRectangle(QRect rect)
Sets this rubber band to a map canvas rectangle.
The QgsMapSettings class contains configuration for rendering of the map.