22 #include <QMouseEvent> 27 :
QgsMapTool( canvas ), mDragging( false ), mPinching( false )
56 if (( e->
buttons() & Qt::LeftButton ) )
69 if ( e->
button() == Qt::LeftButton )
97 qDebug() <<
"gesture " <<
event;
101 pinchTriggered( static_cast<QPinchGesture *>( gesture ) );
107 void QgsMapToolTouch::pinchTriggered(
QPinchGesture *gesture )
109 if ( gesture->
state() == Qt::GestureFinished )
A rectangle specified with double values.
void zoomWithCenter(int x, int y, bool zoomIn)
Zooms in/out with a given center.
void scale(double scaleFactor, const QgsPoint *c=nullptr)
Scale the rectangle around its center point.
QgsPoint toMapPoint(double x, double y) const
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
void refresh()
Repaints the canvas map.
Map canvas is a class for displaying all GIS data types on a canvas.
QGesture * gesture(Qt::GestureType type) const
virtual bool event(QEvent *e)
QgsRectangle extent() const
Returns the current zoom exent of the map canvas.
A class to represent a point.
void zoomOut()
Zoom out with fixed factor.
void panAction(QMouseEvent *event)
Called when mouse is moving and pan is activated.
void setExtent(const QgsRectangle &r, bool magnified=false)
Set the extent of the map canvas.
const QgsMapToPixel * getCoordinateTransform()
Get the current coordinate transform.
const QPoint & pos() const
void panActionEnd(QPoint releasePoint)
Ends pan action and redraws the canvas.