61 qreal s = ( mIconSize - 1 ) / 2.0;
64 pen.setWidth( mPenWidth );
66 QBrush brush( mFillColor );
75 p->drawLine( QLineF( -s, 0, s, 0 ) );
76 p->drawLine( QLineF( 0, -s, 0, s ) );
80 p->drawLine( QLineF( -s, -s, s, s ) );
81 p->drawLine( QLineF( -s, s, s, -s ) );
85 p->drawLine( QLineF( -s, -s, s, -s ) );
86 p->drawLine( QLineF( s, -s, s, s ) );
87 p->drawLine( QLineF( s, s, -s, s ) );
88 p->drawLine( QLineF( -s, s, -s, -s ) );
92 p->drawEllipse( QPointF( 0, 0 ), s, s );
96 p->drawLine( QLineF( -s, -s, s, -s ) );
97 p->drawLine( QLineF( -s, s, s, s ) );
98 p->drawLine( QLineF( -s, -s, s, s ) );
99 p->drawLine( QLineF( s, -s, -s, s ) );
103 p->drawLine( QLineF( -s, s, s, s ) );
104 p->drawLine( QLineF( s, s, 0, -s ) );
105 p->drawLine( QLineF( 0, -s, -s, s ) );
108 p->drawLine( QLineF( 0, -s, -s, 0 ) );
109 p->drawLine( QLineF( -s, 0, 0, s ) );
110 p->drawLine( QLineF( 0, s, s, 0 ) );
111 p->drawLine( QLineF( s, 0, 0, -s ) );
119 qreal s = qreal( mIconSize + mPenWidth ) / 2.0;
120 return QRectF( -s, -s, 2.0 * s, 2.0 * s );
An abstract class for items that can be placed on the map canvas.
QPointF toCanvasCoordinates(const QgsPointXY &point) const
transformation from map coordinates to screen coordinates
Map canvas is a class for displaying all GIS data types on a canvas.
A class to represent a 2D point.
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_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)
QSize iconSize(bool dockableToolbar)
Returns the user-preferred size of a window's toolbar icons.