29#include "moc_qgsmaptooledit.cpp"
36 connect( mCanvas->project(), &QgsProject::layersAdded, this, &QgsMapToolEdit::connectLayers );
37 connectLayers( mCanvas->project()->mapLayers().values() );
72 if ( alternativeBand )
75 color.setAlphaF( color.alphaF() * alphaScale );
106 if ( !fids.isEmpty() && vlayer->labelsEnabled() && vlayer->labeling() )
115 return mCanvas ? qobject_cast<QgsVectorLayer *>(
mCanvas->currentLayer() ) :
nullptr;
134 QVector<QgsPoint>::const_iterator list_it = vertices.constBegin();
135 for ( ; list_it != vertices.constEnd(); ++list_it )
158 QVector<QgsPointXY>::const_iterator list_it = vertices.constBegin();
159 for ( ; list_it != vertices.constEnd(); ++list_it )
172 if ( alternativeBand )
176 color.setAlphaF( alpha );
195void QgsMapToolEdit::connectLayers(
const QList<QgsMapLayer *> &layers )
207void QgsMapToolEdit::cleanCanvas()
209 if ( editableVectorLayers().isEmpty() )
215QList<QgsVectorLayer *> QgsMapToolEdit::editableVectorLayers()
217 QList<QgsVectorLayer *> editableLayers;
220 const auto layers =
mCanvas->project()->mapLayers().values();
221 for ( QgsMapLayer *
layer : layers )
223 QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>(
layer );
225 editableLayers << vlayer;
228 return editableLayers;
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
A rubberband class for QgsAbstractGeometry (considering curved geometries).
void setStrokeColor(const QColor &c)
Sets stroke color for vertex markers.
void setLineStyle(Qt::PenStyle penStyle)
Sets pen style.
void setStrokeWidth(int width)
Sets stroke width.
void setFillColor(const QColor &c)
Sets fill color for vertex markers.
Base class for all map layer types.
void editingStopped()
Emitted when edited changes have been successfully written to the data provider.
Responsible for drawing transient features (e.g.
void setWidth(double width)
Sets the width of the line.
void setStrokeColor(const QColor &color)
Sets the stroke color for the rubberband.
void setLineStyle(Qt::PenStyle penStyle)
Sets the style of the line.
void addPreviewItem(QgsRubberBandPreviewItem *item)
Adds a custom preview item decorator to the rubber band.
void setFillColor(const QColor &color)
Sets the fill color for the rubberband.
static const QgsSettingsEntryColor * settingsDigitizingFillColor
Settings entry digitizing fill color.
static const QgsSettingsEntryInteger * settingsDigitizingLineWidth
Settings entry digitizing line width.
static const QgsSettingsEntryDouble * settingsDigitizingLineColorAlphaScale
Settings entry digitizing line color alpha scale.
static const QgsSettingsEntryDouble * settingsDigitizingDefaultMValue
Settings entry digitizing default m value.
static const QgsSettingsEntryColor * settingsDigitizingLineColor
Settings entry digitizing line color.
static const QgsSettingsEntryDouble * settingsDigitizingDefaultZValue
Settings entry digitizing default z value.
Rubber band preview item for showing vector layer labels.
Represents a vector layer which manages a vector based dataset.
bool isEditable() const final
Returns true if the provider is in editing mode.
bool isSpatial() const final
Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeome...
Q_INVOKABLE Qgis::GeometryType geometryType() const
Returns point, line or polygon.
int addTopologicalPoints(const QgsGeometry &geom)
Adds topological points for every vertex of the geometry.
#define Q_NOWARN_DEPRECATED_POP
#define Q_NOWARN_DEPRECATED_PUSH