QGIS API Documentation  2.3.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | Friends | List of all members
QgsVectorLayer Class Reference

Represents a vector layer which manages a vector based data sets. More...

#include <qgsvectorlayer.h>

Inheritance diagram for QgsVectorLayer:
Inheritance graph
[legend]
Collaboration diagram for QgsVectorLayer:
Collaboration graph
[legend]

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 select (const QgsFeatureId &featureId)
 Select feature by its ID. More...
 
void select (const QgsFeatureIds &featureIds)
 Select features by their ID. More...
 
void deselect (const QgsFeatureId featureId)
 Deselect feature by its ID. More...
 
void deselect (const QgsFeatureIds &featureIds)
 Deselect features by their ID. More...
 
void removeSelection ()
 Clear selection. More...
 
void triggerRepaint ()
 
virtual void updateExtents ()
 Update the extents for the layer. More...
 
void checkJoinLayerRemove (QString theLayerId)
 Check if there is a join with a layer that will be removed. More...
 
- Public Slots inherited from QgsMapLayer
virtual void invalidTransformInput ()
 Event handler for when a coordinate transform fails due to bad vertex error. More...
 
void setMinimumScale (float theMinScale)
 Accessor and mutator for the minimum scale denominator member. More...
 
float minimumScale () const
 
void setMaximumScale (float theMaxScale)
 Accessor and mutator for the maximum scale denominator member. More...
 
float maximumScale () const
 
void toggleScaleBasedVisibility (bool theVisibilityFlag)
 Accessor and mutator for the scale based visilibility flag. More...
 
bool hasScaleBasedVisibility () const
 
Q_DECL_DEPRECATED void clearCacheImage ()
 Clear cached image. More...
 
virtual QDateTime timestamp () const
 Time stamp of data source in the moment when data/metadata were loaded by provider. More...
 

Signals

void selectionChanged (const QgsFeatureIds selected, const QgsFeatureIds deselected, const bool clearAndSelect)
 This signal is emitted when selection was changed. More...
 
void selectionChanged ()
 This signal is emitted when selection was changed. More...
 
void layerModified ()
 This signal is emitted when modifications has been done on layer. More...
 
void editingStarted ()
 Is emitted, when editing on this layer has started. More...
 
void editingStopped ()
 Is emitted, when edited changes successfully have been written to the data provider. More...
 
void beforeCommitChanges ()
 Is emitted, before changes are commited to the data provider. More...
 
void beforeRollBack ()
 Is emitted, before changes are rolled back. More...
 
void attributeAdded (int idx)
 Will be emitted, when a new attribute has been added to this vector layer. More...
 
void attributeDeleted (int idx)
 Will be emitted, when an attribute has been deleted from this vector layer. More...
 
void featureAdded (QgsFeatureId fid)
 
void featureDeleted (QgsFeatureId fid)
 
void updatedFields ()
 Is emitted, whenever the fields available from this layer have been changed. More...
 
void layerDeleted ()
 
void attributeValueChanged (QgsFeatureId fid, int idx, const QVariant &)
 
void geometryChanged (QgsFeatureId fid, QgsGeometry &geom)
 
void committedAttributesDeleted (const QString &layerId, const QgsAttributeList &deletedAttributes)
 Signals emitted after committing changes. More...
 
void committedAttributesAdded (const QString &layerId, const QList< QgsField > &addedAttributes)
 
void committedFeaturesAdded (const QString &layerId, const QgsFeatureList &addedFeatures)
 
void committedFeaturesRemoved (const QString &layerId, const QgsFeatureIds &deletedFeatureIds)
 
void committedAttributeValuesChanges (const QString &layerId, const QgsChangedAttributesMap &changedAttributesValues)
 
void committedGeometriesChanges (const QString &layerId, const QgsGeometryMap &changedGeometries)
 
void saveLayerToProject ()
 
void labelingFontNotFound (QgsVectorLayer *layer, const QString &fontfamily)
 Emitted when the font family defined for labeling layer is not found on system. More...
 
void rendererChanged ()
 Signal emitted on symbology changes, when setRendererV2() is called. More...
 
void featureBlendModeChanged (const QPainter::CompositionMode &blendMode)
 Signal emitted when setFeatureBlendMode() is called. More...
 
void layerTransparencyChanged (int layerTransparency)
 Signal emitted when setLayerTransparency() is called. More...
 
void editCommandStarted (const QString &text)
 Signal emitted when a new edit command has been started. More...
 
void editCommandEnded ()
 Signal emitted, when an edit command successfully ended. More...
 
void editCommandDestroyed ()
 Signal emitted, whan an edit command is destroyed. More...
 
- Signals inherited from QgsMapLayer
void drawingProgress (int theProgress, int theTotalSteps)
 
void statusChanged (QString theStatus)
 Emit a signal with status (e.g. More...
 
void layerNameChanged ()
 Emit a signal that the layer name has been changed. More...
 
void layerCrsChanged ()
 Emit a signal that layer's CRS has been reset added in 1.4. More...
 
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. More...
 
void screenUpdateRequested ()
 
void recalculateExtents ()
 This is used to send a request that any mapcanvas using this layer update its extents. More...
 
void dataChanged ()
 data of layer changed added in 1.5 More...
 
void blendModeChanged (const QPainter::CompositionMode &blendMode)
 Signal emitted when the blend mode is changed, through QgsMapLayer::setBlendMode() More...
 

Public Member Functions

 QgsVectorLayer (QString path=QString::null, QString baseName=QString::null, QString providerLib=QString::null, bool loadDefaultStyleFlag=true)
 Constructor - creates a vector layer. More...
 
virtual ~QgsVectorLayer ()
 Destructor. More...
 
QString storageType () const
 Returns the permanent storage type for this layer as a friendly name. More...
 
QString capabilitiesString () const
 Capabilities for this layer in a friendly format. More...
 
QString dataComment () const
 Returns a comment for the data in the layer. More...
 
void setDisplayField (QString fldName="")
 Set the primary display field to be used in the identify results dialog. More...
 
const QString displayField () const
 Returns the primary display field name used in the identify results dialog. More...
 
void setDisplayExpression (const QString &displayExpression)
 Set the preview expression, used to create a human readable preview string. More...
 
const QString displayExpression ()
 Get the preview expression, used to create a human readable preview string. More...
 
QgsVectorDataProviderdataProvider ()
 Returns the data provider. More...
 
const QgsVectorDataProviderdataProvider () const
 Returns the data provider in a const-correct manner. More...
 
void setProviderEncoding (const QString &encoding)
 Sets the textencoding of the data provider. More...
 
void setCoordinateSystem ()
 Setup the coordinate system tranformation for the layer. More...
 
void addJoin (const QgsVectorJoinInfo &joinInfo)
 Joins another vector layer to this layer. More...
 
void removeJoin (const QString &joinLayerId)
 Removes a vector layer join. More...
 
const QList< QgsVectorJoinInfo > & vectorJoins () const
 
QgsLabellabel ()
 Get the label object associated with this layer. More...
 
const QgsLabellabel () const
 
QgsAttributeActionactions ()
 
int selectedFeatureCount ()
 The number of features that are selected in this layer. More...
 
void select (QgsRectangle &rect, bool addToSelection)
 Select features found within the search rectangle (in layer's coordinates) More...
 
void modifySelection (QgsFeatureIds selectIds, QgsFeatureIds deselectIds)
 Modifies the current selection on this layer. More...
 
void invertSelection ()
 Select not selected features and deselect selected ones. More...
 
void selectAll ()
 Select all the features. More...
 
QgsFeatureIds allFeatureIds ()
 Get all feature Ids. More...
 
void invertSelectionInRectangle (QgsRectangle &rect)
 Invert selection of features found within the search rectangle (in layer's coordinates) More...
 
QgsFeatureList selectedFeatures ()
 Get a copy of the user-selected features. More...
 
const QgsFeatureIdsselectedFeaturesIds () const
 Return reference to identifiers of selected features. More...
 
void setSelectedFeatures (const QgsFeatureIds &ids)
 Change selection to the new set of features. More...
 
QgsRectangle boundingBoxOfSelected ()
 Returns the bounding box of the selected features. More...
 
void setDiagramRenderer (QgsDiagramRendererV2 *r)
 Sets diagram rendering object (takes ownership) More...
 
const QgsDiagramRendererV2diagramRenderer () const
 
void setDiagramLayerSettings (const QgsDiagramLayerSettings &s)
 
const QgsDiagramLayerSettingsdiagramLayerSettings () const
 
QgsFeatureRendererV2rendererV2 ()
 Return renderer V2. More...
 
void setRendererV2 (QgsFeatureRendererV2 *r)
 Set renderer V2. More...
 
QGis::GeometryType geometryType () const
 Returns point, line or polygon. More...
 
bool hasGeometryType () const
 Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeometry. More...
 
QGis::WkbType wkbType () const
 Returns the WKBType or WKBUnknown in case of error. More...
 
QString providerType () const
 Return the provider type for this layer. More...
 
virtual bool readXml (const QDomNode &layer_node)
 reads vector layer specific state from project file Dom node. More...
 
virtual bool writeXml (QDomNode &layer_node, QDomDocument &doc)
 write vector layer specific state to project file Dom node. More...
 
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. More...
 
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. More...
 
virtual QString getStyleFromDatabase (QString styleId, QString &msgError)
 Will return the named style corresponding to style id provided. More...
 
virtual QString loadNamedStyle (const QString &theURI, bool &theResultFlag, bool loadFromLocalDb)
 Load a named style from file/local db/datasource db. More...
 
virtual QString loadNamedStyle (const QString &theURI, bool &theResultFlag)
 Calls loadNamedStyle( theURI, theResultFlag, false ); Retained for backward compatibility. More...
 
virtual bool applyNamedStyle (QString namedStyle, QString errorMsg)
 
QgsAttributeEditorElementattributeEditorElementFromDomElement (QDomElement &elem, QObject *parent)
 convert a saved attribute editor element into a AttributeEditor structure as it's used internally. More...
 
bool readSymbology (const QDomNode &node, QString &errorMessage)
 Read the symbology for the current layer from the Dom node supplied. More...
 
bool writeSymbology (QDomNode &node, QDomDocument &doc, QString &errorMessage) const
 Write the symbology for the layer into the docment provided. More...
 
bool writeSld (QDomNode &node, QDomDocument &doc, QString &errorMessage) const
 
bool readSld (const QDomNode &node, QString &errorMessage)
 
virtual long featureCount () const
 Number of features in the layer. More...
 
long featureCount (QgsSymbolV2 *symbol)
 Number of features rendered with specified symbol. More...
 
bool countSymbolFeatures (bool showProgress=true)
 Count features for symbols. More...
 
virtual bool setSubsetString (QString subset)
 Set the string (typically sql) used to define a subset of the layer. More...
 
virtual QString subsetString ()
 Get the string (typically sql) used to define a subset of the layer. More...
 
QgsFeatureIterator getFeatures (const QgsFeatureRequest &request=QgsFeatureRequest())
 Query the provider for features specified in request. More...
 
bool addFeature (QgsFeature &f, bool alsoUpdateExtent=true)
 Adds a feature. More...
 
bool updateFeature (QgsFeature &f)
 Updates an existing feature. More...
 
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. More...
 
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. More...
 
bool deleteVertex (QgsFeatureId atFeatureId, int atVertex)
 Deletes a vertex from a feature. More...
 
bool deleteSelectedFeatures ()
 Deletes the selected features. More...
 
int addRing (const QList< QgsPoint > &ring)
 Adds a ring to polygon/multipolygon features. More...
 
int addPart (const QList< QgsPoint > &ring)
 Adds a new part polygon to a multipart feature. More...
 
int translateFeature (QgsFeatureId featureId, double dx, double dy)
 Translates feature by dx, dy. More...
 
int splitParts (const QList< QgsPoint > &splitLine, bool topologicalEditing=false)
 Splits parts cut by the given line. More...
 
int splitFeatures (const QList< QgsPoint > &splitLine, bool topologicalEditing=false)
 Splits features cut by the given line. More...
 
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. More...
 
int addTopologicalPoints (QgsGeometry *geom)
 Adds topological points for every vertex of the geometry. More...
 
int addTopologicalPoints (const QgsPoint &p)
 Adds a vertex to segments which intersect point p but don't already have a vertex there. More...
 
int insertSegmentVerticesForSnap (const QList< QgsSnappingResult > &snapResults)
 Inserts vertices to the snapped segments. More...
 
void enableLabels (bool on)
 Set labels on. More...
 
bool hasLabelsEnabled () const
 Label is on. More...
 
virtual bool isEditable () const
 Returns true if the provider is in editing mode. More...
 
virtual bool isReadOnly () const
 Returns true if the provider is in read-only mode. More...
 
virtual bool isModified () const
 Returns true if the provider has been modified since the last commit. More...
 
bool snapPoint (QgsPoint &point, double tolerance)
 Snaps a point to the closest vertex if there is one within the snapping tolerance. More...
 
int snapWithContext (const QgsPoint &startPoint, double snappingTolerance, QMultiMap< double, QgsSnappingResult > &snappingResults, QgsSnapper::SnappingType snap_to)
 Snaps to segment or vertex within given tolerance. More...
 
virtual void reload ()
 Synchronises with changes in the datasource. More...
 
virtual QgsMapLayerRenderercreateMapRenderer (QgsRenderContext &rendererContext)
 Return new instance of QgsMapLayerRenderer that will be used for rendering of given context. More...
 
bool draw (QgsRenderContext &rendererContext)
 Draws the layer. More...
 
void drawLabels (QgsRenderContext &rendererContext)
 Draws the layer labels using coordinate transformation. More...
 
QgsRectangle extent ()
 Return the extent of the layer as a QRect. More...
 
const QgsFieldspendingFields () const
 returns field list in the to-be-committed state More...
 
QgsAttributeList pendingAllAttributesList ()
 returns list of attributes More...
 
QgsAttributeList pendingPkAttributesList ()
 returns list of attribute making up the primary key More...
 
int pendingFeatureCount ()
 returns feature count after commit More...
 
bool setReadOnly (bool readonly=true)
 Make layer read-only (editing disabled) or not. More...
 
bool startEditing ()
 Make layer editable. More...
 
bool changeGeometry (QgsFeatureId fid, QgsGeometry *geom)
 change feature's geometry More...
 
Q_DECL_DEPRECATED bool changeAttributeValue (QgsFeatureId fid, int field, QVariant value, bool emitSignal)
 Changes an attribute value (but does not commit it) More...
 
bool changeAttributeValue (QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue=QVariant())
 Changes an attribute value (but does not commit it) More...
 
bool addAttribute (const QgsField &field)
 add an attribute field (but does not commit it) returns true if the field was added More...
 
void addAttributeAlias (int attIndex, QString aliasString)
 Sets an alias (a display name) for attributes to display in dialogs. More...
 
void addAttributeEditorWidget (QgsAttributeEditorElement *data)
 Adds a tab (for the attribute editor form) holding groups and fields. More...
 
const QString editorWidgetV2 (int fieldIdx)
 Get the id for the editor widget used to represent the field at the given index. More...
 
const QgsEditorWidgetConfig editorWidgetV2Config (int fieldIdx)
 Get the configuration for the editor widget used to represent the field at the given index. More...
 
QList
< QgsAttributeEditorElement * > & 
attributeEditorElements ()
 Returns a list of tabs holding groups and fields. More...
 
void clearAttributeEditorWidgets ()
 Clears all the tabs for the attribute editor form. More...
 
QString attributeAlias (int attributeIndex) const
 Returns the alias of an attribute name or an empty string if there is no alias. More...
 
QString attributeDisplayName (int attributeIndex) const
 Convenience function that returns the attribute alias if defined or the field name else. More...
 
const QMap< QString, QString > & attributeAliases () const
 
const QSet< QString > & excludeAttributesWMS () const
 
void setExcludeAttributesWMS (const QSet< QString > &att)
 
const QSet< QString > & excludeAttributesWFS () const
 
void setExcludeAttributesWFS (const QSet< QString > &att)
 
bool deleteAttribute (int attr)
 delete an attribute field (but does not commit it) More...
 
bool deleteAttributes (QList< int > attrs)
 Deletes a list of attribute fields (but does not commit it) More...
 
bool addFeatures (QgsFeatureList features, bool makeSelected=true)
 Insert a copy of the given features into the layer (but does not commit it) More...
 
bool deleteFeature (QgsFeatureId fid)
 delete a feature from the layer (but does not commit it) More...
 
bool commitChanges ()
 Attempts to commit any changes to disk. More...
 
const QStringList & commitErrors ()
 
bool rollBack (bool deleteBuffer=true)
 Stop editing and discard the edits. More...
 
EditType editType (int idx)
 get edit type More...
 
void setEditType (int idx, EditType edit)
 set edit type More...
 
EditorLayout editorLayout ()
 get the active layout for the attribute editor for this layer (added in 1.9) More...
 
void setEditorLayout (EditorLayout editorLayout)
 set the active layout for the attribute editor for this layer (added in 1.9) More...
 
void setEditorWidgetV2 (int attrIdx, const QString &widgetType)
 
void setEditorWidgetV2Config (int attrIdx, const QMap< QString, QVariant > &config)
 
void setCheckedState (int idx, QString checked, QString notChecked)
 set string representing 'true' for a checkbox (added in 1.4) More...
 
QPair< QString, QString > checkedState (int idx)
 return string representing 'true' for a checkbox (added in 1.4) More...
 
QString editForm ()
 get edit form (added in 1.4) More...
 
void setEditForm (QString ui)
 set edit form (added in 1.4) More...
 
QgsVectorLayer::FeatureFormSuppress featureFormSuppress () const
 Type of feature form pop-up suppression after feature creation (overrides app setting) More...
 
void setFeatureFormSuppress (QgsVectorLayer::FeatureFormSuppress s)
 Set type of feature form pop-up suppression after feature creation (overrides app setting) More...
 
QString annotationForm () const
 get annotation form (added in 1.5) More...
 
void setAnnotationForm (const QString &ui)
 set annotation form for layer (added in 1.5) More...
 
QString editFormInit ()
 get python function for edit form initialization (added in 1.4) More...
 
void setEditFormInit (QString function)
 set python function for edit form initialization (added in 1.4) More...
 
QMap< QString, QVariant > & valueMap (int idx)
 access value map More...
 
RangeDatarange (int idx)
 access range More...
 
ValueRelationDatavalueRelation (int idx)
 access relations More...
 
QList< QgsRelationreferencingRelations (int idx)
 Get relations, where the foreign key is on this layer. More...
 
QString & dateFormat (int idx)
 access date format More...
 
QSize & widgetSize (int idx)
 access widget size for photo and webview widget More...
 
bool fieldEditable (int idx)
 is edit widget editable More...
 
bool labelOnTop (int idx)
 label widget on top More...
 
void setFieldEditable (int idx, bool editable)
 set edit widget editable More...
 
void setLabelOnTop (int idx, bool onTop)
 label widget on top More...
 
QgsVectorLayerEditBuffereditBuffer ()
 Buffer with uncommitted editing operations. Only valid after editing has been turned on. More...
 
void beginEditCommand (QString text)
 Create edit command for undo/redo operations. More...
 
void endEditCommand ()
 Finish edit command and add it to undo/redo stack. More...
 
void destroyEditCommand ()
 Destroy active command and reverts all changes in it. More...
 
int fieldNameIndex (const QString &fieldName) const
 Returns the index of a field name or -1 if the field does not exist. More...
 
void updateFields ()
 Assembles mUpdatedFields considering provider fields, joined fields and added fields. More...
 
void createJoinCaches ()
 Caches joined attributes if required (and not already done) More...
 
void uniqueValues (int index, QList< QVariant > &uniqueValues, int limit=-1)
 Returns unique values for column. More...
 
QVariant minimumValue (int index)
 Returns minimum value for an attribute column or invalid variant in case of error. More...
 
QVariant maximumValue (int index)
 Returns maximum value for an attribute column or invalid variant in case of error. More...
 
void setFeatureBlendMode (const QPainter::CompositionMode &blendMode)
 Write blend mode for features. More...
 
QPainter::CompositionMode featureBlendMode () const
 Read blend mode for layer. More...
 
void setLayerTransparency (int layerTransparency)
 Write transparency for layer. More...
 
int layerTransparency () const
 Read transparency for layer. More...
 
QString metadata ()
 Obtain Metadata for this layer. More...
 
QgsGeometryCachecache ()
 
void setSimplifyMethod (const QgsVectorSimplifyMethod &simplifyMethod)
 Set the simplification settings for fast rendering of features. More...
 
const QgsVectorSimplifyMethodsimplifyMethod () const
 Returns the simplification settings for fast rendering of features. More...
 
bool simplifyDrawingCanbeApplied (const QgsRenderContext &renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint) const
 Returns whether the VectorLayer can apply the specified simplification hint. More...
 
- Public Member Functions inherited from QgsMapLayer
 QgsMapLayer (QgsMapLayer::LayerType type=VectorLayer, QString lyrname=QString::null, QString source=QString::null)
 Constructor. More...
 
virtual ~QgsMapLayer ()
 Destructor. More...
 
QgsMapLayer::LayerType type () const
 Get the type of the layer. More...
 
QString id () const
 Get this layer's unique ID, this ID is used to access this layer from map layer registry. More...
 
void setLayerName (const QString &name)
 Set the display name of the layer. More...
 
const QString & name () const
 Get the display name of the layer. More...
 
const QString & originalName () const
 Get the original name of the layer. More...
 
void setTitle (const QString &title)
 
const QString & title () const
 
void setAbstract (const QString &abstract)
 
const QString & abstract () const
 
void setKeywordList (const QString &keywords)
 
const QString & keywordList () const
 
void setDataUrl (const QString &dataUrl)
 
const QString & dataUrl () const
 
void setDataUrlFormat (const QString &dataUrlFormat)
 
const QString & dataUrlFormat () const
 
void setAttribution (const QString &attrib)
 
const QString & attribution () const
 
void setAttributionUrl (const QString &attribUrl)
 
const QString & attributionUrl () const
 
void setMetadataUrl (const QString &metaUrl)
 
const QString & metadataUrl () const
 
void setMetadataUrlType (const QString &metaUrlType)
 
const QString & metadataUrlType () const
 
void setMetadataUrlFormat (const QString &metaUrlFormat)
 
const QString & metadataUrlFormat () const
 
void setBlendMode (const QPainter::CompositionMode &blendMode)
 Write blend mode for layer. More...
 
QPainter::CompositionMode blendMode () const
 Read blend mode for layer. More...
 
bool isValid ()
 
QString publicSource () const
 
const QString & source () const
 Returns the source for the layer. More...
 
virtual QStringList subLayers () const
 Returns the sublayers of this layer (Useful for providers that manage their own layers, such as WMS) More...
 
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) More...
 
virtual void setSubLayerVisibility (QString name, bool vis)
 Set the visibility of the given sublayer name. More...
 
bool readLayerXML (const QDomElement &layerElement)
 sets state from Dom document More...
 
bool writeLayerXML (QDomElement &layerElement, QDomDocument &document)
 stores state in Dom node More...
 
QDomDocument asLayerDefinition ()
 Returns the layer as a layer definition document Layer definitions store the data source as well as styling and custom properties. More...
 
void setCustomProperty (const QString &key, const QVariant &value)
 Set a custom property for layer. More...
 
QVariant customProperty (const QString &value, const QVariant &defaultValue=QVariant()) const
 Read a custom property from layer. More...
 
void removeCustomProperty (const QString &key)
 Remove a custom property from layer. More...
 
virtual Q_DECL_DEPRECATED QString lastErrorTitle ()
 
virtual Q_DECL_DEPRECATED QString lastError ()
 
virtual QgsError error () const
 Get current status error. More...
 
const
QgsCoordinateReferenceSystem
crs () const
 Returns layer's spatial reference system. More...
 
void setCrs (const QgsCoordinateReferenceSystem &srs, bool emitSignal=true)
 Sets layer's spatial reference system. More...
 
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) More...
 
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) More...
 
