22 #include <QMouseEvent> 38 QPixmap myZoomQPixmap = QPixmap((
const char ** )( zoomOut ?
zoom_out :
zoom_in ) );
39 mCursor = QCursor( myZoomQPixmap, 7, 7 );
50 if ( !( e->buttons() & Qt::LeftButton ) )
58 QColor color( Qt::blue );
74 if ( e->button() != Qt::LeftButton )
83 if ( e->button() != Qt::LeftButton )
110 const QSize& zoomRectSize =
mZoomRect.size();
112 const QSize& canvasSize = mapSettings.
outputSize();
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 zoomByFactor(double scaleFactor, const QgsPoint *center=0)
Zoom with the factor supplied.
const char * zoom_in[]
Bitmap cursors for map operations.
const QgsMapSettings & mapSettings() const
Get access to properties used for map rendering.
void refresh()
Repaints the canvas map.
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.
QSize outputSize() const
Return the size of the resulting map image.
A class for drawing transient features (e.g.
A class to represent a point.
QgsPoint toMapCoordinates(int x, int y) const
void setToCanvasRectangle(const QRect &rect)
Sets this rubber band to a map canvas rectangle.
const QgsMapToPixel * getCoordinateTransform()
Get the current coordinate transform.
void setColor(const QColor &color)
Set the color for the rubberband.