QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
15 #ifndef QGSVECTORLAYERJOININFO_H
16 #define QGSVECTORLAYERJOININFO_H
20 #include <QStringList>
63 void setPrefix(
const QString &prefix ) { mPrefix = prefix; }
65 QString
prefix()
const {
return mPrefix; }
68 void setUsingMemoryCache(
bool enabled );
74 bool isUsingMemoryCache()
const;
101 void setEditable(
bool enabled );
184 bool hasSubset(
bool blocklisted =
true )
const;
240 bool mMemoryCache =
false;
251 bool cacheDirty =
true;
253 bool mDynamicForm =
false;
255 bool mEditable =
false;
257 bool mUpsertOnEdit =
false;
259 bool mCascadedDelete =
false;
269 #endif // QGSVECTORLAYERJOININFO_H
bool isDynamicFormEnabled() const
Returns whether the form has to be dynamically updated with joined fields when a feature is being cre...
std::shared_ptr< QStringList > mJoinFieldsSubset
Subset of fields to use from joined layer. nullptr = use all fields.
Q_DECL_DEPRECATED QStringList joinFieldNamesBlackList() const
Returns the list of fields to ignore.
QString mPrefix
An optional prefix.
QStringList * joinFieldNamesSubset() const
Returns the subset of fields to be used from joined layer.
void setUpsertOnEdit(bool enabled)
Sets whether a feature created on the target layer has to impact the joined layer by creating a new f...
QString joinLayerId() const
ID of the joined layer - may be used to resolve reference to the joined layer.
QString targetFieldName() const
Returns name of the field of our layer that will be used for join.
QString layerId
Original layer ID.
QString prefix() const
Returns prefix of fields from the joined layer. If nullptr, joined layer's name will be used.
QgsVectorLayerJoinInfo()=default
Constructor for QgsVectorLayerJoinInfo.
QString mTargetFieldName
Join field in the target layer.
QHash< QString, QgsAttributes > cachedAttributes
Cache for joined attributes to provide fast lookup (size is 0 if no memory caching)
void setDynamicFormEnabled(bool enabled)
Sets whether the form has to be dynamically updated with joined fields when a feature is being create...
bool hasUpsertOnEdit() const
Returns whether a feature created on the target layer has to impact the joined layer by creating a ne...
Manages joined fields for a vector layer.
bool isEditable() const
Returns whether joined fields may be edited through the form of the target layer.
QString joinFieldName() const
Returns name of the field of joined layer that will be used for join.
Defines left outer join from our vector layer to some other vector layer.
void setTargetFieldName(const QString &fieldName)
Sets name of the field of our layer that will be used for join.
void setJoinFieldName(const QString &fieldName)
Sets name of the field of joined layer that will be used for join.
QString mJoinFieldName
Join field in the source layer.
void setJoinFieldNamesSubset(QStringList *fieldNamesSubset)
Sets the subset of fields to be used from joined layer.
void setPrefix(const QString &prefix)
Sets prefix of fields from the joined layer. If nullptr, joined layer's name will be used.
void setJoinFieldNamesBlockList(const QStringList &list)
Sets a list of fields to ignore whatever happens.
Represents a vector layer which manages a vector based data sets.
Q_DECL_DEPRECATED void setJoinFieldNamesBlackList(const QStringList &blackList)
Sets a list of fields to ignore whatever happens.
QgsVectorLayer * joinLayer() const
Returns joined layer (may be nullptr if the reference was set by layer ID and not resolved yet)
bool hasCascadedDelete() const
Returns whether a feature deleted on the target layer has to impact the joined layer by deleting the ...
QStringList joinFieldNamesBlockList() const
Returns the list of fields to ignore.
bool operator==(const QgsVectorLayerJoinInfo &other) const
_LayerRef< QgsVectorLayer > QgsVectorLayerRef
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
bool mMemoryCache
True if the join is cached in virtual memory.
void setJoinLayer(QgsVectorLayer *layer)
Sets weak reference to the joined layer.
void setCascadedDelete(bool enabled)
Sets whether a feature deleted on the target layer has to impact the joined layer by deleting the cor...
QgsVectorLayerRef mJoinLayerRef
Weak reference to the joined layer.
void setJoinLayerId(const QString &layerId)
Sets ID of the joined layer. It will need to be overwritten by setJoinLayer() to a reference to real ...
Encapsulate a field in an attribute table or data source.