virtual bool loadNamedStyleFromDb (const QString &db, const QString &theURI, QString &qml)
 
virtual void exportNamedStyle (QDomDocument &doc, QString &errorMsg)
 Export the properties of this layer as named style in a QDomDocument. More...
 
virtual void exportSldStyle (QDomDocument &doc, QString &errorMsg)
 Export the properties of this layer as SLD style in a QDomDocument. More...
 
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) More...
 
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) More...
 
virtual QString saveSldStyle (const QString &theURI, bool &theResultFlag)
 
virtual QString loadSldStyle (const QString &theURI, bool &theResultFlag)
 
QUndoStack * undoStack ()
 Return pointer to layer's undo stack. More...
 
Q_DECL_DEPRECATED QImage * cacheImage ()
 
Q_DECL_DEPRECATED void setCacheImage (QImage *)
 
virtual Q_DECL_DEPRECATED void onCacheImageDelete ()
 

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. More...
 
- Static Public Member Functions inherited from QgsMapLayer
static QgsMapLayerfromLayerDefinition (QDomDocument &document)
 Creates a new layer from a layer defininition document. More...
 
static QgsMapLayerfromLayerDefinitionFile (const QString qlrfile)
 
static QString capitaliseLayerName (const QString &name)
 A convenience function to (un)capitalise the layer name. More...
 

Protected Slots

void invalidateSymbolCountedFlag ()
 

Protected Member Functions

void setExtent (const QgsRectangle &rect)
 Set the extent. More...
 
- Protected Member Functions inherited from QgsMapLayer
void setValid (bool valid)
 set whether layer is valid or not - should be used in constructor. More...
 
void readCustomProperties (const QDomNode &layerNode, const QString &keyStartsWith="")
 Read custom properties from project file. More...
 
void writeCustomProperties (QDomNode &layerNode, QDomDocument &doc) const
 Write custom properties to project file. More...
 
void connectNotify (const char *signal)
 debugging member - invoked when a connect() is made to this object More...
 
void appendError (const QgsErrorMessage &theMessage)
 Add error message. More...
 
void setError (const QgsError &theError)
 Set error message. More...
 

Private Slots

void onRelationsLoaded ()
 

Private Member Functions

 QgsVectorLayer (const QgsVectorLayer &rhs)
 vector layers are not copyable More...
 
QgsVectorLayeroperator= (QgsVectorLayer const &rhs)
 vector layers are not copyable More...
 
bool setDataProvider (QString const &provider)
 bind layer to a specific data provider More...
 
