QGIS API Documentation
2.8.2-Wien
|
Represents a vector layer which manages a vector based data sets. More...
#include <qgsvectorlayer.h>
Classes | |
struct | GroupData |
struct | RangeData |
struct | TabData |
struct | ValueRelationData |
Public Types | |
enum | EditorLayout { GeneratedLayout = 0, TabLayout = 1, UiFileLayout = 2 } |
The different types to layout the attribute editor. More... | |
enum | EditType { LineEdit, UniqueValues, UniqueValuesEditable, ValueMap, Classification, EditRange, SliderRange, CheckBox, FileName, Enumeration, Immutable, Hidden, TextEdit, Calendar, DialRange, ValueRelation, UuidGenerator, Photo, WebView, Color, EditorWidgetV2 } |
enum | FeatureFormSuppress { SuppressDefault = 0, SuppressOn = 1, SuppressOff = 2 } |
Types of feature form suppression after feature creation. More... | |
enum | VertexMarkerType { SemiTransparentCircle, Cross, NoMarker } |
Editing vertex markers. More... | |
Public Types inherited from QgsMapLayer | |
enum | LayerType { VectorLayer, RasterLayer, PluginLayer } |
Layers enum defining the types of layers that can be added to a map. More... |
Public Slots | |
void | checkJoinLayerRemove (QString theLayerId) |
Check if there is a join with a layer that will be removed. | |
void | deselect (const QgsFeatureId featureId) |
Deselect feature by its ID. | |
void | deselect (const QgsFeatureIds &featureIds) |
Deselect features by their ID. | |
void | removeSelection () |
Clear selection. | |
void | select (const QgsFeatureId &featureId) |
Select feature by its ID. | |
void | select (const QgsFeatureIds &featureIds) |
Select features by their ID. | |
virtual void | updateExtents () |
Update the extents for the layer. | |
Public Slots inherited from QgsMapLayer | |
Q_DECL_DEPRECATED void | clearCacheImage () |
Clear cached image. | |
virtual void | invalidTransformInput () |
Event handler for when a coordinate transform fails due to bad vertex error. | |
void | setMaximumScale (const float theMaxScale) |
Sets the maximum scale denominator at which the layer will be visible. | |
void | setMinimumScale (const float theMinScale) |
Sets the minimum scale denominator at which the layer will be visible. | |
void | setScaleBasedVisibility (const bool enabled) |
Sets whether scale based visibility is enabled for the layer. | |
virtual QDateTime | timestamp () const |
Time stamp of data source in the moment when data/metadata were loaded by provider. | |
Q_DECL_DEPRECATED void | toggleScaleBasedVisibility (bool theVisibilityFlag) |
Accessor for the scale based visilibility flag. | |
void | triggerRepaint () |
Will advice the map canvas (and any other interested party) that this layer requires to be repainted. |
Signals | |
void | attributeAdded (int idx) |
Will be emitted, when a new attribute has been added to this vector layer. | |
void | attributeDeleted (int idx) |
Will be emitted, when an attribute has been deleted from this vector layer. | |
void | attributeValueChanged (QgsFeatureId fid, int idx, const QVariant &) |
void | beforeCommitChanges () |
Is emitted, before changes are commited to the data provider. | |
void | beforeModifiedCheck () const |
Is emitted, when layer is checked for modifications. | |
void | beforeRollBack () |
Is emitted, before changes are rolled back. | |
void | committedAttributesAdded (const QString &layerId, const QList< QgsField > &addedAttributes) |
void | committedAttributesDeleted (const QString &layerId, const QgsAttributeList &deletedAttributes) |
Signals emitted after committing changes. | |
void | committedAttributeValuesChanges (const QString &layerId, const QgsChangedAttributesMap &changedAttributesValues) |
void | committedFeaturesAdded (const QString &layerId, const QgsFeatureList &addedFeatures) |
void | committedFeaturesRemoved (const QString &layerId, const QgsFeatureIds &deletedFeatureIds) |
void | committedGeometriesChanges (const QString &layerId, const QgsGeometryMap &changedGeometries) |
void | editCommandDestroyed () |
Signal emitted, whan an edit command is destroyed. | |
void | editCommandEnded () |
Signal emitted, when an edit command successfully ended. | |
void | editCommandStarted (const QString &text) |
Signal emitted when a new edit command has been started. | |
void | editingStarted () |
Is emitted, when editing on this layer has started. | |
void | editingStopped () |
Is emitted, when edited changes successfully have been written to the data provider. | |
void | featureAdded (QgsFeatureId fid) |
void | featureBlendModeChanged (const QPainter::CompositionMode &blendMode) |
Signal emitted when setFeatureBlendMode() is called. | |
void | featureDeleted (QgsFeatureId fid) |
void | geometryChanged (QgsFeatureId fid, QgsGeometry &geom) |
void | labelingFontNotFound (QgsVectorLayer *layer, const QString &fontfamily) |
Emitted when the font family defined for labeling layer is not found on system. | |
void | layerDeleted () |
void | layerModified () |
This signal is emitted when modifications has been done on layer. | |
void | layerTransparencyChanged (int layerTransparency) |
Signal emitted when setLayerTransparency() is called. | |
void | readCustomSymbology (const QDomElement &element, QString &errorMessage) |
Signal emitted whenever the symbology (QML-file) for this layer is being read. | |
void | saveLayerToProject () |
void | selectionChanged (const QgsFeatureIds selected, const QgsFeatureIds deselected, const bool clearAndSelect) |
This signal is emitted when selection was changed. | |
void | selectionChanged () |
This signal is emitted when selection was changed. | |
void | updatedFields () |
Is emitted, whenever the fields available from this layer have been changed. | |
void | writeCustomSymbology (QDomElement &element, QDomDocument &doc, QString &errorMessage) const |
Signal emitted whenever the symbology (QML-file) for this layer is being written. | |
Signals inherited from QgsMapLayer | |
void | blendModeChanged (const QPainter::CompositionMode &blendMode) |
Signal emitted when the blend mode is changed, through QgsMapLayer::setBlendMode() | |
void | dataChanged () |
data of layer changed | |
void | drawingProgress (int theProgress, int theTotalSteps) |
void | layerCrsChanged () |
Emit a signal that layer's CRS has been reset. | |
void | layerNameChanged () |
Emit a signal that the layer name has been changed. | |
void | legendChanged () |
Signal emitted when legend of the layer has changed. | |
void | recalculateExtents () |
This is used to send a request that any mapcanvas using this layer update its extents. | |
void | rendererChanged () |
Signal emitted when renderer is changed. | |
void | 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. | |
void | screenUpdateRequested () |
void | statusChanged (QString theStatus) |
Emit a signal with status (e.g. |
Public Member Functions | |
QgsVectorLayer (QString path=QString::null, QString baseName=QString::null, QString providerLib=QString::null, bool loadDefaultStyleFlag=true) | |
Constructor - creates a vector layer. | |
virtual | ~QgsVectorLayer () |
Destructor. | |
QgsAttributeAction * | actions () |
bool | addAttribute (const QgsField &field) |
add an attribute field (but does not commit it) returns true if the field was added | |
void | addAttributeAlias (int attIndex, QString aliasString) |
Sets an alias (a display name) for attributes to display in dialogs. | |
void | addAttributeEditorWidget (QgsAttributeEditorElement *data) |
Adds a tab (for the attribute editor form) holding groups and fields. | |
void | addExpressionField (const QString &exp, const QgsField &fld) |
Add a new field which is calculated by the expression specified. | |
bool | addFeature (QgsFeature &f, bool alsoUpdateExtent=true) |
Adds a feature. | |
bool | addFeatures (QgsFeatureList features, bool makeSelected=true) |
Insert a copy of the given features into the layer (but does not commit it) | |
bool | addJoin (const QgsVectorJoinInfo &joinInfo) |
Joins another vector layer to this layer. | |
int | addPart (const QList< QgsPoint > &ring) |
Adds a new part polygon to a multipart feature. | |
int | addRing (const QList< QgsPoint > &ring) |
Adds a ring to polygon/multipolygon features. | |
int | addTopologicalPoints (QgsGeometry *geom) |
Adds topological points for every vertex of the geometry. | |
int | addTopologicalPoints (const QgsPoint &p) |
Adds a vertex to segments which intersect point p but don't already have a vertex there. | |
QgsFeatureIds | allFeatureIds () |
Get all feature Ids. | |
QString | annotationForm () const |
get annotation form | |
virtual bool | applyNamedStyle (QString namedStyle, QString &errorMsg) |
Will load a named style from a provided QML string. | |
QString | attributeAlias (int attributeIndex) const |
Returns the alias of an attribute name or an empty string if there is no alias. | |
const QMap< QString, QString > & | attributeAliases () const |
QString | attributeDisplayName (int attributeIndex) const |
Convenience function that returns the attribute alias if defined or the field name else. | |
QgsAttributeEditorElement * | attributeEditorElementFromDomElement (QDomElement &elem, QObject *parent) |
convert a saved attribute editor element into a AttributeEditor structure as it's used internally. | |
QList < QgsAttributeEditorElement * > & | attributeEditorElements () |
Returns a list of tabs holding groups and fields. | |
void | beginEditCommand (QString text) |
Create edit command for undo/redo operations. | |
QgsRectangle | boundingBoxOfSelected () |
Returns the bounding box of the selected features. | |
QgsGeometryCache * | cache () |
QString | capabilitiesString () const |
Capabilities for this layer in a friendly format. | |
Q_DECL_DEPRECATED bool | changeAttributeValue (QgsFeatureId fid, int field, QVariant value, bool emitSignal) |
Changes an attribute value (but does not commit it) | |
bool | changeAttributeValue (QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue=QVariant()) |
Changes an attribute value (but does not commit it) | |
bool | changeGeometry (QgsFeatureId fid, QgsGeometry *geom) |
change feature's geometry | |
void | clearAttributeEditorWidgets () |
Clears all the tabs for the attribute editor form. | |
bool | commitChanges () |
Attempts to commit any changes to disk. | |
const QStringList & | commitErrors () |
bool | countSymbolFeatures (bool showProgress=true) |
Count features for symbols. | |
void | createJoinCaches () |
Caches joined attributes if required (and not already done) | |
virtual QgsMapLayerRenderer * | createMapRenderer (QgsRenderContext &rendererContext) override |
Return new instance of QgsMapLayerRenderer that will be used for rendering of given context. | |
QString | dataComment () const |
Returns a comment for the data in the layer. | |
QgsVectorDataProvider * | dataProvider () |
Returns the data provider. | |
const QgsVectorDataProvider * | dataProvider () const |
Returns the data provider in a const-correct manner. | |
Q_DECL_DEPRECATED QString | dateFormat (int idx) |
Access date format. | |
bool | deleteAttribute (int attr) |
delete an attribute field (but does not commit it) | |
bool | deleteAttributes (QList< int > attrs) |
Deletes a list of attribute fields (but does not commit it) | |
bool | deleteFeature (QgsFeatureId fid) |
delete a feature from the layer (but does not commit it) | |
bool | deleteSelectedFeatures (int *deletedCount=0) |
Deletes the selected features. | |
bool | deleteVertex (QgsFeatureId atFeatureId, int atVertex) |
Deletes a vertex from a feature. | |
void | destroyEditCommand () |
Destroy active command and reverts all changes in it. | |
const QgsDiagramLayerSettings * | diagramLayerSettings () const |
const QgsDiagramRendererV2 * | diagramRenderer () const |
const QString | displayExpression () |
Get the preview expression, used to create a human readable preview string. | |
const QString | displayField () const |
Returns the primary display field name used in the identify results dialog. | |
bool | draw (QgsRenderContext &rendererContext) override |
Draws the layer. | |
void | drawLabels (QgsRenderContext &rendererContext) override |
Draws the layer labels using coordinate transformation. | |
QgsVectorLayerEditBuffer * | editBuffer () |
Buffer with uncommitted editing operations. Only valid after editing has been turned on. | |
QString | editForm () |
get edit form | |
QString | editFormInit () |
get python function for edit form initialization | |
EditorLayout | editorLayout () |
get the active layout for the attribute editor for this layer | |
const QString | editorWidgetV2 (int fieldIdx) const |
Get the id for the editor widget used to represent the field at the given index. | |
const QString | editorWidgetV2 (const QString &fieldName) const |
Get the id for the editor widget used to represent the field at the given index. | |
const QgsEditorWidgetConfig | editorWidgetV2Config (int fieldIdx) const |
Get the configuration for the editor widget used to represent the field at the given index. | |
const QgsEditorWidgetConfig | editorWidgetV2Config (const QString &fieldName) const |
Get the configuration for the editor widget used to represent the field at the given index. | |
Q_DECL_DEPRECATED EditType | editType (int idx) |
Get edit type. | |
void | enableLabels (bool on) |
Set labels on. | |
void | endEditCommand () |
Finish edit command and add it to undo/redo stack. | |
const QSet< QString > & | excludeAttributesWFS () const |
const QSet< QString > & | excludeAttributesWMS () const |
QgsRectangle | extent () override |
Return the extent of the layer as a QRect. | |
QPainter::CompositionMode | featureBlendMode () const |
Read blend mode for layer. | |
virtual long | featureCount () const |
Number of features in the layer. | |
long | featureCount (QgsSymbolV2 *symbol) |
Number of features rendered with specified symbol. | |
QgsVectorLayer::FeatureFormSuppress | featureFormSuppress () const |
Type of feature form pop-up suppression after feature creation (overrides app setting) | |
bool | fieldEditable (int idx) |
is edit widget editable | |
int | fieldNameIndex (const QString &fieldName) const |
Returns the index of a field name or -1 if the field does not exist. | |
QGis::GeometryType | geometryType () const |
Returns point, line or polygon. | |
QgsFeatureIterator | getFeatures (const QgsFeatureRequest &request=QgsFeatureRequest()) |
Query the provider for features specified in request. | |
virtual QString | getStyleFromDatabase (QString styleId, QString &msgError) |
Will return the named style corresponding to style id provided. | |
bool | hasGeometryType () const |
Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeometry. | |
bool | hasLabelsEnabled () const |
Label is on. | |
int | insertSegmentVerticesForSnap (const QList< QgsSnappingResult > &snapResults) |
Inserts vertices to the snapped segments. | |
bool | insertVertex (double x, double y, QgsFeatureId atFeatureId, int beforeVertex) |
Insert a new vertex before the given vertex number, in the given ring, item (first number is index 0), and feature Not meaningful for Point geometries. | |
void | invertSelection () |
Select not selected features and deselect selected ones. | |
void | invertSelectionInRectangle (QgsRectangle &rect) |
Invert selection of features found within the search rectangle (in layer's coordinates) | |
virtual bool | isEditable () const override |
Returns true if the provider is in editing mode. | |
virtual bool | isModified () const |
Returns true if the provider has been modified since the last commit. | |
virtual bool | isReadOnly () const |
Returns true if the provider is in read-only mode. | |
QgsLabel * | label () |
Get the label object associated with this layer. | |
const QgsLabel * | label () const |
bool | labelOnTop (int idx) |
label widget on top | |
int | layerTransparency () const |
Read transparency for layer. | |
virtual int | listStylesInDatabase (QStringList &ids, QStringList &names, QStringList &descriptions, QString &msgError) |
Lists all the style in db split into related to the layer and not related to. | |
virtual QString | loadNamedStyle (const QString &theURI, bool &theResultFlag, bool loadFromLocalDb) |
Load a named style from file/local db/datasource db. | |
virtual QString | loadNamedStyle (const QString &theURI, bool &theResultFlag) override |
Calls loadNamedStyle( theURI, theResultFlag, false ); Retained for backward compatibility. | |
QVariant | maximumValue (int index) |
Returns maximum value for an attribute column or invalid variant in case of error. | |
QString | metadata () override |
Obtain Metadata for this layer. | |
QVariant | minimumValue (int index) |
Returns minimum value for an attribute column or invalid variant in case of error. | |
void | modifySelection (QgsFeatureIds selectIds, QgsFeatureIds deselectIds) |
Modifies the current selection on this layer. | |
bool | moveVertex (double x, double y, QgsFeatureId atFeatureId, int atVertex) |
Moves the vertex at the given position number, ring and item (first number is index 0), and feature to the given coordinates. | |
QgsAttributeList | pendingAllAttributesList () |
returns list of attributes | |
int | pendingFeatureCount () |
returns feature count after commit | |
const QgsFields & | pendingFields () const |
returns field list in the to-be-committed state | |
QgsAttributeList | pendingPkAttributesList () |
returns list of attribute making up the primary key | |
QString | providerType () const |
Return the provider type for this layer. | |
Q_DECL_DEPRECATED RangeData | range (int idx) |
Access range widget config data. | |
bool | readSld (const QDomNode &node, QString &errorMessage) override |
bool | readSymbology (const QDomNode &node, QString &errorMessage) override |
Read the symbology for the current layer from the Dom node supplied. | |
virtual bool | readXml (const QDomNode &layer_node) override |
reads vector layer specific state from project file Dom node. | |
QList< QgsRelation > | referencingRelations (int idx) |
Get relations, where the foreign key is on this layer. | |
virtual void | reload () override |
Synchronises with changes in the datasource. | |
void | remAttributeAlias (int attIndex) |
Removes an alias (a display name) for attributes to display in dialogs. | |
void | removeExpressionField (int index) |
Remove an expression field. | |
void | removeJoin (const QString &joinLayerId) |
Removes a vector layer join. | |
Q_DECL_DEPRECATED int | removePolygonIntersections (QgsGeometry *geom, QgsFeatureIds ignoreFeatures=QgsFeatureIds()) |
Changes the specified geometry such that it has no intersections with other polygon (or multipolygon) geometries in this vector layer. | |
QgsFeatureRendererV2 * | rendererV2 () |
Return renderer V2. | |
bool | rollBack (bool deleteBuffer=true) |
Stop editing and discard the edits. | |
virtual void | saveStyleToDatabase (QString name, QString description, bool useAsDefault, QString uiFileContent, QString &msgError) |
Save named and sld style of the layer to the style table in the db. | |
void | select (QgsRectangle &rect, bool addToSelection) |
Select features found within the search rectangle (in layer's coordinates) | |
void | selectAll () |
Select all the features. | |
int | selectedFeatureCount () |
The number of features that are selected in this layer. | |
QgsFeatureList | selectedFeatures () |
Get a copy of the user-selected features. | |
const QgsFeatureIds & | selectedFeaturesIds () const |
Return reference to identifiers of selected features. | |
QgsFeatureIterator | selectedFeaturesIterator (QgsFeatureRequest request=QgsFeatureRequest()) |
Get an iterator of the selected features. | |
void | setAnnotationForm (const QString &ui) |
set annotation form for layer | |
Q_DECL_DEPRECATED void | setCheckedState (int idx, QString checked, QString notChecked) |
Set string representing 'true' for a checkbox. | |
void | setCoordinateSystem () |
Setup the coordinate system transformation for the layer. | |
void | setDiagramLayerSettings (const QgsDiagramLayerSettings &s) |
void | setDiagramRenderer (QgsDiagramRendererV2 *r) |
Sets diagram rendering object (takes ownership) | |
void | setDisplayExpression (const QString &displayExpression) |
Set the preview expression, used to create a human readable preview string. | |
void | setDisplayField (QString fldName="") |
Set the primary display field to be used in the identify results dialog. | |
void | setEditForm (QString ui) |
set edit form | |
void | setEditFormInit (QString function) |
set python function for edit form initialization | |
void | setEditorLayout (EditorLayout editorLayout) |
set the active layout for the attribute editor for this layer | |
void | setEditorWidgetV2 (int attrIdx, const QString &widgetType) |
Set the editor widget type for a field. | |
void | setEditorWidgetV2Config (int attrIdx, const QgsEditorWidgetConfig &config) |
Set the editor widget config for a field. | |
Q_DECL_DEPRECATED void | setEditType (int idx, EditType edit) |
Get edit type. | |
void | setExcludeAttributesWFS (const QSet< QString > &att) |
void | setExcludeAttributesWMS (const QSet< QString > &att) |
void | setFeatureBlendMode (const QPainter::CompositionMode &blendMode) |
Write blend mode for features. | |
void | setFeatureFormSuppress (QgsVectorLayer::FeatureFormSuppress s) |
Set type of feature form pop-up suppression after feature creation (overrides app setting) | |
void | setFieldEditable (int idx, bool editable) |
set edit widget editable | |
void | setLabelOnTop (int idx, bool onTop) |
label widget on top | |
void | setLayerTransparency (int layerTransparency) |
Write transparency for layer. | |
void | setProviderEncoding (const QString &encoding) |
Sets the textencoding of the data provider. | |
bool | setReadOnly (bool readonly=true) |
Make layer read-only (editing disabled) or not. | |
void | setRendererV2 (QgsFeatureRendererV2 *r) |
Set renderer V2. | |
void | setSelectedFeatures (const QgsFeatureIds &ids) |
Change selection to the new set of features. | |
void | setSimplifyMethod (const QgsVectorSimplifyMethod &simplifyMethod) |
Set the simplification settings for fast rendering of features. | |
virtual bool | setSubsetString (QString subset) |
Set the string (typically sql) used to define a subset of the layer. | |
bool | simplifyDrawingCanbeApplied (const QgsRenderContext &renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint) const |
Returns whether the VectorLayer can apply the specified simplification hint. | |
const QgsVectorSimplifyMethod & | simplifyMethod () const |
Returns the simplification settings for fast rendering of features. | |
bool | snapPoint (QgsPoint &point, double tolerance) |
Snaps a point to the closest vertex if there is one within the snapping tolerance. | |
int | snapWithContext (const QgsPoint &startPoint, double snappingTolerance, QMultiMap< double, QgsSnappingResult > &snappingResults, QgsSnapper::SnappingType snap_to) |
Snaps to segment or vertex within given tolerance. | |
int | splitFeatures (const QList< QgsPoint > &splitLine, bool topologicalEditing=false) |
Splits features cut by the given line. | |
int | splitParts (const QList< QgsPoint > &splitLine, bool topologicalEditing=false) |
Splits parts cut by the given line. | |
bool | startEditing () |
Make layer editable. | |
QString | storageType () const |
Returns the permanent storage type for this layer as a friendly name. | |
virtual QString | subsetString () |
Get the string (typically sql) used to define a subset of the layer. | |
int | translateFeature (QgsFeatureId featureId, double dx, double dy) |
Translates feature by dx, dy. | |
void | uniqueValues (int index, QList< QVariant > &uniqueValues, int limit=-1) |
Returns unique values for column. | |
bool | updateFeature (QgsFeature &f) |
Updates an existing feature. | |
void | updateFields () |
Assembles mUpdatedFields considering provider fields, joined fields and added fields. | |
Q_DECL_DEPRECATED QMap < QString, QVariant > | valueMap (int idx) |
Access value map. | |
ValueRelationData | valueRelation (int idx) |
Access value relation widget data. | |
const QList< QgsVectorJoinInfo > & | vectorJoins () const |
Q_DECL_DEPRECATED QSize | widgetSize (int idx) |
Access widget size for photo and webview widget. | |
QGis::WkbType | wkbType () const |
Returns the WKBType or WKBUnknown in case of error. | |
bool | writeSld (QDomNode &node, QDomDocument &doc, QString &errorMessage) const |
bool | writeSymbology (QDomNode &node, QDomDocument &doc, QString &errorMessage) const override |
Write the symbology for the layer into the docment provided. | |
virtual bool | writeXml (QDomNode &layer_node, QDomDocument &doc) override |
write vector layer specific state to project file Dom node. | |
Public Member Functions inherited from QgsMapLayer | |
QgsMapLayer (QgsMapLayer::LayerType type=VectorLayer, QString lyrname=QString::null, QString source=QString::null) | |
Constructor. | |
virtual | ~QgsMapLayer () |
Destructor. | |
const QString & | abstract () const |
const QString & | attribution () const |
const QString & | attributionUrl () const |
QPainter::CompositionMode | blendMode () const |
Read blend mode for layer. | |
Q_DECL_DEPRECATED QImage * | cacheImage () |
const QgsCoordinateReferenceSystem & | crs () const |
Returns layer's spatial reference system. | |
QVariant | customProperty (const QString &value, const QVariant &defaultValue=QVariant()) const |
Read a custom property from layer. | |
const QString & | dataUrl () const |
const QString & | dataUrlFormat () const |
virtual QgsError | error () const |
Get current status error. | |
virtual void | exportNamedStyle (QDomDocument &doc, QString &errorMsg) |
Export the properties of this layer as named style in a QDomDocument. | |
virtual void | exportSldStyle (QDomDocument &doc, QString &errorMsg) |
Export the properties of this layer as SLD style in a QDomDocument. | |
bool | hasScaleBasedVisibility () const |
Returns whether scale based visibility is enabled for the layer. | |
QString | id () const |
Get this layer's unique ID, this ID is used to access this layer from map layer registry. | |
virtual bool | importNamedStyle (QDomDocument &doc, QString &errorMsg) |
Import the properties of this layer from a QDomDocument. | |
bool | isValid () |
const QString & | keywordList () const |
virtual Q_DECL_DEPRECATED QString | lastError () |
virtual Q_DECL_DEPRECATED QString | lastErrorTitle () |
QgsMapLayerLegend * | legend () const |
Can be null. | |
const QString & | legendUrl () const |
const QString & | legendUrlFormat () const |
virtual QString | loadDefaultStyle (bool &theResultFlag) |
Retrieve the default style for this layer if one exists (either as a .qml file on disk or as a record in the users style table in their personal qgis.db) | |
virtual bool | loadNamedStyleFromDb (const QString &db, const QString &theURI, QString &qml) |
virtual QString | loadSldStyle (const QString &theURI, bool &theResultFlag) |
float | maximumScale () const |
Returns the maximum scale denominator at which the layer is visible. | |
const QString & | metadataUrl () const |
const QString & | metadataUrlFormat () const |
const QString & | metadataUrlType () const |
float | minimumScale () const |
Returns the minimum scale denominator at which the layer is visible. | |
const QString & | name () const |
Get the display name of the layer. | |
virtual Q_DECL_DEPRECATED void | onCacheImageDelete () |
const QString & | originalName () const |
Get the original name of the layer. | |
QString | publicSource () const |
bool | readLayerXML (const QDomElement &layerElement) |
sets state from Dom document | |
void | removeCustomProperty (const QString &key) |
Remove a custom property from layer. | |
virtual QString | saveDefaultStyle (bool &theResultFlag) |
Save the properties of this layer as the default style (either as a .qml file on disk or as a record in the users style table in their personal qgis.db) | |
virtual QString | saveNamedStyle (const QString &theURI, bool &theResultFlag) |
Save the properties of this layer as a named style (either as a .qml file on disk or as a record in the users style table in their personal qgis.db) | |
virtual QString | saveSldStyle (const QString &theURI, bool &theResultFlag) |
void | setAbstract (const QString &abstract) |
void | setAttribution (const QString &attrib) |
void | setAttributionUrl (const QString &attribUrl) |
void | setBlendMode (const QPainter::CompositionMode &blendMode) |
Write blend mode for layer. | |
Q_DECL_DEPRECATED void | setCacheImage (QImage *) |
void | setCrs (const QgsCoordinateReferenceSystem &srs, bool emitSignal=true) |
Sets layer's spatial reference system. | |
void | setCustomProperty (const QString &key, const QVariant &value) |
Set a custom property for layer. | |
void | setDataUrl (const QString &dataUrl) |
void | setDataUrlFormat (const QString &dataUrlFormat) |
void | setKeywordList (const QString &keywords) |
void | setLayerName (const QString &name) |
Set the display name of the layer. | |
virtual void | setLayerOrder (const QStringList &layers) |
Reorders the previously selected sublayers of this layer from bottom to top (Useful for providers that manage their own layers, such as WMS) | |
void | setLegend (QgsMapLayerLegend *legend) |
Assign a legend controller to the map layer. | |
void | setLegendUrl (const QString &legendUrl) |
void | setLegendUrlFormat (const QString &legendUrlFormat) |
void | setMetadataUrl (const QString &metaUrl) |
void | setMetadataUrlFormat (const QString &metaUrlFormat) |
void | setMetadataUrlType (const QString &metaUrlType) |
virtual void | setSubLayerVisibility (QString name, bool vis) |
Set the visibility of the given sublayer name. | |
void | setTitle (const QString &title) |
const QString & | source () const |
Returns the source for the layer. | |
QgsMapLayerStyleManager * | styleManager () const |
Get access to the layer's style manager. | |
virtual QString | styleURI () |
Retrieve the style URI for this layer (either as a .qml file on disk or as a record in the users style table in their personal qgis.db) | |
virtual QStringList | subLayers () const |
Returns the sublayers of this layer (Useful for providers that manage their own layers, such as WMS) | |
const QString & | title () const |
QgsMapLayer::LayerType | type () const |
Get the type of the layer. | |
QUndoStack * | undoStack () |
Return pointer to layer's undo stack. | |
bool | writeLayerXML (QDomElement &layerElement, QDomDocument &document, QString relativeBasePath=QString::null) |
stores state in Dom node |
Static Public Member Functions | |
static void | drawVertexMarker (double x, double y, QPainter &p, QgsVectorLayer::VertexMarkerType type, int vertexSize) |
Draws a vertex symbol at (screen) coordinates x, y. | |
Static Public Member Functions inherited from QgsMapLayer | |
static QDomDocument | asLayerDefinition (QList< QgsMapLayer * > layers, QString relativeBasePath=QString::null) |
Returns the given layer as a layer definition document Layer definitions store the data source as well as styling and custom properties. | |
static QString | capitaliseLayerName (const QString &name) |
A convenience function to (un)capitalise the layer name. | |
static QList< QgsMapLayer * > | fromLayerDefinition (QDomDocument &document) |
Creates a new layer from a layer defininition document. | |
static QList< QgsMapLayer * > | fromLayerDefinitionFile (const QString &qlrfile) |
Protected Slots | |
void | invalidateSymbolCountedFlag () |
Protected Member Functions | |
void | setExtent (const QgsRectangle &rect) override |
Set the extent. | |
Protected Member Functions inherited from QgsMapLayer | |
void | appendError (const QgsErrorMessage &theMessage) |
Add error message. | |
void | readCustomProperties (const QDomNode &layerNode, const QString &keyStartsWith="") |
Read custom properties from project file. | |
void | readStyleManager (const QDomNode &layerNode) |
Read style manager's configuration (if any). | |
void | setError (const QgsError &theError) |
Set error message. | |
void | setValid (bool valid) |
set whether layer is valid or not - should be used in constructor. | |
void | writeCustomProperties (QDomNode &layerNode, QDomDocument &doc) const |
Write custom properties to project file. | |
void | writeStyleManager (QDomNode &layerNode, QDomDocument &doc) const |
Write style manager's configuration (if exists). |
Friends | |
class | QgsVectorLayerEditBuffer |
class | QgsVectorLayerFeatureSource |
Additional Inherited Members | |
Protected Attributes inherited from QgsMapLayer | |
QString | mAbstract |
Description of the layer. | |
QString | mAttribution |
Attribution of the layer. | |
QString | mAttributionUrl |
QString | mDataSource |
data source description string, varies by layer type | |
QString | mDataUrl |
DataUrl of the layer. | |
QString | mDataUrlFormat |
QgsError | mError |
Error. | |
QgsRectangle | mExtent |
Extent of the layer. | |
QString | mKeywordList |
QString | mLayerName |
Name of the layer - used for display. | |
QString | mLayerOrigName |
Original name of the layer. | |
QString | mLegendUrl |
WMS legend. | |
QString | mLegendUrlFormat |
QString | mMetadataUrl |
MetadataUrl of the layer. | |
QString | mMetadataUrlFormat |
QString | mMetadataUrlType |
QString | mTitle |
bool | mValid |
Indicates if the layer is valid and can be drawn. |
Represents a vector layer which manages a vector based data sets.
The QgsVectorLayer is instantiated by specifying the name of a data provider, such as postgres or wfs, and url defining the specific data set to connect to. The vector layer constructor in turn instantiates a QgsVectorDataProvider subclass corresponding to the provider type, and passes it the url. The data provider connects to the data source.
The QgsVectorLayer provides a common interface to the different data types. It also manages editing transactions.
Sample usage of the QgsVectorLayer class:
The main data providers supported by QGIS are listed below.
The memory data provider is used to construct in memory data, for example scratch data or data generated from spatial operations such as contouring. There is no inherent persistent storage of the data. The data source uri is constructed. The url specifies the geometry type ("point", "linestring", "polygon", "multipoint","multilinestring","multipolygon"), optionally followed by url parameters as follows:
An example url is "Point?crs=epsg:4326&field=id:integer&field=name:string(20)&index=yes"
Accesses data using the OGR drivers (http://www.gdal.org/ogr/ogr_formats.html). The url is the OGR connection string. A wide variety of data formats can be accessed using this driver, including file based formats used by many GIS systems, database formats, and web services. Some of these formats are also supported by custom data providers listed below.
Access data in a spatialite database. The url defines the connection parameters, table, geometry column, and other attributes. The url can be constructed using the QgsDataSourceURI class.
Connects to a postgresql database. The url defines the connection parameters, table, geometry column, and other attributes. The url can be constructed using the QgsDataSourceURI class.
Connects to a Microsoft SQL server database. The url defines the connection parameters, table, geometry column, and other attributes. The url can be constructed using the QgsDataSourceURI class.
Used to access data provided by a web feature service.
The url can be a HTTP url to a WFS 1.0.0 server or a GML2 data file path. Examples are http://foobar/wfs or /foo/bar/file.gml
If a GML2 file path is provided the driver will attempt to read the schema from a file in the same directory with the same basename + “.xsd”. This xsd file must be in the same format as a WFS describe feature type response. If no xsd file is provide then the driver will attempt to guess the attribute types from the file.
In the case of a HTTP URL the ‘FILTER’ query string parameter can be used to filter the WFS feature type. The ‘FILTER’ key value can either be a QGIS expression or an OGC XML filter. If the value is set to a QGIS expression the driver will turn it into OGC XML filter before passing it to the WFS server. Beware the QGIS expression filter only supports” =, !=, <, >, <=, >=, AND, OR, NOT, LIKE, IS NULL” attribute operators, “BBOX, Disjoint, Intersects, Touches, Crosses, Contains, Overlaps, Within” spatial binary operators and the QGIS local “geomFromWKT, geomFromGML” geometry constructor functions.
Also note:
Accesses data in a delimited text file, for example CSV files generated by spreadsheets. The contents of the file are split into columns based on specified delimiter characters. Each record may be represented spatially either by an X and Y coordinate column, or by a WKT (well known text) formatted columns.
The url defines the filename, the formatting options (how the text in the file is divided into data fields, and which fields contain the X,Y coordinates or WKT text definition. The options are specified as url query items.
At its simplest the url can just be the filename, in which case it will be loaded as a CSV formatted file.
The url may include the following items:
encoding=UTF-8
Defines the character encoding in the file. The default is UTF-8. To use the default encoding for the operating system use "System".
type=(csv|regexp|whitespace|plain)
Defines the algorithm used to split records into columns. Records are defined by new lines, except for csv format files for which quoted fields may span multiple records. The default type is csv.
delimiter=characters
Defines the delimiter characters used for csv and plain type files, or the regular expression for regexp type files. It is a literal string of characters except that "\t" may be used to represent a tab character.
quote=characters
Defines the characters that are used as quote characters for csv and plain type files.
escape=characters
Defines the characters used to escape delimiter, quote, and newline characters.
skipLines=n
Defines the number of lines to ignore at the beginning of the file (default 0)
useHeader=(yes|no)
Defines whether the first record in the file (after skipped lines) contains column names (default yes)
trimFields=(yes|no)
If yes then leading and trailing whitespace will be removed from fields
skipEmptyFields=(yes|no)
If yes then empty fields will be discarded (eqivalent to concatenating consecutive delimiters)
maxFields=#
Specifies the maximum number of fields to load for each record. Additional fields will be discarded. Default is 0 - load all fields.
decimalPoint=c
Defines a character that is used as a decimal point in the numeric columns The default is '.'.
xField=column yField=column
Defines the name of the columns holding the x and y coordinates for XY point geometries. If the useHeader is no (ie there are no column names), then this is the column number (with the first column as 1).
xyDms=(yes|no)
If yes then the X and Y coordinates are interpreted as degrees/minutes/seconds format (fairly permissively), or degree/minutes format.
wktField=column
Defines the name of the columns holding the WKT geometry definition for WKT geometries. If the useHeader is no (ie there are no column names), then this is the column number (with the first column as 1).
geomType=(point|line|polygon|none)
Defines the geometry type for WKT type geometries. QGIS will only display one type of geometry for the layer - any others will be ignored when the file is loaded. By default the provider uses the type of the first geometry in the file. Use geomType to override this type.
geomType can also be set to none, in which case the layer is loaded without geometries.
subset=expression
Defines an expression that will identify a subset of records to display
crs=crsstring
Defines the coordinate reference system used for the layer. This can be any string accepted by QgsCoordinateReferenceSystem::createFromString()
-subsetIndex=(yes|no)
Determines whether the provider generates an index to improve the efficiency of subsets. The default is yes
-spatialIndex=(yes|no)
Determines whether the provider generates a spatial index. The default is no.
-watchFile=(yes|no)
Defines whether the file will be monitored for changes. The default is to monitor for changes.
quiet
Errors encountered loading the file will not be reported in a user dialog if quiet is included (They will still be shown in the output log).
Provider reads tracks, routes, and waypoints from a GPX file. The url defines the name of the file, and the type of data to retrieve from it ("track", "route", or "waypoint").
An example url is "/home/user/data/holiday.gpx?type=route"
Provider to display vector data in a GRASS GIS layer.
Definition at line 474 of file qgsvectorlayer.h.
The different types to layout the attribute editor.
Definition at line 480 of file qgsvectorlayer.h.
Definition at line 490 of file qgsvectorlayer.h.
Types of feature form suppression after feature creation.
Definition at line 517 of file qgsvectorlayer.h.
Editing vertex markers.
Definition at line 1427 of file qgsvectorlayer.h.
QgsVectorLayer::QgsVectorLayer | ( | QString | path = QString::null , |
QString | baseName = QString::null , |
||
QString | providerLib = QString::null , |
||
bool | loadDefaultStyleFlag = true |
||
) |
Constructor - creates a vector layer.
The QgsVectorLayer is constructed by instantiating a data provider. The provider interprets the supplied path (url) of the data source to connect to and access the data.
path | The path or url of the parameter. Typically this encodes parameters used by the data provider as url query items. |
baseName | The name used to represent the layer in the legend |
providerLib | The name of the data provider, eg "memory", "postgres" |
loadDefaultStyleFlag | whether to load the default style |
Definition at line 121 of file qgsvectorlayer.cpp.
|
virtual |
Destructor.
Definition at line 195 of file qgsvectorlayer.cpp.
|
inline |
Definition at line 676 of file qgsvectorlayer.h.
bool QgsVectorLayer::addAttribute | ( | const QgsField & | field | ) |
add an attribute field (but does not commit it) returns true if the field was added
Definition at line 2066 of file qgsvectorlayer.cpp.
void QgsVectorLayer::addAttributeAlias | ( | int | attIndex, |
QString | aliasString | ||
) |
Sets an alias (a display name) for attributes to display in dialogs.
Definition at line 2087 of file qgsvectorlayer.cpp.
void QgsVectorLayer::addAttributeEditorWidget | ( | QgsAttributeEditorElement * | data | ) |
Adds a tab (for the attribute editor form) holding groups and fields.
Definition at line 2098 of file qgsvectorlayer.cpp.
void QgsVectorLayer::addExpressionField | ( | const QString & | exp, |
const QgsField & | fld | ||
) |
Add a new field which is calculated by the expression specified.
exp | The expression which calculates the field |
fld | The field to calculate |
Definition at line 2846 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::addFeature | ( | QgsFeature & | f, |
bool | alsoUpdateExtent = true |
||
) |
Adds a feature.
f | feature to add |
alsoUpdateExtent | If True, will also go to the effort of e.g. updating the extents. |
Definition at line 948 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::addFeatures | ( | QgsFeatureList | features, |
bool | makeSelected = true |
||
) |
Insert a copy of the given features into the layer (but does not commit it)
Definition at line 2382 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::addJoin | ( | const QgsVectorJoinInfo & | joinInfo | ) |
Joins another vector layer to this layer.
joinInfo | join object containing join layer id, target and source field |
Definition at line 2826 of file qgsvectorlayer.cpp.
int QgsVectorLayer::addPart | ( | const QList< QgsPoint > & | ring | ) |
Adds a new part polygon to a multipart feature.
Definition at line 1077 of file qgsvectorlayer.cpp.
int QgsVectorLayer::addRing | ( | const QList< QgsPoint > & | ring | ) |
Adds a ring to polygon/multipolygon features.
Definition at line 1068 of file qgsvectorlayer.cpp.
int QgsVectorLayer::addTopologicalPoints | ( | QgsGeometry * | geom | ) |
Adds topological points for every vertex of the geometry.
geom | the geometry where each vertex is added to segments of other features |
Definition at line 1171 of file qgsvectorlayer.cpp.
int QgsVectorLayer::addTopologicalPoints | ( | const QgsPoint & | p | ) |
Adds a vertex to segments which intersect point p but don't already have a vertex there.
If a feature already has a vertex at position p, no additional vertex is inserted. This method is useful for topological editing.
p | position of the vertex |
Definition at line 1180 of file qgsvectorlayer.cpp.
QgsFeatureIds QgsVectorLayer::allFeatureIds | ( | ) |
Get all feature Ids.
Definition at line 513 of file qgsvectorlayer.cpp.
|
inline |
get annotation form
Definition at line 1347 of file qgsvectorlayer.h.
|
virtual |
Will load a named style from a provided QML string.
namedStyle | A QML string |
errorMsg | An error message indicating problems if any |
Definition at line 3867 of file qgsvectorlayer.cpp.
|
signal |
Will be emitted, when a new attribute has been added to this vector layer.
Applies only to types QgsFields::OriginEdit and QgsFields::OriginProvider
idx | The index of the new attribute |
QString QgsVectorLayer::attributeAlias | ( | int | attributeIndex | ) | const |
Returns the alias of an attribute name or an empty string if there is no alias.
Definition at line 2126 of file qgsvectorlayer.cpp.
|
inline |
Definition at line 1209 of file qgsvectorlayer.h.
|
signal |
Will be emitted, when an attribute has been deleted from this vector layer.
Applies only to types QgsFields::OriginEdit and QgsFields::OriginProvider
idx | The index of the deleted attribute |
QString QgsVectorLayer::attributeDisplayName | ( | int | attributeIndex | ) | const |
Convenience function that returns the attribute alias if defined or the field name else.
Definition at line 2136 of file qgsvectorlayer.cpp.
QgsAttributeEditorElement * QgsVectorLayer::attributeEditorElementFromDomElement | ( | QDomElement & | elem, |
QObject * | parent | ||
) |
convert a saved attribute editor element into a AttributeEditor structure as it's used internally.
elem | the DOM element |
parent | the QObject which will own this object |
Definition at line 1759 of file qgsvectorlayer.cpp.
QList< QgsAttributeEditorElement * > & QgsVectorLayer::attributeEditorElements | ( | ) |
Returns a list of tabs holding groups and fields.
Definition at line 3694 of file qgsvectorlayer.cpp.
|
signal |
|
signal |
Is emitted, before changes are commited to the data provider.
|
signal |
Is emitted, when layer is checked for modifications.
Use for last-minute additions
|
signal |
Is emitted, before changes are rolled back.
void QgsVectorLayer::beginEditCommand | ( | QString | text | ) |
Create edit command for undo/redo operations.
text | text which is to be displayed in undo window |
Definition at line 2772 of file qgsvectorlayer.cpp.
QgsRectangle QgsVectorLayer::boundingBoxOfSelected | ( | ) |
Returns the bounding box of the selected features.
If there is no selection, QgsRectangle(0,0,0,0) is returned
Definition at line 654 of file qgsvectorlayer.cpp.
|
inline |
Definition at line 1468 of file qgsvectorlayer.h.
QString QgsVectorLayer::capabilitiesString | ( | ) | const |
Capabilities for this layer in a friendly format.
Definition at line 226 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::changeAttributeValue | ( | QgsFeatureId | fid, |
int | field, | ||
QVariant | value, | ||
bool | emitSignal | ||
) |
Changes an attribute value (but does not commit it)
Definition at line 2052 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::changeAttributeValue | ( | QgsFeatureId | fid, |
int | field, | ||
const QVariant & | newValue, | ||
const QVariant & | oldValue = QVariant() |
||
) |
Changes an attribute value (but does not commit it)
fid | The feature id of the feature to be changed |
field | The index of the field to be updated |
newValue | The value which will be assigned to the field |
oldValue | The previous value to restore on undo (will otherwise be retrieved) |
Definition at line 2058 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::changeGeometry | ( | QgsFeatureId | fid, |
QgsGeometry * | geom | ||
) |
change feature's geometry
Definition at line 2039 of file qgsvectorlayer.cpp.
|
slot |
Check if there is a join with a layer that will be removed.
Definition at line 2831 of file qgsvectorlayer.cpp.
void QgsVectorLayer::clearAttributeEditorWidgets | ( | ) |
Clears all the tabs for the attribute editor form.
Definition at line 3699 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::commitChanges | ( | ) |
Attempts to commit any changes to disk.
Returns the result of the attempt. If a commit fails, the in-memory changes are left alone.
This allows editing to continue if the commit failed on e.g. a disallowed value in a Postgres database - the user can re-edit and try again.
The commits occur in distinct stages, (add attributes, add features, change attribute values, change geometries, delete features, delete attributes) so if a stage fails, it's difficult to roll back cleanly. Therefore any error message also includes which stage failed so that the user has some chance of repairing the damage cleanly.
Definition at line 2232 of file qgsvectorlayer.cpp.
const QStringList & QgsVectorLayer::commitErrors | ( | ) |
Definition at line 2277 of file qgsvectorlayer.cpp.
|
signal |
|
signal |
Signals emitted after committing changes.
|
signal |
|
signal |
|
signal |
|
signal |
bool QgsVectorLayer::countSymbolFeatures | ( | bool | showProgress = true | ) |
Count features for symbols.
Feature counts may be get by featureCount( QgsSymbolV2*).
showProgress | show progress dialog |
Definition at line 731 of file qgsvectorlayer.cpp.
void QgsVectorLayer::createJoinCaches | ( | ) |
Caches joined attributes if required (and not already done)
Definition at line 2887 of file qgsvectorlayer.cpp.
|
overridevirtual |
Return new instance of QgsMapLayerRenderer that will be used for rendering of given context.
Reimplemented from QgsMapLayer.
Definition at line 403 of file qgsvectorlayer.cpp.
QString QgsVectorLayer::dataComment | ( | ) | const |
Returns a comment for the data in the layer.
Definition at line 235 of file qgsvectorlayer.cpp.
QgsVectorDataProvider * QgsVectorLayer::dataProvider | ( | ) |
Returns the data provider.
Definition at line 567 of file qgsvectorlayer.cpp.
const QgsVectorDataProvider * QgsVectorLayer::dataProvider | ( | ) | const |
Returns the data provider in a const-correct manner.
Definition at line 572 of file qgsvectorlayer.cpp.
QString QgsVectorLayer::dateFormat | ( | int | idx | ) |
Access date format.
Definition at line 2701 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::deleteAttribute | ( | int | attr | ) |
delete an attribute field (but does not commit it)
Definition at line 2150 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::deleteAttributes | ( | QList< int > | attrs | ) |
Deletes a list of attribute fields (but does not commit it)
attrs | the indices of the attributes to delete |
Definition at line 2167 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::deleteFeature | ( | QgsFeatureId | fid | ) |
delete a feature from the layer (but does not commit it)
Definition at line 2187 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::deleteSelectedFeatures | ( | int * | deletedCount = 0 | ) |
Deletes the selected features.
Definition at line 1036 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::deleteVertex | ( | QgsFeatureId | atFeatureId, |
int | atVertex | ||
) |
Deletes a vertex from a feature.
Definition at line 1026 of file qgsvectorlayer.cpp.
|
slot |
Deselect feature by its ID.
featureId | The id of the feature to deselect |
Definition at line 444 of file qgsvectorlayer.cpp.
|
slot |
Deselect features by their ID.
featureIds | The ids of the features to deselect |
Definition at line 451 of file qgsvectorlayer.cpp.
void QgsVectorLayer::destroyEditCommand | ( | ) |
Destroy active command and reverts all changes in it.
Definition at line 2798 of file qgsvectorlayer.cpp.
|
inline |
Definition at line 774 of file qgsvectorlayer.h.
|
inline |
Definition at line 771 of file qgsvectorlayer.h.
const QString QgsVectorLayer::displayExpression | ( | ) |
Get the preview expression, used to create a human readable preview string.
Uses QgsExpression
Definition at line 2583 of file qgsvectorlayer.cpp.
const QString QgsVectorLayer::displayField | ( | ) | const |
Returns the primary display field name used in the identify results dialog.
Definition at line 2573 of file qgsvectorlayer.cpp.
|
overridevirtual |
Draws the layer.
Reimplemented from QgsMapLayer.
Definition at line 408 of file qgsvectorlayer.cpp.
|
overridevirtual |
Draws the layer labels using coordinate transformation.
Reimplemented from QgsMapLayer.
Definition at line 333 of file qgsvectorlayer.cpp.
|
static |
Draws a vertex symbol at (screen) coordinates x, y.
(Useful to assist vertex editing.)
Definition at line 414 of file qgsvectorlayer.cpp.
|
inline |
Buffer with uncommitted editing operations. Only valid after editing has been turned on.
Definition at line 1409 of file qgsvectorlayer.h.
|
signal |
Signal emitted, whan an edit command is destroyed.
|
signal |
Signal emitted, when an edit command successfully ended.
|
signal |
Signal emitted when a new edit command has been started.
text | Description for this edit command |
QString QgsVectorLayer::editForm | ( | ) |
get edit form
Definition at line 2653 of file qgsvectorlayer.cpp.
QString QgsVectorLayer::editFormInit | ( | ) |
get python function for edit form initialization
Definition at line 2676 of file qgsvectorlayer.cpp.
|
signal |
Is emitted, when editing on this layer has started.
|
signal |
Is emitted, when edited changes successfully have been written to the data provider.
QgsVectorLayer::EditorLayout QgsVectorLayer::editorLayout | ( | ) |
get the active layout for the attribute editor for this layer
Definition at line 2633 of file qgsvectorlayer.cpp.
const QString QgsVectorLayer::editorWidgetV2 | ( | int | fieldIdx | ) | const |
Get the id for the editor widget used to represent the field at the given index.
fieldIdx | The index of the field |
Definition at line 2103 of file qgsvectorlayer.cpp.
const QString QgsVectorLayer::editorWidgetV2 | ( | const QString & | fieldName | ) | const |
Get the id for the editor widget used to represent the field at the given index.
fieldName | The name of the field |
Definition at line 2111 of file qgsvectorlayer.cpp.
const QgsEditorWidgetConfig QgsVectorLayer::editorWidgetV2Config | ( | int | fieldIdx | ) | const |
Get the configuration for the editor widget used to represent the field at the given index.
fieldIdx | The index of the field |
Definition at line 2116 of file qgsvectorlayer.cpp.
const QgsEditorWidgetConfig QgsVectorLayer::editorWidgetV2Config | ( | const QString & | fieldName | ) | const |
Get the configuration for the editor widget used to represent the field at the given index.
fieldName | The name of the field |
Definition at line 2121 of file qgsvectorlayer.cpp.
QgsVectorLayer::EditType QgsVectorLayer::editType | ( | int | idx | ) |
Get edit type.
Definition at line 2614 of file qgsvectorlayer.cpp.
void QgsVectorLayer::enableLabels | ( | bool | on | ) |
Set labels on.
Definition at line 1199 of file qgsvectorlayer.cpp.
void QgsVectorLayer::endEditCommand | ( | ) |
Finish edit command and add it to undo/redo stack.
Definition at line 2785 of file qgsvectorlayer.cpp.
|
inline |
Definition at line 1214 of file qgsvectorlayer.h.
|
inline |
Definition at line 1211 of file qgsvectorlayer.h.
|
overridevirtual |
Return the extent of the layer as a QRect.
Reimplemented from QgsMapLayer.
Definition at line 812 of file qgsvectorlayer.cpp.
|
signal |
QPainter::CompositionMode QgsVectorLayer::featureBlendMode | ( | ) | const |
Read blend mode for layer.
Definition at line 3118 of file qgsvectorlayer.cpp.
|
signal |
Signal emitted when setFeatureBlendMode() is called.
|
virtual |
Number of features in the layer.
This is necessary if features are added/deleted or the layer has been subsetted. If the data provider chooses not to support this feature, the total number of features can be returned.
Definition at line 714 of file qgsvectorlayer.cpp.
long QgsVectorLayer::featureCount | ( | QgsSymbolV2 * | symbol | ) |
Number of features rendered with specified symbol.
Features must be first calculated by countSymbolFeatures()
symbol | the symbol |
Definition at line 725 of file qgsvectorlayer.cpp.
|
signal |
|
inline |
Type of feature form pop-up suppression after feature creation (overrides app setting)
Definition at line 1340 of file qgsvectorlayer.h.
bool QgsVectorLayer::fieldEditable | ( | int | idx | ) |
is edit widget editable
Definition at line 2712 of file qgsvectorlayer.cpp.
int QgsVectorLayer::fieldNameIndex | ( | const QString & | fieldName | ) | const |
Returns the index of a field name or -1 if the field does not exist.
Definition at line 2821 of file qgsvectorlayer.cpp.
|
signal |
QGis::GeometryType QgsVectorLayer::geometryType | ( | ) | const |
Returns point, line or polygon.
Definition at line 592 of file qgsvectorlayer.cpp.
QgsFeatureIterator QgsVectorLayer::getFeatures | ( | const QgsFeatureRequest & | request = QgsFeatureRequest() | ) |
Query the provider for features specified in request.
Definition at line 939 of file qgsvectorlayer.cpp.
|
virtual |
Will return the named style corresponding to style id provided.
Definition at line 3772 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::hasGeometryType | ( | ) | const |
Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeometry.
Definition at line 643 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::hasLabelsEnabled | ( | void | ) | const |
Label is on.
Definition at line 1204 of file qgsvectorlayer.cpp.
int QgsVectorLayer::insertSegmentVerticesForSnap | ( | const QList< QgsSnappingResult > & | snapResults | ) |
Inserts vertices to the snapped segments.
This is useful for topological editing if snap to segment is enabled.
snapResults | results collected from the snapping operation |
Definition at line 2545 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::insertVertex | ( | double | x, |
double | y, | ||
QgsFeatureId | atFeatureId, | ||
int | beforeVertex | ||
) |
Insert a new vertex before the given vertex number, in the given ring, item (first number is index 0), and feature Not meaningful for Point geometries.
Definition at line 1006 of file qgsvectorlayer.cpp.
|
protectedslot |
Definition at line 3634 of file qgsvectorlayer.cpp.
void QgsVectorLayer::invertSelection | ( | ) |
Select not selected features and deselect selected ones.
Definition at line 501 of file qgsvectorlayer.cpp.
void QgsVectorLayer::invertSelectionInRectangle | ( | QgsRectangle & | rect | ) |
Invert selection of features found within the search rectangle (in layer's coordinates)
rect | The rectangle in which the selection of features will be inverted |
Definition at line 530 of file qgsvectorlayer.cpp.
|
overridevirtual |
Returns true if the provider is in editing mode.
Reimplemented from QgsMapLayer.
Definition at line 2588 of file qgsvectorlayer.cpp.
|
virtual |
Returns true if the provider has been modified since the last commit.
Definition at line 2608 of file qgsvectorlayer.cpp.
|
virtual |
Returns true if the provider is in read-only mode.
Definition at line 2593 of file qgsvectorlayer.cpp.
QgsLabel * QgsVectorLayer::label | ( | ) |
Get the label object associated with this layer.
Definition at line 1189 of file qgsvectorlayer.cpp.
const QgsLabel * QgsVectorLayer::label | ( | ) | const |
Definition at line 1194 of file qgsvectorlayer.cpp.
|
signal |
Emitted when the font family defined for labeling layer is not found on system.
bool QgsVectorLayer::labelOnTop | ( | int | idx | ) |
label widget on top
Definition at line 2726 of file qgsvectorlayer.cpp.
|
signal |
|
signal |
This signal is emitted when modifications has been done on layer.
int QgsVectorLayer::layerTransparency | ( | ) | const |
Read transparency for layer.
Definition at line 3131 of file qgsvectorlayer.cpp.
|
signal |
Signal emitted when setLayerTransparency() is called.
|
virtual |
Lists all the style in db split into related to the layer and not related to.
ids | the list in which will be stored the style db ids |
names | the list in which will be stored the style names |
descriptions | the list in which will be stored the style descriptions |
msgError |
Definition at line 3751 of file qgsvectorlayer.cpp.
|
virtual |
Load a named style from file/local db/datasource db.
theURI | the URI of the style or the URI of the layer |
theResultFlag | will be set to true if a named style is correctly loaded |
loadFromLocalDb | if true forces to load from local db instead of datasource one |
Definition at line 3841 of file qgsvectorlayer.cpp.
|
overridevirtual |
Calls loadNamedStyle( theURI, theResultFlag, false ); Retained for backward compatibility.
Reimplemented from QgsMapLayer.
Definition at line 3836 of file qgsvectorlayer.cpp.
QVariant QgsVectorLayer::maximumValue | ( | int | index | ) |
Returns maximum value for an attribute column or invalid variant in case of error.
Definition at line 3048 of file qgsvectorlayer.cpp.
|
overridevirtual |
Obtain Metadata for this layer.
Reimplemented from QgsMapLayer.
Definition at line 3380 of file qgsvectorlayer.cpp.
QVariant QgsVectorLayer::minimumValue | ( | int | index | ) |
Returns minimum value for an attribute column or invalid variant in case of error.
Definition at line 2986 of file qgsvectorlayer.cpp.
void QgsVectorLayer::modifySelection | ( | QgsFeatureIds | selectIds, |
QgsFeatureIds | deselectIds | ||
) |
Modifies the current selection on this layer.
selectIds | Select these ids |
deselectIds | Deselect these ids |
Definition at line 487 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::moveVertex | ( | double | x, |
double | y, | ||
QgsFeatureId | atFeatureId, | ||
int | atVertex | ||
) |
Moves the vertex at the given position number, ring and item (first number is index 0), and feature to the given coordinates.
Definition at line 1016 of file qgsvectorlayer.cpp.
QgsAttributeList QgsVectorLayer::pendingAllAttributesList | ( | ) |
returns list of attributes
Definition at line 2206 of file qgsvectorlayer.cpp.
int QgsVectorLayer::pendingFeatureCount | ( | ) |
returns feature count after commit
Definition at line 2226 of file qgsvectorlayer.cpp.
const QgsFields & QgsVectorLayer::pendingFields | ( | ) | const |
returns field list in the to-be-committed state
Definition at line 2201 of file qgsvectorlayer.cpp.
QgsAttributeList QgsVectorLayer::pendingPkAttributesList | ( | ) |
returns list of attribute making up the primary key
Definition at line 2211 of file qgsvectorlayer.cpp.
QString QgsVectorLayer::providerType | ( | ) | const |
Return the provider type for this layer.
Definition at line 245 of file qgsvectorlayer.cpp.
QgsVectorLayer::RangeData QgsVectorLayer::range | ( | int | idx | ) |
Access range widget config data.
Definition at line 2691 of file qgsvectorlayer.cpp.
|
signal |
Signal emitted whenever the symbology (QML-file) for this layer is being read.
If there is custom style information saved in the file, you can connect to this signal and update the layer style accordingly.
element | The XML layer style element. |
errorMessage | Write error messages into this string. |
|
overridevirtual |
Reimplemented from QgsMapLayer.
Definition at line 1998 of file qgsvectorlayer.cpp.
|
overridevirtual |
Read the symbology for the current layer from the Dom node supplied.
node | node that will contain the symbology definition for this layer. |
errorMessage | reference to string that will be updated with any error messages |
Implements QgsMapLayer.
Definition at line 1513 of file qgsvectorlayer.cpp.
|
overridevirtual |
reads vector layer specific state from project file Dom node.
Reimplemented from QgsMapLayer.
Definition at line 1274 of file qgsvectorlayer.cpp.
QList< QgsRelation > QgsVectorLayer::referencingRelations | ( | int | idx | ) |
Get relations, where the foreign key is on this layer.
idx | Only get relations, where idx forms part of the foreign key |
Definition at line 3689 of file qgsvectorlayer.cpp.
|
overridevirtual |
Synchronises with changes in the datasource.
Reimplemented from QgsMapLayer.
Definition at line 395 of file qgsvectorlayer.cpp.
void QgsVectorLayer::remAttributeAlias | ( | int | attIndex | ) |
Removes an alias (a display name) for attributes to display in dialogs.
Definition at line 2074 of file qgsvectorlayer.cpp.
void QgsVectorLayer::removeExpressionField | ( | int | index | ) |
Remove an expression field.
index | The index of the field |
Definition at line 2854 of file qgsvectorlayer.cpp.
void QgsVectorLayer::removeJoin | ( | const QString & | joinLayerId | ) |
Removes a vector layer join.
Definition at line 2836 of file qgsvectorlayer.cpp.
int QgsVectorLayer::removePolygonIntersections | ( | QgsGeometry * | geom, |
QgsFeatureIds | ignoreFeatures = QgsFeatureIds() |
||
) |
Changes the specified geometry such that it has no intersections with other polygon (or multipolygon) geometries in this vector layer.
geom | geometry to modify |
ignoreFeatures | list of feature ids where intersections should be ignored |
Definition at line 1127 of file qgsvectorlayer.cpp.
|
slot |
Clear selection.
Definition at line 559 of file qgsvectorlayer.cpp.
QgsFeatureRendererV2 * QgsVectorLayer::rendererV2 | ( | ) |
Return renderer V2.
Definition at line 2749 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::rollBack | ( | bool | deleteBuffer = true | ) |
Stop editing and discard the edits.
deleteBuffer | whether to delete editing buffer |
Definition at line 2282 of file qgsvectorlayer.cpp.
|
signal |
|
virtual |
Save named and sld style of the layer to the style table in the db.
name | |
description | |
useAsDefault | |
uiFileContent | |
msgError |
Definition at line 3794 of file qgsvectorlayer.cpp.
void QgsVectorLayer::select | ( | QgsRectangle & | rect, |
bool | addToSelection | ||
) |
Select features found within the search rectangle (in layer's coordinates)
rect | The search rectangle |
addToSelection | If set to true will not clear before selecting |
Definition at line 458 of file qgsvectorlayer.cpp.
|
slot |
Select feature by its ID.
featureId | The id of the feature to select |
Definition at line 430 of file qgsvectorlayer.cpp.
|
slot |
Select features by their ID.
featureIds | The ids of the features to select |
Definition at line 437 of file qgsvectorlayer.cpp.
void QgsVectorLayer::selectAll | ( | ) |
Select all the features.
Definition at line 508 of file qgsvectorlayer.cpp.
int QgsVectorLayer::selectedFeatureCount | ( | ) |
The number of features that are selected in this layer.
Definition at line 2328 of file qgsvectorlayer.cpp.
QgsFeatureList QgsVectorLayer::selectedFeatures | ( | ) |
Get a copy of the user-selected features.
Definition at line 2338 of file qgsvectorlayer.cpp.
const QgsFeatureIds & QgsVectorLayer::selectedFeaturesIds | ( | ) | const |
Return reference to identifiers of selected features.
Definition at line 2333 of file qgsvectorlayer.cpp.
QgsFeatureIterator QgsVectorLayer::selectedFeaturesIterator | ( | QgsFeatureRequest | request = QgsFeatureRequest() | ) |
Get an iterator of the selected features.
request | You may specify a request, e.g. to limit the set of requested attributes. Any filter on the request will be discarded. |
Definition at line 2366 of file qgsvectorlayer.cpp.
|
signal |
This signal is emitted when selection was changed.
selected | Newly selected feature ids |
deselected | Ids of all features which have previously been selected but are not any more |
clearAndSelect | In case this is set to true, the old selection was dismissed and the new selection corresponds to selected |
|
signal |
This signal is emitted when selection was changed.
void QgsVectorLayer::setAnnotationForm | ( | const QString & | ui | ) |
set annotation form for layer
Definition at line 2671 of file qgsvectorlayer.cpp.
void QgsVectorLayer::setCheckedState | ( | int | idx, |
QString | checked, | ||
QString | notChecked | ||
) |
Set string representing 'true' for a checkbox.
Definition at line 2813 of file qgsvectorlayer.cpp.
void QgsVectorLayer::setCoordinateSystem | ( | ) |
Setup the coordinate system transformation for the layer.
Definition at line 2552 of file qgsvectorlayer.cpp.
void QgsVectorLayer::setDiagramLayerSettings | ( | const QgsDiagramLayerSettings & | s | ) |
Definition at line 3373 of file qgsvectorlayer.cpp.
void QgsVectorLayer::setDiagramRenderer | ( | QgsDiagramRendererV2 * | r | ) |
Sets diagram rendering object (takes ownership)
Definition at line 586 of file qgsvectorlayer.cpp.
void QgsVectorLayer::setDisplayExpression | ( | const QString & | displayExpression | ) |
Set the preview expression, used to create a human readable preview string.
Used e.g. in the attribute table feature list. Uses QgsExpression.
displayExpression | The expression which will be used to preview features for this layer |
Definition at line 2578 of file qgsvectorlayer.cpp.
void QgsVectorLayer::setDisplayField | ( | QString | fldName = "" | ) |
Set the primary display field to be used in the identify results dialog.
sets the preferred display field based on some fuzzy logic
Definition at line 253 of file qgsvectorlayer.cpp.
void QgsVectorLayer::setEditForm | ( | QString | ui | ) |
set edit form
Definition at line 2658 of file qgsvectorlayer.cpp.
void QgsVectorLayer::setEditFormInit | ( | QString | function | ) |
set python function for edit form initialization
Definition at line 2681 of file qgsvectorlayer.cpp.
void QgsVectorLayer::setEditorLayout | ( | EditorLayout | editorLayout | ) |
set the active layout for the attribute editor for this layer
Definition at line 2638 of file qgsvectorlayer.cpp.
void QgsVectorLayer::setEditorWidgetV2 | ( | int | attrIdx, |
const QString & | widgetType | ||
) |
Set the editor widget type for a field.
QGIS ships the following widget types, additional types may be available depending on plugins.
attrIdx | Index of the field |
widgetType | Type id of the editor widget to use |
Definition at line 2643 of file qgsvectorlayer.cpp.
void QgsVectorLayer::setEditorWidgetV2Config | ( | int | attrIdx, |
const QgsEditorWidgetConfig & | config | ||
) |
Set the editor widget config for a field.
Python: Will accept a map.
Example:
attrIdx | Index of the field |
config | The config to set for this field |
Definition at line 2648 of file qgsvectorlayer.cpp.
void QgsVectorLayer::setEditType | ( | int | idx, |
EditType | edit | ||
) |
Get edit type.
Definition at line 2621 of file qgsvectorlayer.cpp.
|
inline |
Definition at line 1215 of file qgsvectorlayer.h.
|
inline |
Definition at line 1212 of file qgsvectorlayer.h.
|
overrideprotectedvirtual |
void QgsVectorLayer::setFeatureBlendMode | ( | const QPainter::CompositionMode & | blendMode | ) |
Write blend mode for features.
Definition at line 3111 of file qgsvectorlayer.cpp.
|
inline |
Set type of feature form pop-up suppression after feature creation (overrides app setting)
Definition at line 1344 of file qgsvectorlayer.h.
void QgsVectorLayer::setFieldEditable | ( | int | idx, |
bool | editable | ||
) |
set edit widget editable
Definition at line 2735 of file qgsvectorlayer.cpp.
void QgsVectorLayer::setLabelOnTop | ( | int | idx, |
bool | onTop | ||
) |
label widget on top
Definition at line 2742 of file qgsvectorlayer.cpp.
void QgsVectorLayer::setLayerTransparency | ( | int | layerTransparency | ) |
Write transparency for layer.
Definition at line 3124 of file qgsvectorlayer.cpp.
void QgsVectorLayer::setProviderEncoding | ( | const QString & | encoding | ) |
Sets the textencoding of the data provider.
Definition at line 577 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::setReadOnly | ( | bool | readonly = true | ) |
Make layer read-only (editing disabled) or not.
Definition at line 2598 of file qgsvectorlayer.cpp.
void QgsVectorLayer::setRendererV2 | ( | QgsFeatureRendererV2 * | r | ) |
Set renderer V2.
Definition at line 2754 of file qgsvectorlayer.cpp.
void QgsVectorLayer::setSelectedFeatures | ( | const QgsFeatureIds & | ids | ) |
Change selection to the new set of features.
Dismisses the current selection. Will emit the selectionChanged( QgsFeatureIds, QgsFeatureIds, bool ) signal with the clearAndSelect flag set.
ids | The ids which will be the new selection |
Definition at line 2319 of file qgsvectorlayer.cpp.
|
inline |
Set the simplification settings for fast rendering of features.
Definition at line 1473 of file qgsvectorlayer.h.
|
virtual |
Set the string (typically sql) used to define a subset of the layer.
subset | The subset string. This may be the where clause of a sql statement or other defintion string specific to the underlying dataprovider and data store. |
Definition at line 904 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::simplifyDrawingCanbeApplied | ( | const QgsRenderContext & | renderContext, |
QgsVectorSimplifyMethod::SimplifyHint | simplifyHint | ||
) | const |
Returns whether the VectorLayer can apply the specified simplification hint.
Definition at line 924 of file qgsvectorlayer.cpp.
|
inline |
Returns the simplification settings for fast rendering of features.
Definition at line 1477 of file qgsvectorlayer.h.
bool QgsVectorLayer::snapPoint | ( | QgsPoint & | point, |
double | tolerance | ||
) |
Snaps a point to the closest vertex if there is one within the snapping tolerance.
point | The point which is set to the position of a vertex if there is one within the snapping tolerance. If there is no point within this tolerance, point is left unchanged. |
tolerance | The snapping tolerance |
Definition at line 2405 of file qgsvectorlayer.cpp.
int QgsVectorLayer::snapWithContext | ( | const QgsPoint & | startPoint, |
double | snappingTolerance, | ||
QMultiMap< double, QgsSnappingResult > & | snappingResults, | ||
QgsSnapper::SnappingType | snap_to | ||
) |
Snaps to segment or vertex within given tolerance.
startPoint | point to snap (in layer coordinates) |
snappingTolerance | distance tolerance for snapping |
snappingResults | snapping results. Key is the distance between startPoint and snapping target |
snap_to | to segment / to vertex |
Definition at line 2430 of file qgsvectorlayer.cpp.
int QgsVectorLayer::splitFeatures | ( | const QList< QgsPoint > & | splitLine, |
bool | topologicalEditing = false |
||
) |
Splits features cut by the given line.
splitLine | line that splits the layer features |
topologicalEditing | true if topological editing is enabled |
Definition at line 1118 of file qgsvectorlayer.cpp.
int QgsVectorLayer::splitParts | ( | const QList< QgsPoint > & | splitLine, |
bool | topologicalEditing = false |
||
) |
Splits parts cut by the given line.
splitLine | line that splits the layer features |
topologicalEditing | true if topological editing is enabled |
Definition at line 1109 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::startEditing | ( | ) |
Make layer editable.
Definition at line 1209 of file qgsvectorlayer.cpp.
QString QgsVectorLayer::storageType | ( | ) | const |
Returns the permanent storage type for this layer as a friendly name.
Definition at line 216 of file qgsvectorlayer.cpp.
|
virtual |
Get the string (typically sql) used to define a subset of the layer.
Definition at line 894 of file qgsvectorlayer.cpp.
int QgsVectorLayer::translateFeature | ( | QgsFeatureId | featureId, |
double | dx, | ||
double | dy | ||
) |
Translates feature by dx, dy.
featureId | id of the feature to translate |
dx | translation of x-coordinate |
dy | translation of y-coordinate |
Definition at line 1100 of file qgsvectorlayer.cpp.
void QgsVectorLayer::uniqueValues | ( | int | index, |
QList< QVariant > & | uniqueValues, | ||
int | limit = -1 |
||
) |
Returns unique values for column.
index | column index for attribute |
uniqueValues | out: result list |
limit | maximum number of values to return (-1 if unlimited) |
Definition at line 2895 of file qgsvectorlayer.cpp.
|
signal |
Is emitted, whenever the fields available from this layer have been changed.
This can be due to manually adding attributes or due to a join.
|
virtualslot |
Update the extents for the layer.
This is necessary if features are added/deleted or the layer has been subsetted.
Definition at line 801 of file qgsvectorlayer.cpp.
bool QgsVectorLayer::updateFeature | ( | QgsFeature & | f | ) |
Updates an existing feature.
This method needs to query the datasource on every call. Consider using changeAttributeValue() or changeGeometry() instead.
f | Feature to update |
Definition at line 962 of file qgsvectorlayer.cpp.
void QgsVectorLayer::updateFields | ( | ) |
Assembles mUpdatedFields considering provider fields, joined fields and added fields.
Definition at line 2862 of file qgsvectorlayer.cpp.
QMap< QString, QVariant > QgsVectorLayer::valueMap | ( | int | idx | ) |
Access value map.
Definition at line 2686 of file qgsvectorlayer.cpp.
QgsVectorLayer::ValueRelationData QgsVectorLayer::valueRelation | ( | int | idx | ) |
Access value relation widget data.
Definition at line 3668 of file qgsvectorlayer.cpp.
const QList< QgsVectorJoinInfo > & QgsVectorLayer::vectorJoins | ( | ) | const |
Definition at line 2841 of file qgsvectorlayer.cpp.
QSize QgsVectorLayer::widgetSize | ( | int | idx | ) |
Access widget size for photo and webview widget.
Definition at line 2706 of file qgsvectorlayer.cpp.
QGis::WkbType QgsVectorLayer::wkbType | ( | ) | const |
Returns the WKBType or WKBUnknown in case of error.
Definition at line 649 of file qgsvectorlayer.cpp.
|
signal |
Signal emitted whenever the symbology (QML-file) for this layer is being written.
If there is custom style information you want to save to the file, you can connect to this signal and update the element accordingly.
element | The XML element where you can add additional style information to. |
doc | The XML document that you can use to create new XML nodes. |
errorMessage | Write error messages into this string. |
bool QgsVectorLayer::writeSld | ( | QDomNode & | node, |
QDomDocument & | doc, | ||
QString & | errorMessage | ||
) | const |
Definition at line 2022 of file qgsvectorlayer.cpp.
|
overridevirtual |
Write the symbology for the layer into the docment provided.
node | the node that will have the style element added to it. |
doc | the document that will have the QDomNode added. |
errorMessage | reference to string that will be updated with any error messages |
Implements QgsMapLayer.
Definition at line 1795 of file qgsvectorlayer.cpp.
|
overridevirtual |
write vector layer specific state to project file Dom node.
Reimplemented from QgsMapLayer.
Definition at line 1466 of file qgsvectorlayer.cpp.
|
friend |
Definition at line 1805 of file qgsvectorlayer.h.
|
friend |
Definition at line 1828 of file qgsvectorlayer.h.