QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
39 int browsedFeatureCount = 0;
40 int couldNotWriteCount = 0;
41 int noGeometryCount = 0;
47 browsedFeatureCount++;
64 QgsDebugMsg( QStringLiteral(
"Could not add new feature. Original copied feature id: %1" ).arg( fid ) );
68 fidList.insert( newFeature.
id() );
69 if ( topologicalEditing )
71 if ( topologicalLayer )
88 if ( !couldNotWriteCount && !noGeometryCount )
94 errorMsg =
new QString( QString( tr(
"Only %1 out of %2 features were copied." ) )
95 .arg( browsedFeatureCount - couldNotWriteCount - noGeometryCount, browsedFeatureCount ) );
96 if ( noGeometryCount )
98 errorMsg->append(
" " );
99 errorMsg->append( tr(
"Some features have no geometry." ) );
101 if ( couldNotWriteCount )
103 errorMsg->append(
" " );
104 errorMsg->append( tr(
"Some could not be created on the layer." ) );
112 return mForceSuppressFormPopup;
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const FINAL
Queries the layer for features specified in request.
bool isEditable() const FINAL
Returns true if the provider is in editing mode.
int addTopologicalPoints(const QgsGeometry &geom)
Adds topological points for every vertex of the geometry.
void setGeometry(const QgsGeometry &geometry)
Set the feature's geometry.
QgsFeatureRequest & setFilterFids(const QgsFeatureIds &fids)
Sets feature IDs that should be fetched.
QgsAttributeMap toMap() const
Returns a QgsAttributeMap of the attribute values.
QSet< QgsFeatureId > QgsFeatureIds
static QgsFeature createFeature(const QgsVectorLayer *layer, const QgsGeometry &geometry=QgsGeometry(), const QgsAttributeMap &attributes=QgsAttributeMap(), QgsExpressionContext *context=nullptr)
Creates a new feature ready for insertion into a layer.
bool nextFeature(QgsFeature &f)
bool hasGeometry() const
Returns true if the feature has an associated geometry.
OperationResult translate(double dx, double dy, double dz=0.0, double dm=0.0)
Translates this geometry by dx, dy, dz and dm.
bool addFeature(QgsFeature &feature, QgsFeatureSink::Flags flags=QgsFeatureSink::Flags()) FINAL
Adds a single feature to the sink.