QgsFeatureId findFreeId ()
 Goes through all features and finds a free id (e.g. More...
 
void snapToGeometry (const QgsPoint &startPoint, QgsFeatureId featureId, QgsGeometry *geom, double sqrSnappingTolerance, QMultiMap< double, QgsSnappingResult > &snappingResults, QgsSnapper::SnappingType snap_to) const
 Snaps to a geometry and adds the result to the multimap if it is within the snapping result. More...
 
void readSldLabeling (const QDomNode &node)
 Add joined attributes to a feature. More...
 

Private Attributes

QgsVectorDataProvidermDataProvider
 Pointer to data provider derived from the abastract base class QgsDataProvider. More...
 
QString mDisplayField
 index of the primary label field More...
 
QString mDisplayExpression
 the preview expression used to generate a human readable preview string for features More...
 
QString mProviderKey
 Data provider key. More...
 
QgsAttributeActionmActions
 The user-defined actions that are accessed from the Identify Results dialog box. More...
 
bool mReadOnly
 Flag indicating whether the layer is in read-only mode (editing disabled) or not. More...
 
QgsFeatureIds mSelectedFeatureIds
 Set holding the feature IDs that are activated. More...
 
QgsFields mUpdatedFields
 field map to commit More...
 
QMap< QString, QString > mAttributeAliasMap
 Map that stores the aliases for attributes. More...
 
QList
< QgsAttributeEditorElement * > 
mAttributeEditorElements
 Stores a list of attribute editor elements (Each holding a tree structure for a tab in the attribute editor) More...
 
QSet< QString > mExcludeAttributesWMS
 Attributes which are not published in WMS. More...
 
QSet< QString > mExcludeAttributesWFS
 Attributes which are not published in WFS. More...
 
QList< TabDatamTabs
 Map that stores the tab for attributes in the edit form. More...
 
int mWkbType
 Geometry type as defined in enum WkbType (qgis.h) More...
 
QgsFeatureRendererV2mRendererV2
 Renderer object which holds the information about how to display the features. More...
 
QgsVectorSimplifyMethod mSimplifyMethod
 Simplification object which holds the information about how to simplify the features for fast rendering. More...
 
QgsLabelmLabel
 Label. More...
 
bool mLabelOn
 Display labels. More...
 
bool mLabelFontNotFoundNotified
 Whether 'labeling font not found' has be shown for this layer (only show once in QgsMessageBar, on first rendering) More...
 
QPainter::CompositionMode mFeatureBlendMode
 Blend mode for features. More...
 
int mLayerTransparency
 Layer transparency. More...
 
QgsVectorLayer::VertexMarkerType mCurrentVertexMarkerType
 The current type of editing marker. More...
 
int mCurrentVertexMarkerSize
 The current size of editing marker. More...
 
bool mVertexMarkerOnlyForSelection
 Flag if the vertex markers should be drawn only for selection (true) or for all features (false) More...
 
QStringList mCommitErrors
 
QMap< QString, EditTypemEditTypes
 
QMap< QString, bool > mFieldEditables
 
QMap< QString, bool > mLabelOnTop
 
QMap< QString, QMap< QString,
QVariant > > 
mValueMaps
 
QMap< QString, RangeDatamRanges
 
QMap< QString, QPair< QString,
QString > > 
mCheckedStates
 
QMap< QString, ValueRelationDatamValueRelations
 
QMap< QString, QString > mDateFormats
 
QMap< QString, QSize > mWidgetSize
 
QMap< int, QString > mEditorWidgetV2Types
 
QMap< int, QMap< QString,
QVariant > > 
mEditorWidgetV2Configs
 
EditorLayout mEditorLayout
 Defines the default layout to use for the attribute editor (Drag and drop, UI File, Generated) More...
 
QString mEditForm
 
QString mEditFormInit
 
QgsVectorLayer::FeatureFormSuppress mFeatureFormSuppress
 Type of feature form suppression after feature creation. More...
 
QString mAnnotationForm
 
QgsGeometryCachemCache
 cache for some vector layer data - currently only geometries for faster editing More...
 
QgsVectorLayerEditBuffermEditBuffer
 stores information about uncommitted changes to layer More...
 
QgsVectorLayerJoinBuffermJoinBuffer
 
QgsDiagramRendererV2mDiagramRenderer
 
QgsDiagramLayerSettingsmDiagramLayerSettings
 
bool mValidExtent
 
bool mLazyExtent
 
bool mSymbolFeatureCounted
 
QMap< QgsSymbolV2 *, long > mSymbolFeatureCountMap
 

Friends

class QgsVectorLayerEditBuffer
 
class QgsVectorLayerFeatureSource
 

Additional Inherited Members

- Protected Attributes inherited from QgsMapLayer
QgsRectangle mExtent
 Extent of the layer. More...
 
bool mValid
 Indicates if the layer is valid and can be drawn. More...
 
QString mDataSource
 data source description string, varies by layer type More...
 
QString mLayerName
 Name of the layer - used for display. More...
 
QString mLayerOrigName
 Original name of the layer. More...
 
QString mTitle
 
QString mAbstract
 Description of the layer. More...
 
QString mKeywordList
 
QString mDataUrl
 DataUrl of the layer. More...
 
QString mDataUrlFormat
 
QString mAttribution
 Attribution of the layer. More...
 
QString mAttributionUrl
 
QString mMetadataUrl
 MetadataUrl of the layer. More...
 
QString mMetadataUrlType
 
QString mMetadataUrlFormat
 
QgsError mError
 Error. More...
 

Detailed Description

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:

QString uri = "point?crs=epsg:4326&field=id:integer";
QgsVectorLayer *scratchLayer = new QgsVectorLayer(uri, "Scratch point layer", "memory");

The main data providers supported by QGIS are listed below.

Vector data providers

Memory data providerType (memory)

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"

OGR data provider (ogr)

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.

Spatialite data provider (spatialite)

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.

Postgresql data provider (postgres)

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.

Microsoft SQL server data provider (mssql)

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.

SQL Anywhere data provider (sqlanywhere)

Connects to an SQLanywhere database. The url defines the connection parameters, table, geometry column, and other attributes. The url can be constructed using the QgsDataSourceURI class.

WFS (web feature service) data provider (wfs)

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:

Delimited text file data provider (delimitedtext)

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:

-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.

GPX data provider (gpx)

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"

Grass data provider (grass)

Provider to display vector data in a GRASS GIS layer.

Definition at line 451 of file qgsvectorlayer.h.

Member Enumeration Documentation

The different types to layout the attribute editor.

Note
added in 1.9
Enumerator
GeneratedLayout 
TabLayout 
UiFileLayout 

Definition at line 457 of file qgsvectorlayer.h.

Enumerator
LineEdit 
UniqueValues 
UniqueValuesEditable 
ValueMap 
Classification 
EditRange 
SliderRange 
CheckBox 
Note
added in 1.4
FileName 
Enumeration 
Immutable 

The attribute value should not be changed in the attribute form.

Hidden 

The attribute value should not be shown in the attribute form.

Note
added in 1.4
TextEdit 

multiline edit

Note
added in 1.4
Calendar 

calendar widget

Note
added in 1.5
DialRange 

dial range

Note
added in 1.5
ValueRelation 

value map from an table

Note
added in 1.8
UuidGenerator 

uuid generator - readonly and automatically intialized

Note
added in 1.9
Photo 

phote widget

Note
added in 1.9
WebView 

webview widget

Note
added in 1.9
Color 

color

Note
added in 1.9
EditorWidgetV2 

modularized edit widgets

Note
added in 2.1

Definition at line 464 of file qgsvectorlayer.h.

Types of feature form suppression after feature creation.

Note
added in 2.1
Enumerator
SuppressDefault 
SuppressOn 
SuppressOff 

Definition at line 491 of file qgsvectorlayer.h.

Editing vertex markers.

Note
public from version 1.4
Enumerator
SemiTransparentCircle 
Cross 
NoMarker 

Definition at line 1317 of file qgsvectorlayer.h.

Constructor & Destructor Documentation

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.

Parameters
pathThe path or url of the parameter. Typically this encodes parameters used by the data provider as url query items.
baseNameThe name used to represent the layer in the legend
providerLibThe name of the data provider, eg "memory", "postgres"
loadDefaultStyleFlagwhether to load the default style

Definition at line 117 of file qgsvectorlayer.cpp.

References checkJoinLayerRemove(), QgsFeatureRendererV2::defaultRenderer(), QgsVectorSimplifyMethod::forceLocalOptimization(), geometryType(), hasGeometryType(), QgsMapLayerRegistry::instance(), QgsProject::instance(), QgsMapLayer::loadDefaultStyle(), mActions, QgsVectorSimplifyMethod::maximumScale(), mProviderKey, mSimplifyMethod, QgsMapLayer::mValid, onRelationsLoaded(), QgsMapLayer::repaintRequested(), selectionChanged(), setCoordinateSystem(), setDataProvider(), QgsVectorSimplifyMethod::setForceLocalOptimization(), QgsVectorSimplifyMethod::setMaximumScale(), setRendererV2(), QgsVectorSimplifyMethod::setSimplifyHints(), QgsVectorSimplifyMethod::setThreshold(), QgsVectorSimplifyMethod::simplifyHints(), and QgsVectorSimplifyMethod::threshold().

QgsVectorLayer::~QgsVectorLayer ( )
virtual
QgsVectorLayer::QgsVectorLayer ( const QgsVectorLayer rhs)
private

vector layers are not copyable

Member Function Documentation

QgsAttributeAction* QgsVectorLayer::actions ( )
inline
bool QgsVectorLayer::addAttribute ( const QgsField field)

add an attribute field (but does not commit it) returns true if the field was added

Note
added in version 1.2

Definition at line 2226 of file qgsvectorlayer.cpp.

References QgsVectorLayerEditBuffer::addAttribute(), mDataProvider, and mEditBuffer.

Referenced by QgsOfflineEditing::applyAttributesAdded().

void QgsVectorLayer::addAttributeAlias ( int  attIndex,
QString  aliasString 
)

Sets an alias (a display name) for attributes to display in dialogs.

Note
added in version 1.2

Definition at line 2234 of file qgsvectorlayer.cpp.

References layerModified(), mAttributeAliasMap, QgsMapLayer::name(), and pendingFields().

void QgsVectorLayer::addAttributeEditorWidget ( QgsAttributeEditorElement data)

Adds a tab (for the attribute editor form) holding groups and fields.

Note
added in version 2.0

Definition at line 2245 of file qgsvectorlayer.cpp.

References mAttributeEditorElements.

bool QgsVectorLayer::addFeature ( QgsFeature f,
bool  alsoUpdateExtent = true 
)

Adds a feature.

Parameters
ffeature to add
alsoUpdateExtentIf True, will also go to the effort of e.g. updating the extents.
Returns
True in case of success and False in case of error

Definition at line 954 of file qgsvectorlayer.cpp.

References QgsVectorLayerEditBuffer::addFeature(), mDataProvider, mEditBuffer, and updateExtents().

Referenced by QgsOfflineEditing::applyFeaturesAdded(), and QgsOfflineEditing::copyVectorLayer().

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 2481 of file qgsvectorlayer.cpp.

References QgsVectorLayerEditBuffer::addFeatures(), mDataProvider, mEditBuffer, setSelectedFeatures(), and updateExtents().

void QgsVectorLayer::addJoin ( const QgsVectorJoinInfo joinInfo)

Joins another vector layer to this layer.

Parameters
joinInfojoin object containing join layer id, target and source field
Note
added in 1.7

Definition at line 2935 of file qgsvectorlayer.cpp.

References QgsVectorLayerJoinBuffer::addJoin(), mJoinBuffer, and updateFields().

int QgsVectorLayer::addPart ( const QList< QgsPoint > &  ring)

Adds a new part polygon to a multipart feature.

Returns
0 in case of success, 1 if selected feature is not multipart, 2 if ring is not a valid geometry, 3 if new polygon ring not disjoint with existing rings, 4 if no feature was selected, 5 if several features are selected, 6 if selected geometry not found 7 layer not editable

Definition at line 1078 of file qgsvectorlayer.cpp.

References QgsVectorLayerEditUtils::addPart(), mDataProvider, mEditBuffer, mSelectedFeatureIds, and QgsDebugMsg.

int QgsVectorLayer::addRing ( const QList< QgsPoint > &  ring)

Adds a ring to polygon/multipolygon features.

Returns
0 in case of success, 1 problem with feature type, 2 ring not closed, 3 ring not valid, 4 ring crosses existing rings, 5 no feature found where ring can be inserted 6 layer not editable

Definition at line 1069 of file qgsvectorlayer.cpp.

References QgsVectorLayerEditUtils::addRing(), mDataProvider, and mEditBuffer.

int QgsVectorLayer::addTopologicalPoints ( QgsGeometry geom)

Adds topological points for every vertex of the geometry.

Parameters
geomthe geometry where each vertex is added to segments of other features
Note
geom is not going to be modified by the function
Returns
0 in case of success

Definition at line 1172 of file qgsvectorlayer.cpp.

References QgsVectorLayerEditUtils::addTopologicalPoints(), mDataProvider, and mEditBuffer.

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.

Parameters
pposition of the vertex
Returns
0 in case of success

Definition at line 1181 of file qgsvectorlayer.cpp.

References QgsVectorLayerEditUtils::addTopologicalPoints(), mDataProvider, and mEditBuffer.

QgsFeatureIds QgsVectorLayer::allFeatureIds ( )

Get all feature Ids.

Definition at line 514 of file qgsvectorlayer.cpp.

References getFeatures(), QgsFeature::id(), QgsFeatureIterator::nextFeature(), and QgsFeatureRequest::NoGeometry.

Referenced by invertSelection(), and selectAll().

QString QgsVectorLayer::annotationForm ( ) const
inline

get annotation form (added in 1.5)

Definition at line 1235 of file qgsvectorlayer.h.

Referenced by QgsFormAnnotationItem::QgsFormAnnotationItem().

bool QgsVectorLayer::applyNamedStyle ( QString  namedStyle,
QString  errorMsg 
)
virtual
void QgsVectorLayer::attributeAdded ( int  idx)
signal

Will be emitted, when a new attribute has been added to this vector layer.

Applies only to types QgsFields::OriginEdit and QgsFields::OriginProvider

Parameters
idxThe index of the new attribute
See Also
updatedFields()

Referenced by startEditing().

QString QgsVectorLayer::attributeAlias ( int  attributeIndex) const

Returns the alias of an attribute name or an empty string if there is no alias.

Note
added in version 1.2

Definition at line 2260 of file qgsvectorlayer.cpp.

References mAttributeAliasMap, QgsMapLayer::name(), and pendingFields().

Referenced by attributeDisplayName(), QgsAttributeTableModel::headerData(), QgsAttributeDialog::init(), and QgsComposerAttributeTable::initializeAliasMap().

const QMap< QString, QString >& QgsVectorLayer::attributeAliases ( ) const
inline

Definition at line 1146 of file qgsvectorlayer.h.

Referenced by QgsFieldModel::data().

void QgsVectorLayer::attributeDeleted ( int  idx)
signal

Will be emitted, when an attribute has been deleted from this vector layer.

Applies only to types QgsFields::OriginEdit and QgsFields::OriginProvider

Parameters
idxThe index of the deleted attribute
See Also
updatedFields()

Referenced by startEditing().

QString QgsVectorLayer::attributeDisplayName ( int  attributeIndex) const

Convenience function that returns the attribute alias if defined or the field name else.

Note
added in version 1.2

Definition at line 2270 of file qgsvectorlayer.cpp.

References attributeAlias(), QgsFields::count(), and pendingFields().

Referenced by QgsAttributeEditor::createWidgetFromDef(), QgsAttributeAction::expandAction(), and QgsAttributeDialog::init().

QgsAttributeEditorElement * QgsVectorLayer::attributeEditorElementFromDomElement ( QDomElement &  elem,
QObject *  parent 
)

convert a saved attribute editor element into a AttributeEditor structure as it's used internally.

Parameters
elemthe DOM element
parentthe QObject which will own this object

Definition at line 1832 of file qgsvectorlayer.cpp.

References QgsAttributeEditorContainer::addChildElement(), dataProvider(), QgsVectorDataProvider::fieldNameMap(), and QgsMapLayer::name().

Referenced by readSymbology().

QList< QgsAttributeEditorElement * > & QgsVectorLayer::attributeEditorElements ( )

Returns a list of tabs holding groups and fields.

Note
added in version 2.0

Definition at line 3736 of file qgsvectorlayer.cpp.

References mAttributeEditorElements.

Referenced by QgsAttributeDialog::init().

void QgsVectorLayer::attributeValueChanged ( QgsFeatureId  fid,
int  idx,
const QVariant &   
)
signal

Referenced by startEditing().

void QgsVectorLayer::beforeCommitChanges ( )
signal

Is emitted, before changes are commited to the data provider.

Referenced by commitChanges().

void QgsVectorLayer::beforeRollBack ( )
signal

Is emitted, before changes are rolled back.

Referenced by rollBack().

void QgsVectorLayer::beginEditCommand ( QString  text)

Create edit command for undo/redo operations.

Parameters
texttext which is to be displayed in undo window

Definition at line 2894 of file qgsvectorlayer.cpp.

References editCommandStarted(), and QgsMapLayer::undoStack().

Referenced by QgsDualView::saveEditChanges(), and QgsAttributeTableDelegate::setModelData().

QgsRectangle QgsVectorLayer::boundingBoxOfSelected ( )
QgsGeometryCache* QgsVectorLayer::cache ( )
inline
Note
not available in python bindings

Definition at line 1372 of file qgsvectorlayer.h.

QString QgsVectorLayer::capabilitiesString ( ) const

Capabilities for this layer in a friendly format.

Definition at line 221 of file qgsvectorlayer.cpp.

References QgsVectorDataProvider::capabilitiesString(), and mDataProvider.

Referenced by metadata().

bool QgsVectorLayer::changeAttributeValue ( QgsFeatureId  fid,
int  field,
QVariant  value,
bool  emitSignal 
)

Changes an attribute value (but does not commit it)

Deprecated:
The emitSignal parameter is obsolete and not considered at the moment. It will be removed in future releases. Remove it to be prepared for the future. (Since 2.1)

Definition at line 2212 of file qgsvectorlayer.cpp.

Referenced by QgsOfflineEditing::applyAttributeValueChanges(), QgsRelationEditorWidget::on_mLinkFeatureButton_clicked(), QgsRelationEditorWidget::on_mUnlinkFeatureButton_clicked(), QgsDualView::saveEditChanges(), QgsAttributeTableDelegate::setModelData(), and updateFeature().

bool QgsVectorLayer::changeAttributeValue ( QgsFeatureId  fid,
int  field,
const QVariant &  newValue,
const QVariant &  oldValue = QVariant() 
)

Changes an attribute value (but does not commit it)

Parameters
fidThe feature id of the feature to be changed
fieldThe index of the field to be updated
newValueThe value which will be assigned to the field
oldValueThe previous value to restore on undo (will otherwise be retrieved)
Returns
true in case of success

Definition at line 2218 of file qgsvectorlayer.cpp.

References QgsVectorLayerEditBuffer::changeAttributeValue(), mDataProvider, and mEditBuffer.

bool QgsVectorLayer::changeGeometry ( QgsFeatureId  fid,
QgsGeometry geom 
)

change feature's geometry

Note
added in version 1.2

Definition at line 2199 of file qgsvectorlayer.cpp.

References QgsVectorLayerEditBuffer::changeGeometry(), mDataProvider, mEditBuffer, and updateExtents().

Referenced by QgsOfflineEditing::applyGeometryChanges(), and updateFeature().

QPair< QString, QString > QgsVectorLayer::checkedState ( int  idx)

return string representing 'true' for a checkbox (added in 1.4)

Note
not available in python bindings FIXME: need SIP binding for QPair<QString, QString>

Definition at line 2921 of file qgsvectorlayer.cpp.

References QgsFields::count(), mCheckedStates, QgsMapLayer::name(), and pendingFields().

Referenced by QgsAttributeEditor::retrieveValue(), and QgsAttributeEditor::setValue().

void QgsVectorLayer::checkJoinLayerRemove ( QString  theLayerId)
slot

Check if there is a join with a layer that will be removed.

Note
added in 1.7

Definition at line 2941 of file qgsvectorlayer.cpp.

References removeJoin().

Referenced by QgsVectorLayer(), and readXml().

void QgsVectorLayer::clearAttributeEditorWidgets ( )

Clears all the tabs for the attribute editor form.

Note
added in version 2.0

Definition at line 3741 of file qgsvectorlayer.cpp.

References mAttributeEditorElements.

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 2357 of file qgsvectorlayer.cpp.

References beforeCommitChanges(), QgsVectorLayerEditBuffer::commitChanges(), QgsGeometryCache::deleteCachedGeometries(), editingStopped(), QgsMessageLog::logMessage(), mCache, mCommitErrors, mDataProvider, mEditBuffer, QgsMapLayer::repaintRequested(), tr, QgsMapLayer::undoStack(), QgsDataProvider::updateExtents(), and updateFields().

Referenced by QgsOfflineEditing::copyVectorLayer(), and QgsOfflineEditing::synchronize().

const QStringList & QgsVectorLayer::commitErrors ( )
void QgsVectorLayer::committedAttributesAdded ( const QString &  layerId,
const QList< QgsField > &  addedAttributes 
)
signal
void QgsVectorLayer::committedAttributesDeleted ( const QString &  layerId,
const QgsAttributeList deletedAttributes 
)
signal

Signals emitted after committing changes.

Note
added in v1.6
void QgsVectorLayer::committedAttributeValuesChanges ( const QString &  layerId,
const QgsChangedAttributesMap changedAttributesValues 
)
signal
void QgsVectorLayer::committedFeaturesAdded ( const QString &  layerId,
const QgsFeatureList addedFeatures 
)
signal

Referenced by startEditing().

void QgsVectorLayer::committedFeaturesRemoved ( const QString &  layerId,
const QgsFeatureIds deletedFeatureIds 
)
signal

Referenced by startEditing().

void QgsVectorLayer::committedGeometriesChanges ( const QString &  layerId,
const QgsGeometryMap changedGeometries 
)
signal
bool QgsVectorLayer::countSymbolFeatures ( bool  showProgress = true)
void QgsVectorLayer::createJoinCaches ( )

Caches joined attributes if required (and not already done)

Note
added in 1.7

Definition at line 2976 of file qgsvectorlayer.cpp.

References QgsVectorLayerJoinBuffer::containsJoins(), QgsVectorLayerJoinBuffer::createJoinCaches(), and mJoinBuffer.

QgsMapLayerRenderer * QgsVectorLayer::createMapRenderer ( QgsRenderContext rendererContext)
virtual

Return new instance of QgsMapLayerRenderer that will be used for rendering of given context.

Note
added in 2.4

Reimplemented from QgsMapLayer.

Definition at line 401 of file qgsvectorlayer.cpp.

QString QgsVectorLayer::dataComment ( ) const

Returns a comment for the data in the layer.

Definition at line 230 of file qgsvectorlayer.cpp.

References QgsVectorDataProvider::dataComment(), and mDataProvider.

Referenced by metadata().

QgsVectorDataProvider * QgsVectorLayer::dataProvider ( )

Returns the data provider.

Definition at line 573 of file qgsvectorlayer.cpp.

References mDataProvider.

Referenced by QgsQueryBuilder::accept(), QgsVectorLayerEditBuffer::addAttribute(), QgsVectorLayerEditBuffer::addFeature(), QgsVectorLayerEditBuffer::addFeatures(), QgsOfflineEditing::applyAttributesAdded(), QgsOfflineEditing::applyFeaturesAdded(), attributeEditorElementFromDomElement(), QgsGeometryAnalyzer::buffer(), QgsZonalStatistics::calculateStatistics(), QgsGeometryAnalyzer::centroids(), QgsVectorLayerEditBuffer::changeAttributeValue(), QgsVectorLayerEditBuffer::changeGeometry(), QgsVectorLayerEditBuffer::commitChanges(), QgsGeometryAnalyzer::convexHull(), QgsOfflineEditing::copyVectorLayer(), QgsAttributeEditor::createAttributeEditor(), QgsRelationEditorWidget::createRelationEditor(), QgsVectorLayerEditBuffer::deleteAttribute(), QgsVectorLayerEditBuffer::deleteFeature(), QgsGeometryAnalyzer::dissolve(), QgsGeometryAnalyzer::eventLayer(), QgsGeometryAnalyzer::extent(), QgsVectorLayerCache::getFeatures(), QgsZonalStatistics::getUniqueFieldName(), QgsAttributeDialog::init(), QgsOverlayAnalyzer::intersection(), metadata(), QgsVectorLayerFeatureSource::QgsVectorLayerFeatureSource(), QgsPalLayerSettings::readDataDefinedProperty(), QgsFeatureListModel::setDisplayExpression(), QgsGeometryAnalyzer::simplify(), QgsVectorLayerEditUtils::splitFeatures(), QgsQueryBuilder::test(), QgsProjectFileTransform::transform0110to1000(), uniqueValues(), and QgsVectorFileWriter::writeAsVectorFormat().

const QgsVectorDataProvider * QgsVectorLayer::dataProvider ( ) const

Returns the data provider in a const-correct manner.

Note
not available in python bindings

Definition at line 578 of file qgsvectorlayer.cpp.

References mDataProvider.

QString & QgsVectorLayer::dateFormat ( int  idx)
bool QgsVectorLayer::deleteAttribute ( int  attr)

delete an attribute field (but does not commit it)

Definition at line 2284 of file qgsvectorlayer.cpp.

References QgsVectorLayerEditBuffer::deleteAttribute(), mDataProvider, and mEditBuffer.

Referenced by deleteAttributes().

bool QgsVectorLayer::deleteAttributes ( QList< int >  attrs)

Deletes a list of attribute fields (but does not commit it)

Parameters
attrsthe indices of the attributes to delete
Returns
true if at least one attribute has been deleted

Definition at line 2292 of file qgsvectorlayer.cpp.

References deleteAttribute().

bool QgsVectorLayer::deleteFeature ( QgsFeatureId  fid)
bool QgsVectorLayer::deleteSelectedFeatures ( )

Deletes the selected features.

Returns
true in case of success and false otherwise

Definition at line 1042 of file qgsvectorlayer.cpp.

References QgsVectorDataProvider::capabilities(), deleteFeature(), QgsVectorDataProvider::DeleteFeatures, isEditable(), mDataProvider, mSelectedFeatureIds, triggerRepaint(), and updateExtents().

bool QgsVectorLayer::deleteVertex ( QgsFeatureId  atFeatureId,
int  atVertex 
)

Deletes a vertex from a feature.

Definition at line 1032 of file qgsvectorlayer.cpp.

References QgsVectorLayerEditUtils::deleteVertex(), mDataProvider, and mEditBuffer.

void QgsVectorLayer::deselect ( const QgsFeatureId  featureId)
slot

Deselect feature by its ID.

Parameters
featureIdThe id of the feature to deselect
See Also
deselect(QgsFeatureIds)

Definition at line 445 of file qgsvectorlayer.cpp.

References mSelectedFeatureIds, and selectionChanged().

Referenced by QgsVectorLayerSelectionManager::deselect().

void QgsVectorLayer::deselect ( const QgsFeatureIds featureIds)
slot

Deselect features by their ID.

Parameters
featureIdsThe ids of the features to deselect
See Also
deselect(QgsFeatureId)

Definition at line 452 of file qgsvectorlayer.cpp.

References mSelectedFeatureIds, and selectionChanged().

void QgsVectorLayer::destroyEditCommand ( )

Destroy active command and reverts all changes in it.

Definition at line 2906 of file qgsvectorlayer.cpp.

References editCommandDestroyed(), and QgsMapLayer::undoStack().

const QgsDiagramLayerSettings* QgsVectorLayer::diagramLayerSettings ( ) const
inline

Definition at line 720 of file qgsvectorlayer.h.

Referenced by QgsVectorLayerRenderer::prepareDiagrams().

const QgsDiagramRendererV2* QgsVectorLayer::diagramRenderer ( ) const
inline
const QString QgsVectorLayer::displayExpression ( )

Get the preview expression, used to create a human readable preview string.

Uses QgsExpression

Returns
The expression which will be used to preview features for this layer
Note
added in 2.0

Definition at line 2682 of file qgsvectorlayer.cpp.

References mDisplayExpression.

Referenced by QgsDualView::columnBoxInit(), QgsDualView::previewExpressionBuilder(), and setDisplayExpression().

const QString QgsVectorLayer::displayField ( ) const

Returns the primary display field name used in the identify results dialog.

Definition at line 2672 of file qgsvectorlayer.cpp.

References mDisplayField.

Referenced by QgsDualView::columnBoxInit(), QgsMapTip::fetchFeature(), and writeSymbology().

bool QgsVectorLayer::draw ( QgsRenderContext rendererContext)
virtual

Draws the layer.

Returns
false if an error occurred during drawing

Reimplemented from QgsMapLayer.

Definition at line 406 of file qgsvectorlayer.cpp.

References QgsVectorLayerRenderer::render().

void QgsVectorLayer::drawLabels ( QgsRenderContext rendererContext)
virtual
void QgsVectorLayer::drawVertexMarker ( double  x,
double  y,
QPainter &  p,
QgsVectorLayer::VertexMarkerType  type,
int  vertexSize 
)
static

Draws a vertex symbol at (screen) coordinates x, y.

(Useful to assist vertex editing.)

Note
public and static from version 1.4

Definition at line 415 of file qgsvectorlayer.cpp.

References Cross, and SemiTransparentCircle.

Referenced by QgsFeatureRendererV2::renderVertexMarker().

QgsVectorLayerEditBuffer* QgsVectorLayer::editBuffer ( )
inline
void QgsVectorLayer::editCommandDestroyed ( )
signal

Signal emitted, whan an edit command is destroyed.

Note
This is not a rollback, it is only related to the current edit command. See beforeRollBack()

Referenced by destroyEditCommand().

void QgsVectorLayer::editCommandEnded ( )
signal

Signal emitted, when an edit command successfully ended.

Note
This does not mean it is also committed, only that it is written to the edit buffer. See beforeCommitChanges()

Referenced by endEditCommand().

void QgsVectorLayer::editCommandStarted ( const QString &  text)
signal

Signal emitted when a new edit command has been started.

Parameters
textDescription for this edit command

Referenced by beginEditCommand().

QString QgsVectorLayer::editForm ( )

get edit form (added in 1.4)

Definition at line 2748 of file qgsvectorlayer.cpp.

References mEditForm.

Referenced by QgsAttributeDialog::init().

QString QgsVectorLayer::editFormInit ( )

get python function for edit form initialization (added in 1.4)

Definition at line 2763 of file qgsvectorlayer.cpp.

References mEditFormInit.

Referenced by QgsAttributeDialog::init().

void QgsVectorLayer::editingStarted ( )
signal

Is emitted, when editing on this layer has started.

Referenced by startEditing().

void QgsVectorLayer::editingStopped ( )
signal

Is emitted, when edited changes successfully have been written to the data provider.

Referenced by commitChanges(), and rollBack().

QgsVectorLayer::EditorLayout QgsVectorLayer::editorLayout ( )

get the active layout for the attribute editor for this layer (added in 1.9)

Definition at line 2728 of file qgsvectorlayer.cpp.

References mEditorLayout.

Referenced by QgsAttributeDialog::init(), setEditorLayout(), and QgsAttributeDialog::~QgsAttributeDialog().

const QString QgsVectorLayer::editorWidgetV2 ( int  fieldIdx)

Get the id for the editor widget used to represent the field at the given index.

Parameters
fieldIdxThe index of the field
Returns
The id for the editor widget or a NULL string if not applicable

Definition at line 2250 of file qgsvectorlayer.cpp.

References mEditorWidgetV2Types.

Referenced by QgsAttributeEditor::createAttributeEditor().

const QgsEditorWidgetConfig QgsVectorLayer::editorWidgetV2Config ( int  fieldIdx)

Get the configuration for the editor widget used to represent the field at the given index.

Parameters
fieldIdxThe index of the field
Returns
The id for the editor widget or a NULL string if not configured

Definition at line 2255 of file qgsvectorlayer.cpp.

References mEditorWidgetV2Configs.

Referenced by QgsAttributeEditor::createAttributeEditor().

QgsVectorLayer::EditType QgsVectorLayer::editType ( int  idx)
void QgsVectorLayer::enableLabels ( bool  on)

Set labels on.

Definition at line 1200 of file qgsvectorlayer.cpp.

References mLabelOn.

Referenced by readSymbology().

void QgsVectorLayer::endEditCommand ( )

Finish edit command and add it to undo/redo stack.

Definition at line 2900 of file qgsvectorlayer.cpp.

References editCommandEnded(), and QgsMapLayer::undoStack().

Referenced by QgsDualView::saveEditChanges(), and QgsAttributeTableDelegate::setModelData().

const QSet<QString>& QgsVectorLayer::excludeAttributesWFS ( ) const
inline

Definition at line 1151 of file qgsvectorlayer.h.

const QSet<QString>& QgsVectorLayer::excludeAttributesWMS ( ) const
inline

Definition at line 1148 of file qgsvectorlayer.h.

QgsRectangle QgsVectorLayer::extent ( )
virtual
void QgsVectorLayer::featureAdded ( QgsFeatureId  fid)
signal

Referenced by startEditing().

QPainter::CompositionMode QgsVectorLayer::featureBlendMode ( ) const
void QgsVectorLayer::featureBlendModeChanged ( const QPainter::CompositionMode &  blendMode)
signal

Signal emitted when setFeatureBlendMode() is called.

Referenced by setFeatureBlendMode().

long QgsVectorLayer::featureCount ( ) const
virtual
long QgsVectorLayer::featureCount ( QgsSymbolV2 symbol)

Number of features rendered with specified symbol.

Features must be first calculated by countSymbolFeatures()

Parameters
symbolthe symbol
Returns
number of features rendered by symbol or -1 if failed or counts are not available

Definition at line 731 of file qgsvectorlayer.cpp.

References mSymbolFeatureCounted, and mSymbolFeatureCountMap.

void QgsVectorLayer::featureDeleted ( QgsFeatureId  fid)
signal

Referenced by startEditing().

QgsVectorLayer::FeatureFormSuppress QgsVectorLayer::featureFormSuppress ( ) const
inline

Type of feature form pop-up suppression after feature creation (overrides app setting)

Note
added in 2.1

Definition at line 1228 of file qgsvectorlayer.h.

Referenced by writeSymbology().

bool QgsVectorLayer::fieldEditable ( int  idx)
int QgsVectorLayer::fieldNameIndex ( const QString &  fieldName) const
QgsFeatureId QgsVectorLayer::findFreeId ( )
private

Goes through all features and finds a free id (e.g.

to give it temporarily to a not-commited feature)

void QgsVectorLayer::geometryChanged ( QgsFeatureId  fid,
QgsGeometry geom 
)
signal

Referenced by startEditing().

QGis::GeometryType QgsVectorLayer::geometryType ( ) const
QgsFeatureIterator QgsVectorLayer::getFeatures ( const QgsFeatureRequest request = QgsFeatureRequest())

Query the provider for features specified in request.

Definition at line 945 of file qgsvectorlayer.cpp.

References mDataProvider, and QgsVectorLayerFeatureSource.

Referenced by QgsVectorLayerEditUtils::addPart(), QgsVectorLayerEditUtils::addRing(), allFeatureIds(), QgsOfflineEditing::applyFeaturesAdded(), QgsGeometry::avoidIntersections(), boundingBoxOfSelected(), QgsGeometryAnalyzer::buffer(), QgsInterpolator::cacheBaseData(), QgsVectorLayerJoinBuffer::cacheJoinLayer(), QgsGeometryAnalyzer::centroids(), QgsGeometryAnalyzer::convexHull(), QgsOfflineEditing::copyVectorLayer(), QgsSearchQueryBuilder::countRecords(), countSymbolFeatures(), QgsAttributeEditor::createAttributeEditor(), QgsFormAnnotationItem::createDesignerWidget(), QgsPointSample::createRandomPoints(), QgsGraduatedSymbolRendererV2::createRenderer(), QgsTransectSample::createSample(), QgsVectorLayerEditUtils::deleteVertex(), QgsGeometryAnalyzer::dissolve(), drawLabels(), QgsGeometryAnalyzer::eventLayer(), extent(), QgsVectorLayerCache::featureAtId(), QgsMapTip::fetchFeature(), QgsTransectSample::findBaselineGeometry(), QgsComposerAttributeTable::getFeatureAttributes(), QgsVectorLayerCache::getFeatures(), QgsSearchQueryBuilder::getFieldValues(), QgsRelation::getRelatedFeatures(), QgsMapToolIdentify::identifyVectorLayer(), QgsVectorLayerImport::importLayer(), QgsAttributeDialog::init(), QgsVectorLayerEditUtils::insertVertex(), QgsOverlayAnalyzer::intersectFeature(), QgsOverlayAnalyzer::intersection(), invertSelectionInRectangle(), QgsAttributeTableModel::loadAttributes(), maximumValue(), minimumValue(), QgsVectorLayerEditUtils::moveVertex(), QgsExpressionSelectionDialog::on_mActionAddToSelection_triggered(), QgsExpressionSelectionDialog::on_mActionRemoveFromSelection_triggered(), QgsExpressionSelectionDialog::on_mActionSelect_triggered(), QgsExpressionSelectionDialog::on_mActionSelectInstersect_triggered(), QgsExpressionBuilderWidget::on_txtExpressionString_textChanged(), QgsAtlasComposition::prepareForFeature(), QgsCachedFeatureWriterIterator::QgsCachedFeatureWriterIterator(), removePolygonIntersections(), select(), selectedFeatures(), QgsAtlasComposition::setCoverageLayer(), QgsHtmlAnnotationItem::setFeatureForMapPosition(), QgsFormAnnotationItem::setFeatureForMapPosition(), QgsGeometryAnalyzer::simplify(), snapWithContext(), QgsVectorLayerEditUtils::splitFeatures(), QgsVectorLayerEditUtils::splitParts(), QgsVectorLayerEditUtils::translateFeature(), QgsVectorLayerUndoCommandChangeAttribute::undo(), uniqueValues(), updateFeature(), QgsAtlasComposition::updateFeatures(), QgsOfflineEditing::updateFidLookup(), and QgsVectorFileWriter::writeAsVectorFormat().

QString QgsVectorLayer::getStyleFromDatabase ( QString  styleId,
QString &  msgError 
)
virtual

Will return the named style corresponding to style id provided.

Definition at line 3813 of file qgsvectorlayer.cpp.

References cast_to_fptr, QgsProviderRegistry::instance(), QgsMapLayer::mDataSource, mProviderKey, QgsProviderRegistry::providerLibrary(), and tr.

bool QgsVectorLayer::hasGeometryType ( ) const
bool QgsVectorLayer::hasLabelsEnabled ( void  ) const

Label is on.

Definition at line 1205 of file qgsvectorlayer.cpp.

References mLabelOn.

Referenced by QgsOfflineEditing::copyVectorLayer(), readSymbology(), and writeSymbology().

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.

Parameters
snapResultsresults collected from the snapping operation
Returns
0 in case of success

Definition at line 2644 of file qgsvectorlayer.cpp.

References QgsVectorLayerEditUtils::insertSegmentVerticesForSnap().

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 1012 of file qgsvectorlayer.cpp.

References QgsVectorLayerEditUtils::insertVertex(), mDataProvider, and mEditBuffer.

void QgsVectorLayer::invalidateSymbolCountedFlag ( )
protectedslot

Definition at line 3688 of file qgsvectorlayer.cpp.

References mSymbolFeatureCounted.

Referenced by startEditing().

void QgsVectorLayer::invertSelection ( )

Select not selected features and deselect selected ones.

Definition at line 502 of file qgsvectorlayer.cpp.

References allFeatureIds(), mSelectedFeatureIds, and setSelectedFeatures().

void QgsVectorLayer::invertSelectionInRectangle ( QgsRectangle rect)

Invert selection of features found within the search rectangle (in layer's coordinates)

Parameters
rectThe rectangle in which the selection of features will be inverted
See Also
invertSelection()

Definition at line 531 of file qgsvectorlayer.cpp.

References QgsFeatureRequest::ExactIntersect, getFeatures(), QgsFeature::id(), modifySelection(), mSelectedFeatureIds, QgsFeatureIterator::nextFeature(), QgsFeatureRequest::NoGeometry, and QgsRectangle::normalize().

bool QgsVectorLayer::isEditable ( ) const
virtual
bool QgsVectorLayer::isModified ( ) const
virtual

Returns true if the provider has been modified since the last commit.

Definition at line 2707 of file qgsvectorlayer.cpp.

References QgsVectorLayerEditBuffer::isModified(), and mEditBuffer.

Referenced by rollBack(), and QgsAttributeTableModel::setData().

bool QgsVectorLayer::isReadOnly ( ) const
virtual

Returns true if the provider is in read-only mode.

Note
added in 1.6

Definition at line 2692 of file qgsvectorlayer.cpp.

References mReadOnly.

Referenced by QgsRelationEditorWidget::createRelationEditor().

QgsLabel * QgsVectorLayer::label ( )

Get the label object associated with this layer.

Definition at line 1190 of file qgsvectorlayer.cpp.

References mLabel.

const QgsLabel * QgsVectorLayer::label ( ) const

Definition at line 1195 of file qgsvectorlayer.cpp.

References mLabel.

void QgsVectorLayer::labelingFontNotFound ( QgsVectorLayer layer,
const QString &  fontfamily 
)
signal

Emitted when the font family defined for labeling layer is not found on system.

Note
added in 1.9
bool QgsVectorLayer::labelOnTop ( int  idx)

label widget on top

Note
added in 1.9

Definition at line 2848 of file qgsvectorlayer.cpp.

References QgsFields::count(), mLabelOnTop, and pendingFields().

Referenced by QgsAttributeEditor::createWidgetFromDef(), QgsAttributeDialog::init(), and readSymbology().

void QgsVectorLayer::layerDeleted ( )
signal

Referenced by ~QgsVectorLayer().

void QgsVectorLayer::layerModified ( )
signal

This signal is emitted when modifications has been done on layer.

Referenced by addAttributeAlias(), and startEditing().

int QgsVectorLayer::layerTransparency ( ) const
void QgsVectorLayer::layerTransparencyChanged ( int  layerTransparency)
signal

Signal emitted when setLayerTransparency() is called.

Referenced by setLayerTransparency().

int QgsVectorLayer::listStylesInDatabase ( QStringList &  ids,
QStringList &  names,
QStringList &  descriptions,
QString &  msgError 
)
virtual

Lists all the style in db split into related to the layer and not related to.

Parameters
idsthe list in which will be stored the style db ids
namesthe list in which will be stored the style names
descriptionsthe list in which will be stored the style descriptions
msgError
Returns
the number of styles related to current layer

Definition at line 3792 of file qgsvectorlayer.cpp.

References cast_to_fptr, QgsProviderRegistry::instance(), QgsMapLayer::mDataSource, mProviderKey, QgsProviderRegistry::providerLibrary(), and tr.

QString QgsVectorLayer::loadNamedStyle ( const QString &  theURI,
bool &  theResultFlag,
bool  loadFromLocalDb 
)
virtual

Load a named style from file/local db/datasource db.

Parameters
theURIthe URI of the style or the URI of the layer
theResultFlagwill be set to true if a named style is correctly loaded
loadFromLocalDbif true forces to load from local db instead of datasource one

Definition at line 3882 of file qgsvectorlayer.cpp.

References applyNamedStyle(), cast_to_fptr, QgsDataSourceURI::database(), QgsProviderRegistry::instance(), QgsMapLayer::loadNamedStyle(), QgsMapLayer::mDataSource, mProviderKey, QgsProviderRegistry::providerLibrary(), and tr.

Referenced by loadNamedStyle().

QString QgsVectorLayer::loadNamedStyle ( const QString &  theURI,
bool &  theResultFlag 
)
virtual

Calls loadNamedStyle( theURI, theResultFlag, false ); Retained for backward compatibility.

Reimplemented from QgsMapLayer.

Definition at line 3877 of file qgsvectorlayer.cpp.

References loadNamedStyle().

QVariant QgsVectorLayer::maximumValue ( int  index)
QString QgsVectorLayer::metadata ( )
virtual
QVariant QgsVectorLayer::minimumValue ( int  index)
void QgsVectorLayer::modifySelection ( QgsFeatureIds  selectIds,
QgsFeatureIds  deselectIds 
)

Modifies the current selection on this layer.

Parameters
selectIdsSelect these ids
deselectIdsDeselect these ids
See Also
select(QgsFeatureIds)
select(QgsFeatureId)
deselect(QgsFeatureIds)
deselect(QgsFeatureId)

Definition at line 488 of file qgsvectorlayer.cpp.

References mSelectedFeatureIds, QgsDebugMsg, and selectionChanged().

Referenced by invertSelectionInRectangle().

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 1022 of file qgsvectorlayer.cpp.

References mDataProvider, mEditBuffer, and QgsVectorLayerEditUtils::moveVertex().

void QgsVectorLayer::onRelationsLoaded ( )
privateslot
QgsVectorLayer& QgsVectorLayer::operator= ( QgsVectorLayer const &  rhs)
private

vector layers are not copyable

QgsAttributeList QgsVectorLayer::pendingAllAttributesList ( )
int QgsVectorLayer::pendingFeatureCount ( )
const QgsFields & QgsVectorLayer::pendingFields ( ) const

returns field list in the to-be-committed state

Definition at line 2326 of file qgsvectorlayer.cpp.

References mUpdatedFields.

Referenced by QgsAttributeDialog::accept(), QgsVectorLayerEditBuffer::addAttribute(), addAttributeAlias(), QgsPalLabeling::addDiagramLayer(), QgsOfflineEditing::applyFeaturesAdded(), attributeAlias(), attributeDisplayName(), QgsGeometryAnalyzer::buffer(), QgsVectorLayerJoinBuffer::cacheJoinLayer(), QgsGeometryAnalyzer::centroids(), QgsVectorLayerEditBuffer::changeAttributeValue(), checkedState(), QgsDualView::columnBoxInit(), QgsVectorLayerEditBuffer::commitChanges(), QgsSearchQueryBuilder::countRecords(), countSymbolFeatures(), QgsAttributeEditor::createAttributeEditor(), QgsFormAnnotationItem::createDesignerWidget(), QgsPointSample::createRandomPoints(), QgsGraduatedSymbolRendererV2::createRenderer(), QgsTransectSample::createSample(), QgsFeatureListModel::data(), QgsAttributeTableModel::data(), dateFormat(), QgsVectorLayerEditBuffer::deleteAttribute(), QgsGeometryAnalyzer::dissolve(), drawLabels(), editType(), QgsAtlasComposition::evalFeatureFilename(), QgsGeometryAnalyzer::eventLayer(), QgsAttributeAction::expandAction(), fieldEditable(), fieldNameIndex(), QgsTransectSample::findBaselineGeometry(), QgsComposerAttributeTable::getFeatureAttributes(), QgsSearchQueryBuilder::getFieldValues(), QgsComposerAttributeTable::getHeaderLabels(), QgsRelation::getRelatedFeaturesRequest(), QgsAttributeTableModel::headerData(), QgsMapToolIdentify::identifyVectorLayer(), QgsVectorLayerImport::importLayer(), QgsDataDefinedButton::init(), QgsAttributeDialog::init(), QgsComposerAttributeTable::initializeAliasMap(), QgsOverlayAnalyzer::intersection(), labelOnTop(), QgsAttributeTableModel::loadAttributes(), QgsExpressionBuilderWidget::loadFieldNames(), QgsRelationAddDlg::loadLayerAttributes(), metadata(), QgsQueryBuilder::on_lstFields_doubleClicked(), QgsExpressionSelectionDialog::on_mActionAddToSelection_triggered(), QgsExpressionSelectionDialog::on_mActionRemoveFromSelection_triggered(), QgsExpressionSelectionDialog::on_mActionSelect_triggered(), QgsExpressionSelectionDialog::on_mActionSelectInstersect_triggered(), QgsRelationEditorWidget::on_mAddFeatureButton_clicked(), QgsRelationEditorWidget::on_mUnlinkFeatureButton_clicked(), QgsExpressionBuilderWidget::on_txtExpressionString_textChanged(), QgsHighlight::paint(), QgsSearchQueryBuilder::populateFields(), QgsQueryBuilder::populateFields(), QgsAttributeTableModel::prefetchColumnData(), QgsDataDefined::prepareExpression(), QgsVectorLayerFeatureIterator::prepareJoins(), QgsPalLabeling::prepareLayer(), QgsVectorLayerFeatureSource::QgsVectorLayerFeatureSource(), QgsVectorLayerUndoCommandAddAttribute::QgsVectorLayerUndoCommandAddAttribute(), QgsVectorLayerUndoCommandDeleteAttribute::QgsVectorLayerUndoCommandDeleteAttribute(), range(), readSymbology(), QgsAtlasComposition::readXML(), QgsExpression::replaceExpressionText(), QgsAttributeEditor::retrieveValue(), setCheckedState(), setDisplayField(), setEditType(), setFieldEditable(), setLabelOnTop(), QgsAtlasComposition::setSortKeyAttributeIndex(), QgsAttributeEditor::setValue(), QgsGeometryAnalyzer::simplify(), QgsFeatureRendererV2::startRender(), QgsVectorFileWriter::startRender(), QgsVectorLayerUndoCommandAddAttribute::undo(), QgsAtlasComposition::updateFeatures(), QgsVectorLayerJoinBuffer::updateFields(), QgsFieldModel::updateFields(), QgsAtlasComposition::updateFilenameExpression(), valueMap(), valueRelation(), widgetSize(), and QgsVectorFileWriter::writeAsVectorFormat().

QgsAttributeList QgsVectorLayer::pendingPkAttributesList ( )

returns list of attribute making up the primary key

Note
added in 2.0

Definition at line 2336 of file qgsvectorlayer.cpp.

References QgsFields::count(), QgsFields::fieldOrigin(), QgsFields::fieldOriginIndex(), mDataProvider, mUpdatedFields, QgsFields::OriginProvider, and QgsVectorDataProvider::pkAttributeIndexes().

Referenced by QgsDualView::columnBoxInit(), and metadata().

QString QgsVectorLayer::providerType ( ) const
QgsVectorLayer::RangeData & QgsVectorLayer::range ( int  idx)

access range

Definition at line 2792 of file qgsvectorlayer.cpp.

References QgsFields::count(), mRanges, pendingFields(), and QgsDebugMsg.

Referenced by QgsAttributeEditor::createAttributeEditor().

bool QgsVectorLayer::readSld ( const QDomNode &  node,
QString &  errorMessage 
)
virtual
void QgsVectorLayer::readSldLabeling ( const QDomNode &  node)
private
bool QgsVectorLayer::readSymbology ( const QDomNode &  node,
QString &  errorMessage 
)
virtual

Read the symbology for the current layer from the Dom node supplied.

Parameters
nodenode that will contain the symbology definition for this layer.
errorMessagereference to string that will be updated with any error messages
Returns
true in case of success.

Implements QgsMapLayer.

Definition at line 1479 of file qgsvectorlayer.cpp.

References attributeEditorElementFromDomElement(), Calendar, CheckBox, Classification, Color, QgsFeatureRendererV2::defaultRenderer(), DialRange, EditorWidgetV2, EditRange, editType(), enableLabels(), Enumeration, fieldNameIndex(), FileName, GeneratedLayout, geometryType(), QgsMapRenderer::getCompositionMode(), hasGeometryType(), hasLabelsEnabled(), Hidden, Immutable, index, QgsProject::instance(), labelOnTop(), LineEdit, QgsFeatureRendererV2::load(), mActions, mAnnotationForm, mAttributeAliasMap, mAttributeEditorElements, MathUtils::max(), mCheckedStates, mDateFormats, mDiagramLayerSettings, mDiagramRenderer, mEditForm, mEditFormInit, mEditorLayout, mEditTypes, mExcludeAttributesWFS, mExcludeAttributesWMS, mFeatureFormSuppress, mFieldEditables, MathUtils::min(), mLabel, mLabelOnTop, mRanges, mSimplifyMethod, mValueMaps, mValueRelations, mWidgetSize, QgsMapLayer::name(), pendingFields(), Photo, QgsDebugMsg, QgsMapLayer::readCustomProperties(), QgsSymbologyV2Conversion::readOldRenderer(), QgsProject::readPath(), QgsDiagramLayerSettings::readXML(), QgsLabel::readXML(), QgsAttributeAction::readXML(), QgsDiagramRendererV2::readXML(), RENDERER_TAG_NAME, QgsMapLayer::setBlendMode(), setDisplayField(), setFeatureBlendMode(), QgsVectorSimplifyMethod::setForceLocalOptimization(), setLayerTransparency(), QgsVectorSimplifyMethod::setMaximumScale(), QgsLabel::setMaxScale(), QgsLabel::setMinScale(), setRendererV2(), QgsLabel::setScaleBasedVisibility(), QgsVectorSimplifyMethod::setSimplifyHints(), QgsVectorSimplifyMethod::setThreshold(), SliderRange, SuppressDefault, TabLayout, TextEdit, UiFileLayout, UniqueValues, UniqueValuesEditable, UuidGenerator, ValueMap, ValueRelation, and WebView.

Referenced by applyNamedStyle(), QgsOfflineEditing::copySymbology(), and readXml().

bool QgsVectorLayer::readXml ( const QDomNode &  layer_node)
virtual
QList< QgsRelation > QgsVectorLayer::referencingRelations ( int  idx)

Get relations, where the foreign key is on this layer.

Parameters
idxOnly get relations, where idx forms part of the foreign key
Returns
A list of relations

Definition at line 3731 of file qgsvectorlayer.cpp.

References QgsProject::instance(), QgsRelationManager::referencingRelations(), and QgsProject::relationManager().

void QgsVectorLayer::reload ( )
virtual

Synchronises with changes in the datasource.

Note
added in version 1.6

Reimplemented from QgsMapLayer.

Definition at line 393 of file qgsvectorlayer.cpp.

References mDataProvider, and QgsDataProvider::reloadData().

Referenced by QgsOfflineEditing::synchronize().

void QgsVectorLayer::removeJoin ( const QString &  joinLayerId)

Removes a vector layer join.

Note
added in 1.7

Definition at line 2946 of file qgsvectorlayer.cpp.

References mJoinBuffer, QgsVectorLayerJoinBuffer::removeJoin(), and updateFields().

Referenced by checkJoinLayerRemove().

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.

Parameters
geomgeometry to modify
ignoreFeatureslist of feature ids where intersections should be ignored
Returns
0 in case of success
Deprecated:
since 2.2 - not being used for "avoid intersections" functionality anymore

Definition at line 1128 of file qgsvectorlayer.cpp.

References QgsGeometry::boundingBox(), QgsFeatureRequest::ExactIntersect, QgsFeature::geometry(), getFeatures(), hasGeometryType(), QgsFeature::id(), QgsGeometry::makeDifference(), QgsFeatureIterator::nextFeature(), QGis::Polygon, and QgsGeometry::type().

void QgsVectorLayer::removeSelection ( )
slot

Clear selection.

See Also
setSelectedFeatures(const QgsFeatureIds&)

Definition at line 560 of file qgsvectorlayer.cpp.

References mSelectedFeatureIds, and setSelectedFeatures().

void QgsVectorLayer::rendererChanged ( )
signal

Signal emitted on symbology changes, when setRendererV2() is called.

Referenced by setRendererV2().

QgsFeatureRendererV2 * QgsVectorLayer::rendererV2 ( )
bool QgsVectorLayer::rollBack ( bool  deleteBuffer = true)

Stop editing and discard the edits.

Parameters
deleteBufferwhether to delete editing buffer (added in 1.9)

Definition at line 2407 of file qgsvectorlayer.cpp.

References beforeRollBack(), QgsGeometryCache::deleteCachedGeometries(), editingStopped(), isModified(), mCache, mEditBuffer, QgsMapLayer::repaintRequested(), QgsVectorLayerEditBuffer::rollBack(), QgsMapLayer::undoStack(), and updateFields().

void QgsVectorLayer::saveLayerToProject ( )
signal
void QgsVectorLayer::saveStyleToDatabase ( QString  name,
QString  description,
bool  useAsDefault,
QString  uiFileContent,
QString &  msgError 
)
virtual

Save named and sld style of the layer to the style table in the db.

Parameters
name
description
useAsDefault
uiFileContent
msgError

Definition at line 3835 of file qgsvectorlayer.cpp.

References cast_to_fptr, QgsMapLayer::exportNamedStyle(), QgsMapLayer::exportSldStyle(), QgsProviderRegistry::instance(), QgsMapLayer::mDataSource, mProviderKey, QgsProviderRegistry::providerLibrary(), and tr.

void QgsVectorLayer::select ( QgsRectangle rect,
bool  addToSelection 
)

Select features found within the search rectangle (in layer's coordinates)

Parameters
rectThe search rectangle
addToSelectionIf set to true will not clear before selecting
See Also
invertSelectionInRectangle(QgsRectangle & rect)

Definition at line 459 of file qgsvectorlayer.cpp.

References QgsFeatureRequest::ExactIntersect, getFeatures(), QgsFeature::id(), mSelectedFeatureIds, QgsFeatureIterator::nextFeature(), QgsFeatureRequest::NoGeometry, QgsRectangle::normalize(), and setSelectedFeatures().

Referenced by QgsVectorLayerSelectionManager::select().

void QgsVectorLayer::select ( const QgsFeatureId featureId)
slot

Select feature by its ID.

Parameters
featureIdThe id of the feature to select
See Also
select(QgsFeatureIds)

Definition at line 431 of file qgsvectorlayer.cpp.

References mSelectedFeatureIds, and selectionChanged().

void QgsVectorLayer::select ( const QgsFeatureIds featureIds)
slot

Select features by their ID.

Parameters
featureIdsThe ids of the features to select
See Also
select(QgsFeatureId)

Definition at line 438 of file qgsvectorlayer.cpp.

References mSelectedFeatureIds, and selectionChanged().

void QgsVectorLayer::selectAll ( )

Select all the features.

Definition at line 509 of file qgsvectorlayer.cpp.

References allFeatureIds(), and setSelectedFeatures().

int QgsVectorLayer::selectedFeatureCount ( )

The number of features that are selected in this layer.

Returns
See description

Definition at line 2453 of file qgsvectorlayer.cpp.

References mSelectedFeatureIds.

Referenced by QgsMapCanvas::panToSelected(), QgsVectorLayerSelectionManager::selectedFeatureCount(), and QgsMapCanvas::zoomToSelected().

QgsFeatureList QgsVectorLayer::selectedFeatures ( )
const QgsFeatureIds & QgsVectorLayer::selectedFeaturesIds ( ) const
void QgsVectorLayer::selectionChanged ( const QgsFeatureIds  selected,
const QgsFeatureIds  deselected,
const bool  clearAndSelect 
)
signal

This signal is emitted when selection was changed.

Parameters
selectedNewly selected feature ids
deselectedIds of all features which have previously been selected but are not any more
clearAndSelectIn case this is set to true, the old selection was dismissed and the new selection corresponds to selected
void QgsVectorLayer::selectionChanged ( )
signal

This signal is emitted when selection was changed.

Referenced by deselect(), modifySelection(), QgsVectorLayer(), select(), and setSelectedFeatures().

void QgsVectorLayer::setAnnotationForm ( const QString &  ui)

set annotation form for layer (added in 1.5)

Definition at line 2758 of file qgsvectorlayer.cpp.

References mAnnotationForm.

void QgsVectorLayer::setCheckedState ( int  idx,
QString  checked,
QString  notChecked 
)

set string representing 'true' for a checkbox (added in 1.4)

Definition at line 2914 of file qgsvectorlayer.cpp.

References QgsFields::count(), mCheckedStates, QgsMapLayer::name(), and pendingFields().

void QgsVectorLayer::setCoordinateSystem ( )

Setup the coordinate system tranformation for the layer.

Definition at line 2651 of file qgsvectorlayer.cpp.

References QgsDataProvider::crs(), GEO_EPSG_CRS_AUTHID, hasGeometryType(), mDataProvider, QgsDebugMsg, and QgsMapLayer::setCrs().

Referenced by QgsVectorLayer().

bool QgsVectorLayer::setDataProvider ( QString const &  provider)
private
void QgsVectorLayer::setDiagramLayerSettings ( const QgsDiagramLayerSettings s)

Definition at line 3427 of file qgsvectorlayer.cpp.

References mDiagramLayerSettings.

void QgsVectorLayer::setDiagramRenderer ( QgsDiagramRendererV2 r)

Sets diagram rendering object (takes ownership)

Definition at line 592 of file qgsvectorlayer.cpp.

References mDiagramRenderer.

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.

Parameters
displayExpressionThe expression which will be used to preview features for this layer
Note
added in 2.0

Definition at line 2677 of file qgsvectorlayer.cpp.

References displayExpression(), and mDisplayExpression.

Referenced by QgsDualView::previewExpressionChanged().

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 248 of file qgsvectorlayer.cpp.

References QgsFields::count(), hasGeometryType(), mDisplayField, pendingFields(), QgsDebugMsg, and QgsFields::size().

Referenced by readSymbology(), and setDataProvider().

void QgsVectorLayer::setEditForm ( QString  ui)

set edit form (added in 1.4)

Definition at line 2753 of file qgsvectorlayer.cpp.

References mEditForm.

void QgsVectorLayer::setEditFormInit ( QString  function)

set python function for edit form initialization (added in 1.4)

Definition at line 2768 of file qgsvectorlayer.cpp.

References mEditFormInit.

void QgsVectorLayer::setEditorLayout ( EditorLayout  editorLayout)

set the active layout for the attribute editor for this layer (added in 1.9)

Definition at line 2733 of file qgsvectorlayer.cpp.

References editorLayout(), and mEditorLayout.

void QgsVectorLayer::setEditorWidgetV2 ( int  attrIdx,
const QString &  widgetType 
)

Definition at line 2738 of file qgsvectorlayer.cpp.

References mEditorWidgetV2Types.

void QgsVectorLayer::setEditorWidgetV2Config ( int  attrIdx,
const QMap< QString, QVariant > &  config 
)

Definition at line 2743 of file qgsvectorlayer.cpp.

References mEditorWidgetV2Configs.

void QgsVectorLayer::setEditType ( int  idx,
EditType  edit 
)

set edit type

Definition at line 2721 of file qgsvectorlayer.cpp.

References QgsFields::count(), mEditTypes, QgsMapLayer::name(), pendingFields(), and QgsMapLayer::type().

void QgsVectorLayer::setExcludeAttributesWFS ( const QSet< QString > &  att)
inline

Definition at line 1152 of file qgsvectorlayer.h.

void QgsVectorLayer::setExcludeAttributesWMS ( const QSet< QString > &  att)
inline

Definition at line 1149 of file qgsvectorlayer.h.

void QgsVectorLayer::setExtent ( const QgsRectangle rect)
protectedvirtual

Set the extent.

Reimplemented from QgsMapLayer.

Definition at line 812 of file qgsvectorlayer.cpp.

References mValidExtent, and QgsMapLayer::setExtent().

Referenced by extent().

void QgsVectorLayer::setFeatureBlendMode ( const QPainter::CompositionMode &  blendMode)

Write blend mode for features.

Definition at line 3165 of file qgsvectorlayer.cpp.

References featureBlendMode(), featureBlendModeChanged(), and mFeatureBlendMode.

Referenced by readSymbology().

void QgsVectorLayer::setFeatureFormSuppress ( QgsVectorLayer::FeatureFormSuppress  s)
inline

Set type of feature form pop-up suppression after feature creation (overrides app setting)

Note
added in 2.1

Definition at line 1232 of file qgsvectorlayer.h.

void QgsVectorLayer::setFieldEditable ( int  idx,
bool  editable 
)

set edit widget editable

Note
added in 1.9

Definition at line 2857 of file qgsvectorlayer.cpp.

References QgsFields::count(), mFieldEditables, QgsMapLayer::name(), and pendingFields().

void QgsVectorLayer::setLabelOnTop ( int  idx,
bool  onTop 
)

label widget on top

Note
added in 1.9

Definition at line 2864 of file qgsvectorlayer.cpp.

References QgsFields::count(), mLabelOnTop, QgsMapLayer::name(), and pendingFields().

void QgsVectorLayer::setLayerTransparency ( int  layerTransparency)

Write transparency for layer.

Definition at line 3178 of file qgsvectorlayer.cpp.

References layerTransparency(), layerTransparencyChanged(), and mLayerTransparency.

Referenced by readSymbology().

void QgsVectorLayer::setProviderEncoding ( const QString &  encoding)

Sets the textencoding of the data provider.

Definition at line 583 of file qgsvectorlayer.cpp.

References mDataProvider, QgsVectorDataProvider::setEncoding(), and updateFields().

bool QgsVectorLayer::setReadOnly ( bool  readonly = true)

Make layer read-only (editing disabled) or not.

Returns
false if the layer is in editing yet
Note
added in 1.6

Definition at line 2697 of file qgsvectorlayer.cpp.

References mEditBuffer, and mReadOnly.

void QgsVectorLayer::setRendererV2 ( QgsFeatureRendererV2 r)

Set renderer V2.

Note
added in 1.4

Definition at line 2876 of file qgsvectorlayer.cpp.

References hasGeometryType(), mRendererV2, mSymbolFeatureCounted, mSymbolFeatureCountMap, and rendererChanged().

Referenced by QgsVectorLayer(), readSld(), and readSymbology().

void QgsVectorLayer::setSelectedFeatures ( const QgsFeatureIds ids)
void QgsVectorLayer::setSimplifyMethod ( const QgsVectorSimplifyMethod simplifyMethod)
inline

Set the simplification settings for fast rendering of features.

Note
added in 2.2

Definition at line 1377 of file qgsvectorlayer.h.

bool QgsVectorLayer::setSubsetString ( QString  subset)
virtual

Set the string (typically sql) used to define a subset of the layer.

Parameters
subsetThe subset string. This may be the where clause of a sql statement or other defintion string specific to the underlying dataprovider and data store.
Returns
true, when setting the subset string was successful, false otherwise (added in 1.4)

Definition at line 910 of file qgsvectorlayer.cpp.

References QgsDataProvider::dataSourceUri(), mDataProvider, QgsMapLayer::mDataSource, QgsDebugMsg, QgsMapLayer::repaintRequested(), QgsDataProvider::setSubsetString(), and updateExtents().

Referenced by QgsQueryBuilder::accept(), QgsQueryBuilder::clear(), QgsOfflineEditing::copyVectorLayer(), QgsQueryBuilder::on_btnGetAllValues_clicked(), QgsQueryBuilder::on_btnSampleValues_clicked(), QgsQueryBuilder::reject(), and QgsQueryBuilder::test().

bool QgsVectorLayer::simplifyDrawingCanbeApplied ( const QgsRenderContext renderContext,
QgsVectorSimplifyMethod::SimplifyHint  simplifyHint 
) const

Returns whether the VectorLayer can apply the specified simplification hint.

Note
Do not use in 3rd party code - may be removed in future version!
added in 2.2

Definition at line 930 of file qgsvectorlayer.cpp.

References geometryType(), hasGeometryType(), QgsVectorSimplifyMethod::maximumScale(), mDataProvider, mEditBuffer, mSimplifyMethod, QGis::Point, QgsRenderContext::rendererScale(), QgsVectorSimplifyMethod::simplifyHints(), and QgsRenderContext::useRenderingOptimization().

Referenced by QgsVectorLayerRenderer::QgsVectorLayerRenderer().

const QgsVectorSimplifyMethod& QgsVectorLayer::simplifyMethod ( ) const
inline

Returns the simplification settings for fast rendering of features.

Note
added in 2.2

Definition at line 1381 of file qgsvectorlayer.h.

Referenced by QgsVectorLayerRenderer::QgsVectorLayerRenderer().

bool QgsVectorLayer::snapPoint ( QgsPoint point,
double  tolerance 
)

Snaps a point to the closest vertex if there is one within the snapping tolerance.

Parameters
pointThe 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.
toleranceThe snapping tolerance
Returns
true if the point has been snapped, false if no vertex within search tolerance

Definition at line 2504 of file qgsvectorlayer.cpp.

References hasGeometryType(), QgsPoint::setX(), QgsPoint::setY(), QgsSnapper::SnapToVertex, and snapWithContext().

void QgsVectorLayer::snapToGeometry ( const QgsPoint startPoint,
QgsFeatureId  featureId,
QgsGeometry geom,
double  sqrSnappingTolerance,
QMultiMap< double, QgsSnappingResult > &  snappingResults,
QgsSnapper::SnappingType  snap_to 
) const
private

Snaps to a geometry and adds the result to the multimap if it is within the snapping result.

Parameters
startPointstart point of the snap
featureIdid of feature
geomgeometry to snap
sqrSnappingTolerancesquared search tolerance of the snap
snappingResultslist to which the result is appended
snap_tosnap to vertex or to segment

Definition at line 2581 of file qgsvectorlayer.cpp.

References QgsSnappingResult::afterVertex, QgsSnappingResult::afterVertexNr, QgsSnappingResult::beforeVertex, QgsSnappingResult::beforeVertexNr, QgsGeometry::closestSegmentWithContext(), QgsGeometry::closestVertex(), QgsMapLayer::crs(), geometryType(), QgsSnappingResult::layer, QGis::Point, QgsSnappingResult::snappedAtGeometry, QgsSnappingResult::snappedVertex, QgsSnappingResult::snappedVertexNr, QgsSnapper::SnapToSegment, QgsSnapper::SnapToVertex, QgsSnapper::SnapToVertexAndSegment, and QgsGeometry::vertexAt().

Referenced by snapWithContext().

int QgsVectorLayer::snapWithContext ( const QgsPoint startPoint,
double  snappingTolerance,
QMultiMap< double, QgsSnappingResult > &  snappingResults,
QgsSnapper::SnappingType  snap_to 
)

Snaps to segment or vertex within given tolerance.

Parameters
startPointpoint to snap (in layer coordinates)
snappingTolerancedistance tolerance for snapping
snappingResultssnapping results. Key is the distance between startPoint and snapping target
snap_toto segment / to vertex
Returns
0 in case of success

Definition at line 2529 of file qgsvectorlayer.cpp.

References QgsGeometry::boundingBox(), QgsGeometryCache::cachedGeometries(), QgsGeometryCache::cachedGeometriesRect(), QgsRectangle::contains(), QgsFeatureRequest::ExactIntersect, QgsFeature::geometry(), getFeatures(), hasGeometryType(), QgsFeature::id(), QgsRectangle::intersects(), mCache, mDataProvider, QgsFeatureIterator::nextFeature(), snapToGeometry(), QgsPoint::x(), and QgsPoint::y().

Referenced by QgsVectorLayerEditUtils::addTopologicalPoints(), and snapPoint().

int QgsVectorLayer::splitFeatures ( const QList< QgsPoint > &  splitLine,
bool  topologicalEditing = false 
)

Splits features cut by the given line.

Parameters
splitLineline that splits the layer features
topologicalEditingtrue if topological editing is enabled
Returns
0 in case of success, 4 if there is a selection but no feature split

Definition at line 1119 of file qgsvectorlayer.cpp.

References mDataProvider, mEditBuffer, and QgsVectorLayerEditUtils::splitFeatures().

int QgsVectorLayer::splitParts ( const QList< QgsPoint > &  splitLine,
bool  topologicalEditing = false 
)

Splits parts cut by the given line.

Parameters
splitLineline that splits the layer features
topologicalEditingtrue if topological editing is enabled
Returns
0 in case of success, 4 if there is a selection but no feature split

Definition at line 1110 of file qgsvectorlayer.cpp.

References mDataProvider, mEditBuffer, and QgsVectorLayerEditUtils::splitParts().

bool QgsVectorLayer::startEditing ( )
QString QgsVectorLayer::storageType ( ) const
QString QgsVectorLayer::subsetString ( )
virtual

Get the string (typically sql) used to define a subset of the layer.

Returns
The subset string or QString::null if not implemented by the provider

Definition at line 900 of file qgsvectorlayer.cpp.

References mDataProvider, QgsDebugMsg, and QgsDataProvider::subsetString().

Referenced by QgsQueryBuilder::on_btnGetAllValues_clicked(), QgsQueryBuilder::on_btnSampleValues_clicked(), QgsQueryBuilder::QgsQueryBuilder(), QgsQueryBuilder::reject(), and QgsQueryBuilder::test().

int QgsVectorLayer::translateFeature ( QgsFeatureId  featureId,
double  dx,
double  dy 
)

Translates feature by dx, dy.

Parameters
featureIdid of the feature to translate
dxtranslation of x-coordinate
dytranslation of y-coordinate
Returns
0 in case of success

Definition at line 1101 of file qgsvectorlayer.cpp.

References mDataProvider, mEditBuffer, and QgsVectorLayerEditUtils::translateFeature().

void QgsVectorLayer::triggerRepaint ( )
slot

Definition at line 568 of file qgsvectorlayer.cpp.

References QgsMapLayer::repaintRequested().

Referenced by deleteSelectedFeatures().

void QgsVectorLayer::uniqueValues ( int  index,
QList< QVariant > &  uniqueValues,
int  limit = -1 
)
void QgsVectorLayer::updatedFields ( )
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.

Note
Added in 2.0

Referenced by updateFields().

void QgsVectorLayer::updateExtents ( )
virtualslot

Update the extents for the layer.

This is necessary if features are added/deleted or the layer has been subsetted.

Definition at line 807 of file qgsvectorlayer.cpp.

References mValidExtent.

Referenced by addFeature(), QgsVectorLayerEditBuffer::addFeatures(), addFeatures(), changeGeometry(), deleteFeature(), deleteSelectedFeatures(), setDataProvider(), and setSubsetString().

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.

Parameters
fFeature to update
Returns
True in case of success and False in case of error
Note
Added in 1.8

Definition at line 968 of file qgsvectorlayer.cpp.

References QgsFeature::attributes(), changeAttributeValue(), changeGeometry(), QgsFeature::geometry(), getFeatures(), QgsFeature::id(), QgsGeometry::isGeosEqual(), QgsFeatureRequest::NoGeometry, QgsDebugMsg, QgsFeatureRequest::setFilterFid(), QgsFeatureRequest::setFlags(), and QgsFeatureRequest::setSubsetOfAttributes().

void QgsVectorLayer::updateFields ( )
QMap< QString, QVariant > & QgsVectorLayer::valueMap ( int  idx)

access value map

Definition at line 2773 of file qgsvectorlayer.cpp.

References QgsFields::count(), mValueMaps, pendingFields(), and QgsDebugMsg.

Referenced by QgsAttributeEditor::createAttributeEditor().

QgsVectorLayer::ValueRelationData & QgsVectorLayer::valueRelation ( int  idx)

access relations

Note
added in 1.8

Definition at line 3710 of file qgsvectorlayer.cpp.

References QgsFields::count(), mValueRelations, pendingFields(), and QgsDebugMsg.

Referenced by QgsAttributeEditor::createAttributeEditor(), and QgsAttributeTableModel::loadAttributes().

const QList< QgsVectorJoinInfo > & QgsVectorLayer::vectorJoins ( ) const
Note
added in 1.7

Definition at line 2952 of file qgsvectorlayer.cpp.

References mJoinBuffer, and QgsVectorLayerJoinBuffer::vectorJoins().

Referenced by QgsProject::addLayer().

QSize & QgsVectorLayer::widgetSize ( int  idx)

access widget size for photo and webview widget

Note
added in 1.9

Definition at line 2823 of file qgsvectorlayer.cpp.

References mWidgetSize, and pendingFields().

Referenced by QgsAttributeEditor::createAttributeEditor(), and QgsAttributeEditor::loadPixmap().

QGis::WkbType QgsVectorLayer::wkbType ( ) const

Returns the WKBType or WKBUnknown in case of error.

Definition at line 655 of file qgsvectorlayer.cpp.

References mWkbType.

Referenced by QgsOfflineEditing::copyVectorLayer(), QgsVectorLayerImport::importLayer(), and QgsVectorFileWriter::writeAsVectorFormat().

bool QgsVectorLayer::writeSld ( QDomNode &  node,
QDomDocument &  doc,
QString &  errorMessage 
) const
bool QgsVectorLayer::writeSymbology ( QDomNode &  node,
QDomDocument &  doc,
QString &  errorMessage 
) const
virtual

Write the symbology for the layer into the docment provided.

Parameters
nodethe node that will have the style element added to it.
docthe document that will have the QDomNode added.
errorMessagereference to string that will be updated with any error messages
Returns
true in case of success.

Implements QgsMapLayer.

Definition at line 1868 of file qgsvectorlayer.cpp.

References QgsMapLayer::blendMode(), Calendar, CheckBox, Classification, Color, DialRange, displayField(), EditorWidgetV2, EditRange, Enumeration, featureBlendMode(), featureFormSuppress(), fieldNameIndex(), FileName, QgsVectorSimplifyMethod::forceLocalOptimization(), GeneratedLayout, QgsMapRenderer::getBlendModeEnum(), hasGeometryType(), hasLabelsEnabled(), Hidden, Immutable, QgsProject::instance(), QgsLabel::labelField(), layerTransparency(), LineEdit, mActions, QgsVectorLayer::ValueRelationData::mAllowMulti, QgsVectorLayer::ValueRelationData::mAllowNull, mAnnotationForm, mAttributeAliasMap, mAttributeEditorElements, QgsVectorSimplifyMethod::maximumScale(), QgsLabel::maxScale(), mCheckedStates, mDateFormats, mDiagramLayerSettings, mDiagramRenderer, mEditForm, mEditFormInit, mEditorLayout, mEditTypes, mExcludeAttributesWFS, mExcludeAttributesWMS, mFieldEditables, QgsVectorLayer::ValueRelationData::mFilterExpression, QgsLabel::minScale(), QgsVectorLayer::ValueRelationData::mKey, mLabel, mLabelOnTop, QgsVectorLayer::ValueRelationData::mLayer, QgsVectorLayer::ValueRelationData::mOrderByValue, mRanges, mRendererV2, mSimplifyMethod, QgsVectorLayer::ValueRelationData::mValue, mValueMaps, mValueRelations, mWidgetSize, Photo, QgsFeatureRendererV2::save(), QgsLabel::scaleBasedVisibility(), QgsVectorSimplifyMethod::simplifyHints(), SliderRange, TabLayout, QgsLabel::Text, TextEdit, QgsVectorSimplifyMethod::threshold(), UiFileLayout, UniqueValues, UniqueValuesEditable, UuidGenerator, ValueMap, ValueRelation, WebView, QgsMapLayer::writeCustomProperties(), QgsDiagramLayerSettings::writeXML(), QgsLabel::writeXML(), QgsAttributeAction::writeXML(), and QgsDiagramRendererV2::writeXML().

Referenced by QgsOfflineEditing::copySymbology(), and writeXml().

bool QgsVectorLayer::writeXml ( QDomNode &  layer_node,
QDomDocument &  doc 
)
virtual

write vector layer specific state to project file Dom node.

Note
Called by QgsMapLayer::writeXML().

Reimplemented from QgsMapLayer.

Definition at line 1437 of file qgsvectorlayer.cpp.

References QgsVectorDataProvider::encoding(), geometryType(), mDataProvider, mDisplayExpression, mJoinBuffer, providerType(), QgsDebugMsg, QGis::vectorGeometryType(), writeSymbology(), and QgsVectorLayerJoinBuffer::writeXml().

Friends And Related Function Documentation

friend class QgsVectorLayerEditBuffer
friend

Definition at line 1707 of file qgsvectorlayer.h.

Referenced by startEditing().

friend class QgsVectorLayerFeatureSource
friend

Definition at line 1727 of file qgsvectorlayer.h.

Referenced by getFeatures().

Member Data Documentation

QgsAttributeAction* QgsVectorLayer::mActions
private

The user-defined actions that are accessed from the Identify Results dialog box.

Definition at line 1614 of file qgsvectorlayer.h.

Referenced by QgsVectorLayer(), readSymbology(), writeSymbology(), and ~QgsVectorLayer().

QString QgsVectorLayer::mAnnotationForm
private

Definition at line 1700 of file qgsvectorlayer.h.

Referenced by readSymbology(), setAnnotationForm(), and writeSymbology().

QMap< QString, QString > QgsVectorLayer::mAttributeAliasMap
private

Map that stores the aliases for attributes.

Key is the attribute name and value the alias for that attribute

Definition at line 1629 of file qgsvectorlayer.h.

Referenced by addAttributeAlias(), attributeAlias(), readSymbology(), and writeSymbology().

QList< QgsAttributeEditorElement* > QgsVectorLayer::mAttributeEditorElements
private

Stores a list of attribute editor elements (Each holding a tree structure for a tab in the attribute editor)

Definition at line 1632 of file qgsvectorlayer.h.

Referenced by addAttributeEditorWidget(), attributeEditorElements(), clearAttributeEditorWidgets(), onRelationsLoaded(), readSymbology(), and writeSymbology().

QgsGeometryCache* QgsVectorLayer::mCache
private

cache for some vector layer data - currently only geometries for faster editing

Definition at line 1703 of file qgsvectorlayer.h.

Referenced by commitChanges(), rollBack(), snapWithContext(), and ~QgsVectorLayer().

QMap< QString, QPair<QString, QString> > QgsVectorLayer::mCheckedStates
private

Definition at line 1682 of file qgsvectorlayer.h.

Referenced by checkedState(), readSymbology(), setCheckedState(), and writeSymbology().

QStringList QgsVectorLayer::mCommitErrors
private

Definition at line 1675 of file qgsvectorlayer.h.

Referenced by commitChanges(), and commitErrors().

int QgsVectorLayer::mCurrentVertexMarkerSize
private

The current size of editing marker.

Definition at line 1670 of file qgsvectorlayer.h.

QgsVectorLayer::VertexMarkerType QgsVectorLayer::mCurrentVertexMarkerType
private

The current type of editing marker.

Definition at line 1667 of file qgsvectorlayer.h.

QgsVectorDataProvider* QgsVectorLayer::mDataProvider
private
QMap< QString, QString> QgsVectorLayer::mDateFormats
private

Definition at line 1684 of file qgsvectorlayer.h.

Referenced by dateFormat(), readSymbology(), and writeSymbology().

QgsDiagramLayerSettings* QgsVectorLayer::mDiagramLayerSettings
private
QgsDiagramRendererV2* QgsVectorLayer::mDiagramRenderer
private

Definition at line 1713 of file qgsvectorlayer.h.

Referenced by readSymbology(), setDiagramRenderer(), and writeSymbology().

QString QgsVectorLayer::mDisplayExpression
private

the preview expression used to generate a human readable preview string for features

Definition at line 1608 of file qgsvectorlayer.h.

Referenced by displayExpression(), readXml(), setDisplayExpression(), and writeXml().

QString QgsVectorLayer::mDisplayField
private

index of the primary label field

Definition at line 1605 of file qgsvectorlayer.h.

Referenced by displayField(), and setDisplayField().

QgsVectorLayerEditBuffer* QgsVectorLayer::mEditBuffer
private
QString QgsVectorLayer::mEditForm
private

Definition at line 1693 of file qgsvectorlayer.h.

Referenced by editForm(), readSymbology(), setEditForm(), and writeSymbology().

QString QgsVectorLayer::mEditFormInit
private

Definition at line 1693 of file qgsvectorlayer.h.

Referenced by editFormInit(), readSymbology(), setEditFormInit(), and writeSymbology().

EditorLayout QgsVectorLayer::mEditorLayout
private

Defines the default layout to use for the attribute editor (Drag and drop, UI File, Generated)

Definition at line 1691 of file qgsvectorlayer.h.

Referenced by editorLayout(), readSymbology(), setEditorLayout(), and writeSymbology().

QMap<int, QMap<QString, QVariant> > QgsVectorLayer::mEditorWidgetV2Configs
private

Definition at line 1688 of file qgsvectorlayer.h.

Referenced by editorWidgetV2Config(), and setEditorWidgetV2Config().

QMap<int, QString> QgsVectorLayer::mEditorWidgetV2Types
private

Definition at line 1687 of file qgsvectorlayer.h.

Referenced by editorWidgetV2(), and setEditorWidgetV2().

QMap< QString, EditType > QgsVectorLayer::mEditTypes
private

Definition at line 1677 of file qgsvectorlayer.h.

Referenced by editType(), readSymbology(), setEditType(), and writeSymbology().

QSet<QString> QgsVectorLayer::mExcludeAttributesWFS
private

Attributes which are not published in WFS.

Definition at line 1637 of file qgsvectorlayer.h.

Referenced by readSymbology(), and writeSymbology().

QSet<QString> QgsVectorLayer::mExcludeAttributesWMS
private

Attributes which are not published in WMS.

Definition at line 1635 of file qgsvectorlayer.h.

Referenced by readSymbology(), and writeSymbology().

QPainter::CompositionMode QgsVectorLayer::mFeatureBlendMode
private

Blend mode for features.

Definition at line 1661 of file qgsvectorlayer.h.

Referenced by featureBlendMode(), and setFeatureBlendMode().

QgsVectorLayer::FeatureFormSuppress QgsVectorLayer::mFeatureFormSuppress
private

Type of feature form suppression after feature creation.

Note
added in 2.1

Definition at line 1697 of file qgsvectorlayer.h.

Referenced by readSymbology().

QMap< QString, bool> QgsVectorLayer::mFieldEditables
private

Definition at line 1678 of file qgsvectorlayer.h.

Referenced by fieldEditable(), readSymbology(), setFieldEditable(), and writeSymbology().

QgsVectorLayerJoinBuffer* QgsVectorLayer::mJoinBuffer
private
QgsLabel* QgsVectorLayer::mLabel
private
bool QgsVectorLayer::mLabelFontNotFoundNotified
private

Whether 'labeling font not found' has be shown for this layer (only show once in QgsMessageBar, on first rendering)

Definition at line 1658 of file qgsvectorlayer.h.

bool QgsVectorLayer::mLabelOn
private

Display labels.

Definition at line 1655 of file qgsvectorlayer.h.

Referenced by drawLabels(), enableLabels(), hasLabelsEnabled(), and setDataProvider().

QMap< QString, bool> QgsVectorLayer::mLabelOnTop
private

Definition at line 1679 of file qgsvectorlayer.h.

Referenced by labelOnTop(), readSymbology(), setLabelOnTop(), and writeSymbology().

int QgsVectorLayer::mLayerTransparency
private

Layer transparency.

Definition at line 1664 of file qgsvectorlayer.h.

Referenced by layerTransparency(), and setLayerTransparency().

bool QgsVectorLayer::mLazyExtent
private

Definition at line 1719 of file qgsvectorlayer.h.

Referenced by extent().

QString QgsVectorLayer::mProviderKey
private
QMap< QString, RangeData > QgsVectorLayer::mRanges
private

Definition at line 1681 of file qgsvectorlayer.h.

Referenced by range(), readSymbology(), and writeSymbology().

bool QgsVectorLayer::mReadOnly
private

Flag indicating whether the layer is in read-only mode (editing disabled) or not.

Definition at line 1617 of file qgsvectorlayer.h.

Referenced by isReadOnly(), setReadOnly(), and startEditing().

QgsFeatureRendererV2* QgsVectorLayer::mRendererV2
private

Renderer object which holds the information about how to display the features.

Definition at line 1646 of file qgsvectorlayer.h.

Referenced by countSymbolFeatures(), drawLabels(), rendererV2(), setRendererV2(), writeSld(), writeSymbology(), and ~QgsVectorLayer().

QgsFeatureIds QgsVectorLayer::mSelectedFeatureIds
private

Set holding the feature IDs that are activated.

Note that if a feature subsequently gets deleted (i.e. by its addition to mDeletedFeatureIds), it always needs to be removed from mSelectedFeatureIds as well.

Definition at line 1623 of file qgsvectorlayer.h.

Referenced by addPart(), boundingBoxOfSelected(), QgsVectorLayerEditBuffer::commitChanges(), deleteFeature(), deleteSelectedFeatures(), deselect(), drawLabels(), invertSelection(), invertSelectionInRectangle(), modifySelection(), removeSelection(), select(), selectedFeatureCount(), selectedFeatures(), selectedFeaturesIds(), and setSelectedFeatures().

QgsVectorSimplifyMethod QgsVectorLayer::mSimplifyMethod
private

Simplification object which holds the information about how to simplify the features for fast rendering.

Definition at line 1649 of file qgsvectorlayer.h.

Referenced by QgsVectorLayer(), readSymbology(), simplifyDrawingCanbeApplied(), and writeSymbology().

bool QgsVectorLayer::mSymbolFeatureCounted
private
QMap<QgsSymbolV2*, long> QgsVectorLayer::mSymbolFeatureCountMap
private

Definition at line 1725 of file qgsvectorlayer.h.

Referenced by countSymbolFeatures(), featureCount(), and setRendererV2().

QList< TabData > QgsVectorLayer::mTabs
private

Map that stores the tab for attributes in the edit form.

Key is the tab order and value the tab name

Definition at line 1640 of file qgsvectorlayer.h.

QgsFields QgsVectorLayer::mUpdatedFields
private
bool QgsVectorLayer::mValidExtent
private

Definition at line 1718 of file qgsvectorlayer.h.

Referenced by extent(), setExtent(), and updateExtents().

QMap< QString, QMap<QString, QVariant> > QgsVectorLayer::mValueMaps
private

Definition at line 1680 of file qgsvectorlayer.h.

Referenced by readSymbology(), valueMap(), and writeSymbology().

QMap< QString, ValueRelationData > QgsVectorLayer::mValueRelations
private

Definition at line 1683 of file qgsvectorlayer.h.

Referenced by readSymbology(), valueRelation(), and writeSymbology().

bool QgsVectorLayer::mVertexMarkerOnlyForSelection
private

Flag if the vertex markers should be drawn only for selection (true) or for all features (false)

Definition at line 1673 of file qgsvectorlayer.h.

QMap< QString, QSize> QgsVectorLayer::mWidgetSize
private

Definition at line 1685 of file qgsvectorlayer.h.

Referenced by readSymbology(), widgetSize(), and writeSymbology().

int QgsVectorLayer::mWkbType
private

Geometry type as defined in enum WkbType (qgis.h)

Definition at line 1643 of file qgsvectorlayer.h.

Referenced by setDataProvider(), and wkbType().


The documentation for this class was generated from the following files: