QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
41 if ( mSnappingMarker )
43 mCanvas->scene()->removeItem( mSnappingMarker );
44 mSnappingMarker.
reset();
50 if ( !mSnappingMarker )
97 const QPoint ptGlobal = mCanvas->mapToGlobal( ptCanvas );
98 const QRect rect( ptCanvas.x(), ptCanvas.y(), 1, 1 );
100 QToolTip::showText( ptGlobal, layerName, mCanvas, rect );
107 if ( mSnappingMarker )
108 mSnappingMarker->setVisible( visible );
113 if ( mSnappingMarker )
114 return mSnappingMarker->isVisible();
void reset(T *p=nullptr)
Will reset the managed pointer to p.
void setVisible(bool visible=true)
Sets whether the snapping indicator is visible.
bool hasMiddleSegment() const
Returns true if the Match is the middle of a segment.
void setIconType(int iconType)
@ ICON_INVERTED_TRIANGLE
Added in QGIS 3.20.
@ ICON_TRIANGLE
Added in QGIS 3.12.
QgsPointLocator::Match match() const
Returns currently displayed snapping match.
Map canvas is a class for displaying all GIS data types on a canvas.
QgsPointXY point() const
for vertex / edge match coords depending on what class returns it (geom.cache: layer coords,...
void setIconSize(int iconSize)
@ ICON_DOUBLE_TRIANGLE
Added in QGIS 3.0.
bool hasVertex() const
Returns true if the Match is a vertex.
bool hasCentroid() const
Returns true if the Match is a centroid.
A class for marking vertices of features using e.g. circles or 'x'.
void setParentOwner(QObject *parent)
Sets the parent object.
@ ICON_RHOMBUS
Added in QGIS 3.12.
QPointF toCanvasCoordinates(const QgsPointXY &point) const
transformation from map coordinates to screen coordinates
void setMatch(const QgsPointLocator::Match &match)
Sets snapping match that should be displayed in map canvas. Invalid match hides the indicator.
bool hasLineEndpoint() const
Returns true if the Match is a line endpoint (start or end vertex).
void setPenWidth(int width)
void setCenter(const QgsPointXY &point)
Sets the center point of the marker, in map coordinates.
static const QgsSettingsEntryBool settingsDigitizingSnapTooltip
Settings entry digitizing snap tooltip.
void setColor(const QColor &color)
Sets the stroke color for the marker.
QgsVectorLayer * layer() const
The vector layer where the snap occurred.
T value(const QString &dynamicKeyPart=QString()) const
Returns settings value.
static const QgsSettingsEntryColor settingsDigitizingSnapColor
Settings entry digitizing snap color.
bool isVisible() const
Returns whether the snapping indicator is visible.
int scaleIconSize(int standardSize)
Scales an icon size to compensate for display pixel density, making the icon size hi-dpi friendly,...
QgsSnapIndicator(QgsMapCanvas *canvas)
Constructs an indicator for the given map canvas.
bool hasArea() const
Returns true if the Match is an area.