65 pen.setWidth( mPenWidth );
67 const QBrush brush( mFillColor );
72void QgsVertexMarker::updatePath()
74 mPath = QPainterPath();
76 const qreal s = ( mIconSize - 1 ) / 2.0;
84 mPath.moveTo( QPointF( -s, 0 ) );
85 mPath.lineTo( QPointF( s, 0 ) );
86 mPath.moveTo( QPointF( 0, -s ) );
87 mPath.lineTo( QPointF( 0, s ) );
91 mPath.moveTo( QPointF( -s, -s ) );
92 mPath.lineTo( QPointF( s, s ) );
93 mPath.moveTo( QPointF( -s, s ) );
94 mPath.lineTo( QPointF( s, -s ) );
98 mPath.addRect( QRectF( -s, -s, s * 2, s * 2 ) );
102 mPath.addEllipse( QPointF( 0, 0 ), s, s );
106 mPath.moveTo( QPointF( -s, -s ) );
107 mPath.lineTo( QPointF( s, -s ) );
108 mPath.lineTo( QPointF( -s, s ) );
109 mPath.lineTo( QPointF( s, s ) );
110 mPath.lineTo( QPointF( -s, -s ) );
114 mPath.moveTo( QPointF( -s, s ) );
115 mPath.lineTo( QPointF( s, s ) );
116 mPath.lineTo( QPointF( 0, -s ) );
117 mPath.lineTo( QPointF( -s, s ) );
121 mPath.moveTo( QPointF( 0, -s ) );
122 mPath.lineTo( QPointF( -s, 0 ) );
123 mPath.lineTo( QPointF( 0, s ) );
124 mPath.lineTo( QPointF( s, 0 ) );
125 mPath.lineTo( QPointF( 0, -s ) );
129 mPath.moveTo( QPointF( -s, -s ) );
130 mPath.lineTo( QPointF( s, -s ) );
131 mPath.lineTo( QPointF( 0, s ) );
132 mPath.lineTo( QPointF( -s, -s ) );
139 const qreal s = qreal( mIconSize + mPenWidth ) / 2.0;
140 return QRectF( -s, -s, 2.0 * s, 2.0 * s );
QPointF toCanvasCoordinates(const QgsPointXY &point) const
transformation from map coordinates to screen coordinates
QgsMapCanvasItem(QgsMapCanvas *mapCanvas)
protected constructor: cannot be constructed directly
Map canvas is a class for displaying all GIS data types on a canvas.
QColor color() const
Returns the stroke color for the marker.
void setFillColor(const QColor &color)
Sets the fill color for the marker.
void setPenWidth(int width)
@ ICON_TRIANGLE
Added in QGIS 3.12.
@ ICON_DOUBLE_TRIANGLE
Added in QGIS 3.0.
@ ICON_INVERTED_TRIANGLE
Added in QGIS 3.20.
@ ICON_RHOMBUS
Added in QGIS 3.12.
void setIconSize(int iconSize)
void setCenter(const QgsPointXY &point)
Sets the center point of the marker, in map coordinates.
QRectF boundingRect() const override
void setIconType(int iconType)
void setColor(const QColor &color)
Sets the stroke color for the marker.
void updatePosition() override
called on changed extent or resize event to update position of the item
void paint(QPainter *p) override
function to be implemented by derived classes
QgsVertexMarker(QgsMapCanvas *mapCanvas)