22 #include <QMouseEvent> 34 , mRubberBand( nullptr )
50 if ( !( e->
buttons() & Qt::LeftButton ) )
74 if ( e->
button() != Qt::LeftButton )
83 if ( e->
button() != Qt::LeftButton )
113 double sfx = ( double )zoomRectSize.
width() / canvasSize.
width();
114 double sfy = ( double )zoomRectSize.
height() / canvasSize.
height();
115 double sf = qMax( sfx, sfy );
void zoomWithCenter(int x, int y, bool zoomIn)
Zooms in/out with a given center.
void setToCanvasRectangle(QRect rect)
Sets this rubber band to a map canvas rectangle.
const char * zoom_in[]
Bitmap cursors for map operations.
void setBottomRight(const QPoint &position)
QPoint bottomRight() const
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
QgsPoint toMapCoordinates(int x, int y) const
void refresh()
Repaints the canvas map.
QString tr(const char *sourceText, const char *disambiguation, int n)
Map canvas is a class for displaying all GIS data types on a canvas.
The QgsMapSettings class contains configuration for rendering of the map.
Perform transforms between map coordinates and device coordinates.
A class for drawing transient features (e.g.
A class to represent a point.
const QgsMapSettings & mapSettings() const
Get access to properties used for map rendering.
void setTopLeft(const QPoint &position)
void setRect(int x, int y, int width, int height)
const QgsMapToPixel * getCoordinateTransform()
Get the current coordinate transform.
void setColor(const QColor &color)
Set the color for the rubberband.
const QPoint & pos() const
QSize outputSize() const
Return the size of the resulting map image.
void zoomByFactor(double scaleFactor, const QgsPoint *center=nullptr)
Zoom with the factor supplied.