QGIS/python/gui/auto_generated/qgsmapmouseevent.sip.in

131 lines
4.1 KiB
Plaintext
Raw Normal View History

2017-05-23 14:49:24 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsmapmouseevent.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2015-08-16 16:26:01 +02:00
class QgsMapMouseEvent : QMouseEvent
{
2017-05-23 14:49:24 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
It is sent whenever the user moves, clicks, releases or double clicks the mouse.
In addition to the coordinates in pixel space it also knows the coordinates in the mapcanvas' CRS
as well as it knows the concept of snapping.
2017-05-23 14:49:24 +02:00
%End
2015-08-16 16:26:01 +02:00
%TypeHeaderCode
#include "qgsmapmouseevent.h"
%End
%ConvertToSubClassCode
2017-05-23 14:49:24 +02:00
if ( dynamic_cast<QgsMapMouseEvent *>( sipCpp ) )
sipType = sipType_QgsMapMouseEvent;
else
sipType = 0;
%End
2015-08-16 16:26:01 +02:00
public:
QgsMapMouseEvent( QgsMapCanvas *mapCanvas, QMouseEvent *event );
2017-05-23 14:49:24 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new QgsMapMouseEvent. Should only be required to be called from the QgsMapCanvas.
2017-05-23 14:49:24 +02:00
2017-12-15 10:36:55 -04:00
:param mapCanvas: The map canvas on which the event occurred
:param event: The original mouse event
2017-05-23 14:49:24 +02:00
%End
QgsMapMouseEvent( QgsMapCanvas *mapCanvas, QEvent::Type type, QPoint pos, Qt::MouseButton button = Qt::NoButton,
Qt::MouseButtons buttons = Qt::NoButton, Qt::KeyboardModifiers modifiers = Qt::NoModifier );
%Docstring
2017-12-15 10:36:55 -04:00
Creates a new QgsMapMouseEvent. Should only be required to be called from the QgsMapCanvas.
:param mapCanvas: The map canvas on which the event occurred
:param type: The type of the event
:param pos: The pixel position of the mouse
:param button: The pressed button
:param buttons: Further buttons that are pressed
2017-12-15 10:36:55 -04:00
:param modifiers: Keyboard modifiers
2017-05-23 14:49:24 +02:00
%End
2015-08-16 16:26:01 +02:00
QgsPointXY snapPoint();
2017-05-23 14:49:24 +02:00
%Docstring
snapPoint will snap the points using the map canvas snapping utils configuration
2017-12-15 10:36:55 -04:00
2017-05-23 14:49:24 +02:00
.. note::
if snapping did not succeeded, the map point will be reset to its original position
%End
2015-08-16 16:26:01 +02:00
bool isSnapped() const;
2017-05-23 14:49:24 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns true if there is a snapped point cached.
Will only be useful after snapPoint has previously been called.
:return: True if there is a snapped point cached.
2017-05-23 14:49:24 +02:00
%End
2015-08-16 16:26:01 +02:00
QgsPointXY mapPoint() const;
2017-05-23 14:49:24 +02:00
%Docstring
mapPoint returns the point in coordinates
2017-12-15 10:36:55 -04:00
:return: the point in map coordinates, after snapping if requested in the event.
2017-05-23 14:49:24 +02:00
%End
2015-08-16 16:26:01 +02:00
QgsPointLocator::Match mapPointMatch() const;
2017-05-23 14:49:24 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the matching data from the most recently snapped point.
2018-01-19 14:18:27 +10:00
:return: the snapping data structure
.. versionadded:: 2.14
2018-01-19 11:20:01 +10:00
.. note::
This method returns the most recent snap match. It must
follow a call to snapPoint() in order to have a recent snap result available.
2017-05-23 14:49:24 +02:00
%End
void setMapPoint( const QgsPointXY &point );
2017-05-23 14:49:24 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Set the (snapped) point this event points to in map coordinates.
The point in pixel coordinates will be calculated accordingly.
2017-05-23 14:49:24 +02:00
2017-12-15 10:36:55 -04:00
:param point: The point in map coordinates
2017-05-23 14:49:24 +02:00
%End
QgsPointXY originalMapPoint() const;
2017-05-23 14:49:24 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the original, unmodified map point of the mouse cursor.
:return: The cursor position in map coordinates.
2017-05-23 14:49:24 +02:00
%End
2015-08-16 16:26:01 +02:00
QPoint pixelPoint() const;
2017-05-23 14:49:24 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
The snapped mouse cursor in pixel coordinates.
:return: The snapped mouse cursor position in pixel coordinates.
2017-05-23 14:49:24 +02:00
%End
2015-08-16 16:26:01 +02:00
QPoint originalPixelPoint() const;
2017-05-23 14:49:24 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
The unsnapped, real mouse cursor position in pixel coordinates.
Alias to pos()
:return: Mouse position in pixel coordinates
2017-05-23 14:49:24 +02:00
%End
2015-08-16 16:26:01 +02:00
};
2017-05-23 14:49:24 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsmapmouseevent.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/