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; }
97 void setEditable(
bool enabled );
133 QString prefixedFieldName(
const QgsField &field )
const;
164 bool hasSubset(
bool blacklisted =
true )
const;
209 bool mMemoryCache =
false;
220 bool cacheDirty =
true;
222 bool mDynamicForm =
false;
224 bool mEditable =
false;
226 bool mUpsertOnEdit =
false;
228 bool mCascadedDelete =
false;
238 #endif // QGSVECTORLAYERJOININFO_H void setJoinLayer(QgsVectorLayer *layer)
Sets weak reference to the joined layer.
QString joinLayerId() const
ID of the joined layer - may be used to resolve reference to the joined layer.
bool mMemoryCache
True if the join is cached in virtual memory.
QString mTargetFieldName
Join field in the target layer.
bool hasUpsertOnEdit() const
Returns whether a feature created on the target layer has to impact the joined layer by creating a ne...
QString targetFieldName() const
Returns name of the field of our layer that will be used for join.
QStringList joinFieldNamesBlackList() const
Returns the list of fields to ignore.
void setJoinFieldName(const QString &fieldName)
Sets name of the field of joined layer that will be used for join.
void setDynamicFormEnabled(bool enabled)
Sets whether the form has to be dynamically updated with joined fields when a feature is being create...
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
std::shared_ptr< QStringList > mJoinFieldsSubset
Subset of fields to use from joined layer. null = use all fields.
QHash< QString, QgsAttributes > cachedAttributes
Cache for joined attributes to provide fast lookup (size is 0 if no memory caching) ...
Manages joined fields for a vector layer.
bool isUsingMemoryCache() const
Returns whether values from the joined layer should be cached in memory to speed up lookups...
bool isEditable() const
Returns whether joined fields may be edited through the form of the target layer. ...
bool operator==(const QgsVectorLayerJoinInfo &other) const
void setUpsertOnEdit(bool enabled)
Sets whether a feature created on the target layer has to impact the joined layer by creating a new f...
QgsVectorLayerRef mJoinLayerRef
Weak reference to the joined layer.
QString layerId
Original layer ID.
bool isDynamicFormEnabled() const
Returns whether the form has to be dynamically updated with joined fields when a feature is being cre...
QStringList * joinFieldNamesSubset() const
Gets subset of fields to be used from joined layer.
Defines left outer join from our vector layer to some other vector layer.
QString joinFieldName() const
Returns name of the field of joined layer that will be used for join.
void setUsingMemoryCache(bool enabled)
Sets whether values from the joined layer should be cached in memory to speed up lookups.
Encapsulate a field in an attribute table or data source.
void setTargetFieldName(const QString &fieldName)
Sets name of the field of our layer that will be used for join.
QString mJoinFieldName
Join field in the source layer.
QString prefix() const
Returns prefix of fields from the joined layer. If null, joined layer's name will be used...
void setPrefix(const QString &prefix)
Sets prefix of fields from the joined layer. If null, joined layer's name will be used...
bool hasCascadedDelete() const
Returns whether a feature deleted on the target layer has to impact the joined layer by deleting the ...
_LayerRef< QgsVectorLayer > QgsVectorLayerRef
void setCascadedDelete(bool enabled)
Sets whether a feature deleted on the target layer has to impact the joined layer by deleting the cor...
QgsVectorLayer * joinLayer() const
Returns joined layer (may be null if the reference was set by layer ID and not resolved yet) ...
void setJoinFieldNamesBlackList(const QStringList &blackList)
Sets a list of fields to ignore whatever happens.
Represents a vector layer which manages a vector based data sets.
QString mPrefix
An optional prefix.
void setJoinFieldNamesSubset(QStringList *fieldNamesSubset)
Set subset of fields to be used from 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 ...