Subgroup: Auxiliary

Class: QgsAuxiliaryLayer

class qgis.core.QgsAuxiliaryLayer

Bases: qgis._core.QgsVectorLayer

Class allowing to manage the auxiliary storage for a vector layer.

Such auxiliary data are data used mostly for the needs of QGIS (symbology) and have no real interest in being stored with the native raw geospatial data.

The need arises from the restrictions existing in the manual placement of labels. Manual placement of labels are possible in QGIS by setting some labeling properties (X and Y position, and rotation angle optionally) as being “data-defined”, meaning that values come from a column (or an expression). But setting this up on an existing layer requires either to add new columns to the source layer, while it is not always possible or desirable.

This QgsAuxiliaryLayer provides the solution to this limitation. Actually it’s an editable join to the original vector layer with some synchronisation mechanisms activated such as “Upsert On Edit” or “Delete Cascade”. Thus, auxiliary fields are editable even if the source layer is not and edition of a joined field is also possible.

New in version 3.0: Methods

abstract Returns the abstract of the layer used by QGIS Server in GetCapabilities request.
actions Get all layer actions defined on this layer.
addAttribute Add an attribute field (but does not commit it)
addAuxiliaryField Adds an auxiliary field for the given property.
addCurvedPart
addCurvedRing Adds a ring to polygon/multipolygon features (takes ownership)
addExpressionField Add a new field which is calculated by the expression specified
addFeature
addFeatures
addJoin Joins another vector layer to this layer
addPart Adds a new part polygon to a multipart feature
addPartV2 Adds a new part polygon to a multipart feature
addRing Adds a ring to polygon/multipolygon features
addTopologicalPoints Adds topological points for every vertex of the geometry.
aggregate Calculates an aggregated value from the layer’s features.
allFeatureIds Returns a list of all feature IDs for features present in the source.
appendError
attributeAlias Returns the alias of an attribute name or a null string if there is no alias.
attributeAliases Returns a map of field name to attribute alias
attributeDisplayName Convenience function that returns the attribute alias if defined or the field name else
attributeList Returns list of attribute indexes.
attributeTableConfig Get the attribute table configuration object.
attribution Returns the attribution of the layer used by QGIS Server in GetCapabilities request.
attributionUrl Returns the attribution URL of the layer used by QGIS Server in GetCapabilities request.
autoRefreshInterval Returns the auto refresh interval (in milliseconds).
auxiliaryFields Returns a list of all auxiliary fields currently managed by the layer.
auxiliaryLayer Returns the current auxiliary layer.
beginEditCommand Create edit command for undo/redo operations
blendMode Returns the current blending mode for a layer.
blockSignals
boundingBoxOfSelected Returns the bounding box of the selected features.
capabilitiesString Capabilities for this layer, comma separated and translated.
changeAttributeValue Changes an attribute value for a feature (but does not immediately commit the changes).
changeGeometry Changes a feature’s geometry within the layer’s edit buffer (but does not immediately commit the changes).
childEvent
children
clear Deletes all features from the layer.
clone Returns a new instance equivalent to this one.
commitChanges Attempts to commit to the underlying data provider any buffered changes made since the last to call to startEditing().
commitErrors Returns a list containing any error messages generated when attempting to commit changes to the layer.
conditionalStyles Return the conditional styles that are set for this layer.
connectNotify
constraintDescription Returns the descriptive name for the constraint expression for a specified field index.
constraintExpression Returns the constraint expression for for a specified field index, if set.
countSymbolFeatures Count features for symbols.
createAuxiliaryField Creates a new auxiliary field from a property definition.
createExpressionContext
createExpressionContextScope
createMapRenderer Return new instance of QgsMapLayerRenderer that will be used for rendering of given context
createProperty Creates if necessary a new auxiliary field for a PAL property and activates this property in settings.
crs Returns the layer’s spatial reference system.
customEvent
customProperty Read a custom property from layer.
customPropertyKeys Returns list of all keys within custom properties.
dataComment Returns a description for this layer as defined in the data provider.
dataProvider
dataUrl Returns the DataUrl of the layer used by QGIS Server in GetCapabilities request.
dataUrlFormat Returns the DataUrl format of the layer used by QGIS Server in GetCapabilities request.
defaultValue Returns the calculated default value for the specified field index.
defaultValueDefinition Returns the definition of the expression used when calculating the default value for a field.
deleteAttribute Removes attribute from the layer and commits changes.
deleteAttributes Deletes a list of attribute fields (but does not commit it)
deleteFeature Deletes a feature from the layer (but does not commit it).
deleteFeatures Deletes a set of features from the layer (but does not commit it)
deleteLater
deleteSelectedFeatures Deletes the selected features
deleteStyleFromDatabase Delete a style from the database
deleteVertex Deletes a vertex from a feature.
dependencies Gets the list of dependencies.
deselect Deselect feature by its ID
destroyEditCommand Destroy active command and reverts all changes in it
diagramLayerSettings
diagramRenderer
diagramsEnabled Returns whether the layer contains diagrams which are enabled and should be drawn.
disconnect
disconnectNotify
displayExpression Get the preview expression, used to create a human readable preview string.
displayField This is a shorthand for accessing the displayExpression if it is a simple field.
drawVertexMarker Draws a vertex symbol at (screen) coordinates x, y.
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
editBuffer Buffer with uncommitted editing operations.
editFormConfig Get the configuration of the form used to represent this vector layer.
editorWidgetSetup The editor widget setup defines which QgsFieldFormatter and editor widget will be used for the field at index.
emitStyleChanged Triggers an emission of the styleChanged() signal.
endEditCommand Finish edit command and add it to undo/redo stack
error Get current status error.
event
eventFilter
excludeAttributesWfs A set of attributes that are not advertised in WFS requests with QGIS server.
excludeAttributesWms A set of attributes that are not advertised in WMS requests with QGIS server.
exists Returns true if the property is stored in the layer already, false otherwise.
exportNamedMetadata Export the current metadata of this layer as named metadata in a QDomDocument
exportNamedStyle Export the properties of this layer as named style in a QDomDocument
exportSldStyle Export the properties of this layer as SLD style in a QDomDocument
expressionField Returns the expression used for a given expression field
extensionPropertyType Returns the extension of a Property.
extent
featureBlendMode Returns the current blending mode for features
featureCount Number of features rendered with specified legend key.
fieldConstraints Returns any constraints which are present for a specified field index.
fieldConstraintsAndStrength Returns a map of constraint with their strength for a specific field of the layer.
fields Returns the list of fields of this layer.
findChild findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
findChildren findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
flushBuffer Flushes any internal buffer which may exist in the sink, causing any buffered features to be added to the sink’s destination.
formatLayerName A convenience function to capitalize and format a layer name.
geometryType Returns point, line or polygon
getDoubleValues Fetches all double values from a specified field name or expression.
getFeature Query the layer for the feature with the given id.
getFeatures Query the layer for features specified in request.
getSelectedFeatures Get an iterator of the selected features
getStyleFromDatabase Will return the named style corresponding to style id provided
getValues Fetches all values from a specified field name or expression.
hasAutoRefreshEnabled Returns true if auto refresh is enabled for the layer.
hasDependencyCycle
hasScaleBasedVisibility Returns whether scale based visibility is enabled for the layer.
htmlMetadata
id Returns the layer’s unique ID, which is used to access this layer from QgsProject.
importNamedMetadata Import the metadata of this layer from a QDomDocument
importNamedStyle Import the properties of this layer from a QDomDocument
indexOfPropertyDefinition Returns the index of the auxiliary field for a specific property definition.
inherits
insertVertex Insert a new vertex before the given vertex number,
installEventFilter
invertSelection Select not selected features and deselect selected ones
invertSelectionInRectangle Invert selection of features found within the search rectangle (in layer’s coordinates)
isAuxiliaryField Returns true if the field comes from the auxiliary layer, false otherwise.
isEditCommandActive Test if an edit command is active
isEditable Returns true if the provider is in editing mode
isHiddenProperty Returns true if the underlying field has to be hidden from editing tools like attribute table, false otherwise.
isInScaleRange Tests whether the layer should be visible at the specified scale.
isModified Returns true if the provider has been modified since the last commit
isRefreshOnNotifyEnabled Returns true if the refresh on provider nofification is enabled
isSignalConnected
isSpatial Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeometry
isValid Return the status of the layer.
isWidgetType
isWindowType
joinBuffer Accessor to the join buffer object
joinInfo Returns information to use for joining with primary key and so on.
keywordList Returns the keyword list of the layer used by QGIS Server in GetCapabilities request.
killTimer
labeling Access to labeling configuration.
labelsEnabled Returns whether the layer contains labels which are enabled and should be drawn.
legend Can be null.
legendUrl Returns the URL for the layer’s legend.
legendUrlFormat Returns the format for a URL based layer legend.
listStylesInDatabase Lists all the style in db split into related to the layer and not related to
loadAuxiliaryLayer Loads the auxiliary layer for this vector layer.
loadDefaultMetadata Retrieve the default metadata for this layer if one
loadDefaultStyle Retrieve the default style for this layer if one
loadNamedMetadata Retrieve a named metadata for this layer if one
loadNamedMetadataFromDatabase Retrieve a named metadata for this layer from a sqlite database.
loadNamedStyle Load a named style from file/local db/datasource db
loadNamedStyleFromDatabase Retrieve a named style for this layer from a sqlite database.
loadSldStyle Attempts to style the layer using the formatting from an SLD type file.
mapTipTemplate The mapTip is a pretty, html representation for feature information.
materialize Materializes a request (query) made against this feature source, by running it over the source and returning a new memory based vector layer containing the result.
maximumScale Returns the maximum map scale (i.e.
maximumValue Returns the maximum value for an attribute column or an invalid variant in case of error.
metaObject
metadata Returns a reference to the layer’s metadata store.
metadataUri Retrieve the metadata URI for this layer
metadataUrl Returns the metadata URL of the layer used by QGIS Server in GetCapabilities request.
metadataUrlFormat Returns the metadata format of the layer used by QGIS Server in GetCapabilities request.
metadataUrlType Returns the metadata type of the layer used by QGIS Server in GetCapabilities request.
minimumScale Returns the minimum map scale (i.e.
minimumValue Returns the minimum value for an attribute column or an invalid variant in case of error.
modifySelection Modifies the current selection on this layer
moveToThread
moveVertex Moves the vertex at the given position number,
moveVertexV2 Moves the vertex at the given position number,
name Returns the display name of the layer.
nameFromProperty Returns the name of the auxiliary field for a property definition.
objectName
opacity Returns the opacity for the vector layer, where opacity is a value between 0 (totally transparent) and 1.0 (fully opaque).
parent
pendingAllAttributesList Returns list of attribute indexes.
pendingFeatureCount Returns feature count including changes which have not yet been committed
pendingFields Returns the list of fields of this layer.
pendingPkAttributesList Returns list of attributes making up the primary key
pkAttributeList Returns list of attributes making up the primary key
property
propertyDefinitionFromField Returns the property definition from an auxiliary field.
propertyDefinitionFromIndex Returns the property definition for the underlying field index.
propertyFromIndex Returns the underlying property key for the field index.
providerType Return the provider type for this layer
publicSource Gets a version of the internal layer definition that has sensitive bits removed (for example, the password).
pyqtConfigure Each keyword argument is either the name of a Qt property or a Qt signal.
readCommonStyle
readCustomProperties
readExtentFromXml Returns true if the extent is read from the XML document when data source has no metadata, false if it’s the data provider which determines it.
readLayerXml Sets state from Dom document
readOnly Returns if this layer is read only.
readSld
readStyle Read the style for the current layer from the Dom node supplied.
readStyleManager
readSymbology Read the symbology for the current layer from the Dom node supplied.
readXml Reads vector layer specific state from project file Dom node.
receivers
referencingRelations Get relations, where the foreign key is on this layer
refreshOnNotifyMessage Returns the message that should be notified by the provider to triggerRepaint
reload Synchronises with changes in the datasource
removeCustomProperty Remove a custom property from layer.
removeEventFilter
removeExpressionField Remove an expression field
removeFieldAlias Removes an alias (a display name) for attributes to display in dialogs
removeFieldConstraint Removes a constraint for a specified field index.
removeJoin Removes a vector layer join
removeSelection Clear selection
renameAttribute Renames an attribute field (but does not commit it).
renderer Return renderer.
renderer3D Returns 3D renderer associated with the layer.
resolveReferences Resolve references to other layers (kept as layer IDs after reading XML) into layer objects.
rollBack Stops a current editing operation and discards any uncommitted edits.
save Commits changes and starts editing then.
saveDefaultMetadata Save the current metadata of this layer as the default metadata
saveDefaultStyle Save the properties of this layer as the default style
saveNamedMetadata Save the current metadata of this layer as a named metadata
saveNamedStyle Save the properties of this layer as a named style
saveSldStyle Saves the properties of this layer to an SLD format file.
saveStyleToDatabase Save named and sld style of the layer to the style table in the db.
select Select feature by its ID
selectAll Select all the features
selectByExpression Select matching features using an expression.
selectByIds Select matching features using a list of feature IDs.
selectByRect Select features found within the search rectangle (in layer’s coordinates)
selectedFeatureCount The number of features that are selected in this layer
selectedFeatureIds Return reference to identifiers of selected features
selectedFeatures Get a copy of the user-selected features
sender
senderSignalIndex
setAbstract Sets the abstract of the layer used by QGIS Server in GetCapabilities request.
setAttributeTableConfig Set the attribute table configuration object.
setAttribution Sets the attribution of the layer used by QGIS Server in GetCapabilities request.
setAttributionUrl Sets the attribution URL of the layer used by QGIS Server in GetCapabilities request.
setAutoRefreshEnabled Sets whether auto refresh is enabled for the layer.
setAutoRefreshInterval Sets the auto refresh interval (in milliseconds) for the layer.
setAuxiliaryLayer Sets the current auxiliary layer.
setBlendMode Set the blending mode used for rendering a layer.
setConstraintExpression Set the constraint expression for the specified field index.
setCoordinateSystem Setup the coordinate system transformation for the layer
setCrs Sets layer’s spatial reference system
setCustomProperties Set custom properties for layer.
setCustomProperty Set a custom property for layer.
setDataSource Update the data source of the layer.
setDataUrl Sets the DataUrl of the layer used by QGIS Server in GetCapabilities request.
setDataUrlFormat Sets the DataUrl format of the layer used by QGIS Server in GetCapabilities request.
setDefaultValueDefinition Sets the definition of the expression to use when calculating the default value for a field.
setDependencies Sets the list of dependencies.
setDiagramLayerSettings
setDiagramRenderer Sets diagram rendering object (takes ownership)
setDisplayExpression Set the preview expression, used to create a human readable preview string.
setEditFormConfig Get the configuration of the form used to represent this vector layer.
setEditorWidgetSetup copydoc editorWidgetSetup
setError
setExcludeAttributesWfs A set of attributes that are not advertised in WFS requests with QGIS server.
setExcludeAttributesWms A set of attributes that are not advertised in WMS requests with QGIS server.
setExtent
setFeatureBlendMode Set the blending mode used for rendering each feature
setFieldAlias Sets an alias (a display name) for attributes to display in dialogs
setFieldConstraint Sets a constraint for a specified field index.
setKeywordList Sets the keyword list of the layer used by QGIS Server in GetCapabilities request.
setLabeling Set labeling configuration.
setLayerOrder Reorders the previously selected sublayers of this layer from bottom to top.
setLegend Assign a legend controller to the map layer.
setLegendUrl Sets the URL for the layer’s legend.
setLegendUrlFormat Sets the format for a URL based layer legend.
setMapTipTemplate The mapTip is a pretty, html representation for feature information.
setMaximumScale Sets the maximum map scale (i.e.
setMetadata Sets the layer’s metadata store.
setMetadataUrl Sets the metadata URL of the layer used by QGIS Server in GetCapabilities request.
setMetadataUrlFormat Sets the metadata format of the layer used by QGIS Server in GetCapabilities request.
setMetadataUrlType Set the metadata type of the layer used by QGIS Server in GetCapabilities request MetadataUrlType indicates the standard to which the metadata complies.
setMinimumScale Sets the minimum map scale (i.e.
setName Set the display name of the layer.
setObjectName
setOpacity Sets the opacity for the vector layer, where opacity is a value between 0 (totally transparent) and 1.0 (fully opaque).
setParent
setProperty
setProviderEncoding Sets the textencoding of the data provider
setReadExtentFromXml Flag allowing to indicate if the extent has to be read from the XML document when data source has no metadata or if the data provider has to determine it.
setReadOnly Make layer read-only (editing disabled) or not
setRefreshOnNofifyMessage Set the notification message that triggers repaine
setRefreshOnNotifyEnabled Set whether provider notification is connected to triggerRepaint
setRenderer Set renderer which will be invoked to represent this layer.
setRenderer3D Sets 3D renderer for the layer.
setScaleBasedVisibility Sets whether scale based visibility is enabled for the layer.
setShortName Sets the short name of the layer used by QGIS Server to identify the layer.
setSimplifyMethod Set the simplification settings for fast rendering of features
setSubLayerVisibility Set the visibility of the given sublayer name.
setSubsetString Set the string (typically sql) used to define a subset of the layer
setTitle Sets the title of the layer used by QGIS Server in GetCapabilities request.
setValid
shortName Returns the short name of the layer used by QGIS Server to identify the layer.
signalsBlocked
simplifyDrawingCanbeApplied Returns whether the VectorLayer can apply the specified simplification hint
simplifyMethod Returns the simplification settings for fast rendering of features
source Returns the source for the layer.
sourceCrs
sourceExtent
sourceName
splitFeatures Splits features cut by the given line
splitParts Splits parts cut by the given line
startEditing Makes the layer editable.
startTimer
storageType Returns the permanent storage type for this layer as a friendly name.
styleManager Get access to the layer’s style manager.
styleURI Retrieve the style URI for this layer
subLayers Returns the sublayers of this layer.
subsetString Get the string (typically sql) used to define a subset of the layer
thread
timerEvent
timestamp Time stamp of data source in the moment when data/metadata were loaded by provider
title Returns the title of the layer used by QGIS Server in GetCapabilities request.
toSpatialLayer An auxiliary layer is not spatial.
tr
translateFeature Translates feature by dx, dy
triggerRepaint Will advise the map canvas (and any other interested party) that this layer requires to be repainted.
type Returns the type of the layer.
undoStack Return pointer to layer’s undo stack
undoStackStyles Return pointer to layer’s style undo stack
uniqueStringsMatching Returns unique string values of an attribute which contain a specified subset string.
uniqueValues Calculates a list of unique values contained within an attribute in the layer.
updateExpressionField Changes the expression used to define an expression based (virtual) field
updateExtents Update the extents for the layer.
updateFeature Updates an existing feature in the layer, replacing the attributes and geometry for the feature with matching QgsFeature.id() with the attributes and geometry from feature.
updateFields Will regenerate the fields property of this layer by obtaining all fields from the dataProvider, joined fields and virtual fields.
vectorJoins
wkbType Returns the WKBType or WKBUnknown in case of error
writeCommonStyle
writeCustomProperties
writeLayerXml Stores state in Dom node
writeSld Writes the symbology of the layer into the document provided in SLD 1.1 format
writeStyle Write just the style information for the layer into the document
writeStyleManager
writeSymbology Write the symbology for the layer into the docment provided.
writeXml Write vector layer specific state to project file Dom node.

Attributes

AddToSelection
Cross
EditFailed
EmptyGeometry
FastInsert
FetchFeatureFailed
IntersectSelection
InvalidLayer
Metadata
NoMarker
PluginLayer
RasterLayer
RemoveFromSelection
SemiTransparentCircle
SetSelection
Style
Success
VectorLayer
attributeAdded Will be emitted, when a new attribute has been added to this vector layer.
attributeDeleted Will be emitted, when an attribute has been deleted from this vector layer.
attributeValueChanged Is emitted whenever an attribute value change is done in the edit buffer.
autoRefreshIntervalChanged Emitted when the auto refresh interval changes.
beforeAddingExpressionField Will be emitted, when an expression field is going to be added to this vector layer.
beforeCommitChanges Is emitted, before changes are committed to the data provider [signal]
beforeEditingStarted Is emitted, before editing on this layer is started [signal]
beforeModifiedCheck Is emitted, when layer is checked for modifications.
beforeRemovingExpressionField Will be emitted, when an expression field is going to be deleted from this vector layer.
beforeRollBack Is emitted, before changes are rolled back [signal]
blendModeChanged Signal emitted when the blend mode is changed, through QgsMapLayer.setBlendMode() [signal]
committedAttributeValuesChanges This signal is emitted, when attribute value changes are saved to the provider [signal]
committedAttributesAdded This signal is emitted, when attributes are added to the provider [signal]
committedAttributesDeleted This signal is emitted, when attributes are deleted from the provider [signal]
committedFeaturesAdded This signal is emitted, when features are added to the provider [signal]
committedFeaturesRemoved This signal is emitted, when features are deleted from the provider [signal]
committedGeometriesChanges This signal is emitted, when geometry changes are saved to the provider [signal]
configChanged Emitted whenever the configuration is changed.
crsChanged Emit a signal that layer’s CRS has been reset [signal]
dataChanged Data of layer changed [signal]
dependenciesChanged Emitted when dependencies are changed.
destroyed destroyed(self, QObject = None) [signal]
displayExpressionChanged Emitted when the display expression changes
editCommandDestroyed Signal emitted, whan an edit command is destroyed
editCommandEnded Signal emitted, when an edit command successfully ended
editCommandStarted Signal emitted when a new edit command has been started
editFormConfigChanged Will be emitted whenever the edit form configuration of this layer changes.
editingStarted Is emitted, when editing on this layer has started [signal]
editingStopped Is emitted, when edited changes successfully have been written to the data provider [signal]
featureAdded Emitted when a new feature has been added to the layer
featureBlendModeChanged Signal emitted when setFeatureBlendMode() is called [signal]
featureDeleted Emitted when a feature has been deleted.
featuresDeleted Emitted when features have been deleted.
geometryChanged Is emitted whenever a geometry change is done in the edit buffer.
labelingFontNotFound Emitted when the font family defined for labeling layer is not found on system [signal]
layerModified This signal is emitted when modifications has been done on layer [signal]
legendChanged Signal emitted when legend of the layer has changed
mapTipTemplateChanged Emitted when the map tip changes
metadataChanged Emitted when the layer’s metadata is changed.
nameChanged Emitted when the name has been changed
objectNameChanged objectNameChanged(self, str) [signal]
opacityChanged Emitted when the layer’s opacity is changed, where opacity is a value between 0 (transparent) and 1 (opaque).
raiseError Signals an error related to this vector layer.
readCustomSymbology Signal emitted whenever the symbology (QML-file) for this layer is being read.
readOnlyChanged Emitted when the read only state of this layer is changed.
recalculateExtents This is used to send a request that any mapcanvas using this layer update its extents [signal]
renderer3DChanged Signal emitted when 3D renderer associated with the layer has changed.
rendererChanged Signal emitted when renderer is changed.
repaintRequested By emitting this signal the layer tells that either appearance or content have been changed and any view showing the rendered layer should refresh itself.
selectionChanged This signal is emitted when selection was changed
staticMetaObject
statusChanged Emit a signal with status (e.g.
styleChanged Signal emitted whenever a change affects the layer’s style.
symbolFeatureCountMapChanged Emitted when the feature count for symbols on this layer has been recalculated.
updatedFields Is emitted, whenever the fields available from this layer have been changed.
willBeDeleted Emitted in the destructor when the layer is about to be deleted, but it is still in a perfectly valid state: the last chance for other pieces of code for some cleanup if they use the layer.
writeCustomSymbology Signal emitted whenever the symbology (QML-file) for this layer is being written.
addAuxiliaryField(self, definition: QgsPropertyDefinition) → bool

Adds an auxiliary field for the given property. Setup for widget editors are updated in the target layer as well as the attribute table config to hide auxiliary fields by default.

Parameters:definition – The definition of the property to add
Returns:true if the auxiliary field is well added, false otherwise
appendError()
auxiliaryFields(self) → QgsFields

Returns a list of all auxiliary fields currently managed by the layer.

childEvent()
clear(self) → bool

Deletes all features from the layer. Changes are automatically committed and the layer remains editable.

Returns:true if changes are committed without error, false otherwise.
clone(self, layer: QgsVectorLayer) → QgsAuxiliaryLayer

Returns a new instance equivalent to this one. The underlying table is duplicate for the layer given in parameter. Note that the current auxiliary layer should be saved to have a proper duplicated table.

Parameters:layer – The layer for which the clone is made
connectNotify()
createAuxiliaryField(definition: QgsPropertyDefinition) → QgsField

Creates a new auxiliary field from a property definition.

Parameters:definition – The property definition of the auxiliary field to create

createAuxiliaryField(field: QgsField) -> QgsField Creates a new auxiliary field from a field.

Parameters:field – The field to use to create the auxiliary field
createProperty(property: QgsPalLayerSettings.Property, vlayer: QgsVectorLayer) → int

Creates if necessary a new auxiliary field for a PAL property and activates this property in settings.

Parameters:
  • property – The property to create
  • vlayer – The vector layer
Returns:

The index of the auxiliary field or -1

createProperty(property: QgsDiagramLayerSettings.Property, vlayer: QgsVectorLayer) -> int Creates if necessary a new auxiliary field for a diagram’s property and activates this property in settings.

Parameters:
  • property – The property to create
  • vlayer – The vector layer
Returns:

The index of the auxiliary field or -1

customEvent()
deleteAttribute(self, attr: int) → bool

Removes attribute from the layer and commits changes. The layer remains editable.

Parameters:attr – The index of the attribute to remove
Returns:true if the attribute is well deleted, false otherwise
disconnectNotify()
exists(self, definition: QgsPropertyDefinition) → bool

Returns true if the property is stored in the layer already, false otherwise.

Parameters:definition – The property definition to check
Returns:true if the property is stored, false otherwise
hasDependencyCycle()
indexOfPropertyDefinition(self, definition: QgsPropertyDefinition) → int

Returns the index of the auxiliary field for a specific property definition.

Parameters:definition – The property definition
Returns:The index of the field corresponding to the property or -1
isHiddenProperty(self, index: int) → bool

Returns true if the underlying field has to be hidden from editing tools like attribute table, false otherwise.

Parameters:index – The index of the field for which visibility is checked
isSignalConnected()
joinInfo(self) → QgsVectorLayerJoinInfo

Returns information to use for joining with primary key and so on.

nameFromProperty(def_: QgsPropertyDefinition, joined: bool = False) → str

Returns the name of the auxiliary field for a property definition.

Parameters:
  • def – The property definition
  • joined – The join prefix is taken into account if true
propertyDefinitionFromField(field: QgsField) → QgsPropertyDefinition

Returns the property definition from an auxiliary field.

Parameters:field – The auxiliary field
propertyDefinitionFromIndex(self, index: int) → QgsPropertyDefinition

Returns the property definition for the underlying field index.

Parameters:index – The index of the field
propertyFromIndex(self, index: int) → int

Returns the underlying property key for the field index. The key may be a PAL, diagram or symbology property according to the underlying property definition of the field. The key -1 is returned if an error happened.

Parameters:index – The index of the field
readCommonStyle()
readCustomProperties()
readStyleManager()
receivers()
save(self) → bool

Commits changes and starts editing then.

Returns:true if commit step passed, false otherwise
sender()
senderSignalIndex()
setError()
setExtent()
setValid()
timerEvent()
toSpatialLayer(self) → QgsVectorLayer

An auxiliary layer is not spatial. This method returns a spatial representation of auxiliary data.

Returns:A new spatial vector layer
writeCommonStyle()
writeCustomProperties()
writeStyleManager()