QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Public Types | Public Member Functions | List of all members
QgsVertexMarker Class Reference

A class for marking vertices of features using e.g. More...

#include <qgsvertexmarker.h>

Inheritance diagram for QgsVertexMarker:
Inheritance graph
[legend]

Public Types

enum  IconType {
  ICON_NONE , ICON_CROSS , ICON_X , ICON_BOX ,
  ICON_CIRCLE , ICON_DOUBLE_TRIANGLE , ICON_TRIANGLE , ICON_RHOMBUS ,
  ICON_INVERTED_TRIANGLE
}
 Icons. More...
 

Public Member Functions

 QgsVertexMarker (QgsMapCanvas *mapCanvas)
 
QRectF boundingRect () const override
 
QgsPointXY center () const
 Returns the center point of the marker, in map coordinates. More...
 
QColor color () const
 Returns the stroke color for the marker. More...
 
QColor fillColor () const
 Returns the fill color for the marker. More...
 
void paint (QPainter *p) override
 function to be implemented by derived classes More...
 
void setCenter (const QgsPointXY &point)
 Sets the center point of the marker, in map coordinates. More...
 
void setColor (const QColor &color)
 Sets the stroke color for the marker. More...
 
void setFillColor (const QColor &color)
 Sets the fill color for the marker. More...
 
void setIconSize (int iconSize)
 
void setIconType (int iconType)
 
void setPenWidth (int width)
 
void updatePosition () override
 called on changed extent or resize event to update position of the item More...
 
- Public Member Functions inherited from QgsMapCanvasItem
QRectF boundingRect () const override
 
QgsRectangle rect () const
 returns canvas item rectangle in map units More...
 
void setRect (const QgsRectangle &r, bool resetRotation=true)
 sets canvas item rectangle in map units More...
 
QPointF toCanvasCoordinates (const QgsPointXY &point) const
 transformation from map coordinates to screen coordinates More...
 
QgsPointXY toMapCoordinates (QPoint point) const
 transformation from screen coordinates to map coordinates More...
 
virtual void updatePosition ()
 called on changed extent or resize event to update position of the item More...
 

Additional Inherited Members

- Protected Member Functions inherited from QgsMapCanvasItem
 QgsMapCanvasItem (QgsMapCanvas *mapCanvas)
 protected constructor: cannot be constructed directly More...
 
 ~QgsMapCanvasItem () override
 
virtual void paint (QPainter *painter)=0
 function to be implemented by derived classes More...
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
 
bool setRenderContextVariables (QPainter *p, QgsRenderContext &context) const
 Sets render context parameters. More...
 
void updateCanvas ()
 schedules map canvas for repaint More...
 
- Protected Attributes inherited from QgsMapCanvasItem
QSizeF mItemSize
 cached size of the item (to return in boundingRect()) More...
 
QgsMapCanvasmMapCanvas = nullptr
 pointer to map canvas More...
 
QgsRectangle mRect
 cached canvas item rectangle in map coordinates encodes position (xmin,ymax) and size (width/height) used to re-position and re-size the item on zoom/pan while waiting for the renderer to complete. More...
 
double mRectRotation
 

Detailed Description

A class for marking vertices of features using e.g.

circles or 'x'.

Definition at line 36 of file qgsvertexmarker.h.

Member Enumeration Documentation

◆ IconType

Icons.

Enumerator
ICON_NONE 
ICON_CROSS 
ICON_X 
ICON_BOX 
ICON_CIRCLE 
ICON_DOUBLE_TRIANGLE 

Added in QGIS 3.0.

ICON_TRIANGLE 

Added in QGIS 3.12.

ICON_RHOMBUS 

Added in QGIS 3.12.

ICON_INVERTED_TRIANGLE 

Added in QGIS 3.20.

Definition at line 50 of file qgsvertexmarker.h.

Constructor & Destructor Documentation

◆ QgsVertexMarker()

QgsVertexMarker::QgsVertexMarker ( QgsMapCanvas mapCanvas)

Definition at line 21 of file qgsvertexmarker.cpp.

Member Function Documentation

◆ boundingRect()

QRectF QgsVertexMarker::boundingRect ( ) const
override

Definition at line 138 of file qgsvertexmarker.cpp.

◆ center()

QgsPointXY QgsVertexMarker::center ( ) const
inline

Returns the center point of the marker, in map coordinates.

See also
setCenter()
Since
QGIS 3.18

Definition at line 78 of file qgsvertexmarker.h.

◆ color()

QColor QgsVertexMarker::color ( ) const
inline

Returns the stroke color for the marker.

See also
setColor()
fillColor()

Definition at line 96 of file qgsvertexmarker.h.

◆ fillColor()

QColor QgsVertexMarker::fillColor ( ) const
inline

Returns the fill color for the marker.

This setting only applies to some icon types.

See also
setFillColor()
color()

Definition at line 112 of file qgsvertexmarker.h.

◆ paint()

void QgsVertexMarker::paint ( QPainter *  painter)
overridevirtual

function to be implemented by derived classes

Implements QgsMapCanvasItem.

Definition at line 63 of file qgsvertexmarker.cpp.

◆ setCenter()

void QgsVertexMarker::setCenter ( const QgsPointXY point)

Sets the center point of the marker, in map coordinates.

See also
center()

Definition at line 39 of file qgsvertexmarker.cpp.

◆ setColor()

void QgsVertexMarker::setColor ( const QColor &  color)

Sets the stroke color for the marker.

See also
color()
setFillColor()

Definition at line 46 of file qgsvertexmarker.cpp.

◆ setFillColor()

void QgsVertexMarker::setFillColor ( const QColor &  color)

Sets the fill color for the marker.

This setting only applies to some icon types.

See also
fillColor()
setColor()

Definition at line 52 of file qgsvertexmarker.cpp.

◆ setIconSize()

void QgsVertexMarker::setIconSize ( int  iconSize)

Definition at line 33 of file qgsvertexmarker.cpp.

◆ setIconType()

void QgsVertexMarker::setIconType ( int  iconType)

Definition at line 27 of file qgsvertexmarker.cpp.

◆ setPenWidth()

void QgsVertexMarker::setPenWidth ( int  width)

Definition at line 58 of file qgsvertexmarker.cpp.

◆ updatePosition()

void QgsVertexMarker::updatePosition ( )
overridevirtual

called on changed extent or resize event to update position of the item

Reimplemented from QgsMapCanvasItem.

Definition at line 144 of file qgsvertexmarker.cpp.


The documentation for this class was generated from the following files: