QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
28 name = lJoinLayer->name() +
'_';
70 joinFeature.
setFields( lJoinLayer->fields() );
74 for (
const auto &
field : joinFields )
88 QStringList fieldNames;
95 for (
const QString &s : qgis::as_const( *lst ) )
98 fieldNames.append( s );
103 if (
auto *lJoinLayer = info.
joinLayer() )
105 const QgsFields fields { lJoinLayer->fields() };
110 fieldNames.
append( f.name() );
void initAttributes(int fieldCount)
Initialize this feature with the given number of fields.
void setEditable(bool enabled)
Sets whether the form of the target layer allows editing joined fields.
Container of fields for a vector layer.
QStringList * joinFieldNamesSubset() const
Returns the subset of fields to be used from joined layer.
static QStringList joinFieldNamesSubset(const QgsVectorLayerJoinInfo &info, bool blocklisted=true)
Returns the list of field names to use for joining considering blocklisted fields and subset.
void setUpsertOnEdit(bool enabled)
Sets whether a feature created on the target layer has to impact the joined layer by creating a new f...
bool append(const QgsField &field, FieldOrigin origin=OriginProvider, int originIndex=-1)
Appends a field. The field must have unique name, otherwise it is rejected (returns false)
QString prefixedFieldName(const QgsField &field) const
Returns the prefixed name of the field.
int fieldNameIndex(const QString &fieldName) const
Utility method to get attribute index from name.
QString targetFieldName() const
Returns name of the field of our layer that will be used for join.
QString prefix() const
Returns prefix of fields from the joined layer. If nullptr, joined layer's name will be used.
void setFields(const QgsFields &fields, bool initAttributes=false)
Assign a field map with the feature to allow attribute access by attribute name.
QString joinFieldName() const
Returns name of the field of joined layer that will be used for join.
QVariant attribute(const QString &name) const
Lookup attribute value from attribute name.
Defines left outer join from our vector layer to some other vector layer.
void setUsingMemoryCache(bool enabled)
Sets whether values from the joined layer should be cached in memory to speed up lookups.
bool setAttribute(int field, const QVariant &attr)
Set an attribute's value by field index.
QgsVectorLayer * joinLayer() const
Returns joined layer (may be nullptr if the reference was set by layer ID and not resolved yet)
QStringList joinFieldNamesBlockList() const
Returns the list of fields to ignore.
QgsFeature extractJoinedFeature(const QgsFeature &feature) const
Extract the join feature from the target feature for the current join layer information.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
bool isUsingMemoryCache() const
Returns whether values from the joined layer should be cached in memory to speed up lookups.
bool mMemoryCache
True if the join is cached in virtual memory.
bool hasSubset(bool blocklisted=true) const
Returns true if blocklisted fields is not empty or if a subset of names has been set.
void setCascadedDelete(bool enabled)
Sets whether a feature deleted on the target layer has to impact the joined layer by deleting the cor...
Encapsulate a field in an attribute table or data source.