QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsvectorlayer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvectorlayer.h - description
3  -------------------
4  begin : Oct 29, 2003
5  copyright : (C) 2003 by Gary E.Sherman
6  email : sherman at mrcc.com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSVECTORLAYER_H
19 #define QGSVECTORLAYER_H
20 
21 #include <QMap>
22 #include <QSet>
23 #include <QList>
24 #include <QStringList>
25 
26 #include "qgis.h"
27 #include "qgsmaplayer.h"
28 #include "qgsfeature.h"
29 #include "qgsfeatureiterator.h"
30 #include "qgseditorwidgetconfig.h"
31 #include "qgsfield.h"
32 #include "qgssnapper.h"
33 #include "qgsfield.h"
34 #include "qgsrelation.h"
36 
37 class QPainter;
38 class QImage;
39 
41 class QgsAttributeAction;
48 class QgsFeatureRequest;
49 class QgsGeometry;
50 class QgsGeometryCache;
51 class QgsGeometryVertexIndex;
52 class QgsLabel;
53 class QgsMapToPixel;
54 class QgsRectangle;
55 class QgsRectangle;
56 class QgsRelation;
57 class QgsRelationManager;
59 class QgsSymbolV2;
63 
64 typedef QList<int> QgsAttributeList;
65 typedef QSet<int> QgsAttributeIds;
66 
68 class CORE_EXPORT QgsAttributeEditorElement : public QObject
69 {
70  Q_OBJECT
71  public:
72 
74  {
78  AeTypeInvalid
79  };
80 
81  QgsAttributeEditorElement( AttributeEditorType type, QString name, QObject *parent = NULL )
82  : QObject( parent ), mType( type ), mName( name ) {}
83 
85 
86  QString name() const { return mName; }
87  AttributeEditorType type() const { return mType; }
88 
89  virtual QDomElement toDomElement( QDomDocument& doc ) const = 0;
90 
91  protected:
93  QString mName;
94 };
95 
98 {
99  public:
100  QgsAttributeEditorContainer( QString name, QObject *parent )
101  : QgsAttributeEditorElement( AeTypeContainer, name, parent )
102  , mIsGroupBox( true )
103  {}
104 
106 
107  virtual QDomElement toDomElement( QDomDocument& doc ) const;
108  virtual void addChildElement( QgsAttributeEditorElement *widget );
109  virtual void setIsGroupBox( bool isGroupBox ) { mIsGroupBox = isGroupBox; }
110  virtual bool isGroupBox() const { return mIsGroupBox; }
111  QList<QgsAttributeEditorElement*> children() const { return mChildren; }
112  virtual QList<QgsAttributeEditorElement*> findElements( AttributeEditorType type ) const;
113 
114  private:
116  QList<QgsAttributeEditorElement*> mChildren;
117 };
118 
121 {
122  public:
123  QgsAttributeEditorField( QString name , int idx, QObject *parent )
124  : QgsAttributeEditorElement( AeTypeField, name, parent ), mIdx( idx ) {}
125 
127 
128  virtual QDomElement toDomElement( QDomDocument& doc ) const;
129  int idx() const { return mIdx; }
130 
131  private:
132  int mIdx;
133 };
134 
137 {
138  public:
139  QgsAttributeEditorRelation( QString name, const QString &relationId, QObject *parent )
140  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
141  , mRelationId( relationId ) {}
142 
143  QgsAttributeEditorRelation( QString name, const QgsRelation& relation, QObject *parent )
144  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
145  , mRelationId( relation.id() )
146  , mRelation( relation ) {}
147 
149 
150  virtual QDomElement toDomElement( QDomDocument& doc ) const;
151  const QgsRelation& relation() const { return mRelation; }
152 
159  bool init( QgsRelationManager *relManager );
160 
161  private:
162  QString mRelationId;
164 };
165 
167 struct CORE_EXPORT QgsVectorJoinInfo
168 {
172  QString joinLayerId;
174  QString joinFieldName;
180  QHash< QString, QgsAttributes> cachedAttributes;
181 
186 };
187 
450 class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
451 {
452  Q_OBJECT
453 
454  public:
457  {
458  GeneratedLayout = 0,
459  TabLayout = 1,
460  UiFileLayout = 2
461  };
462 
466  enum EditType
467  {
489  };
490 
494  {
495  SuppressDefault = 0, // use the application-wide setting
496  SuppressOn = 1,
497  SuppressOff = 2
498  };
499 
500  struct RangeData
501  {
502  RangeData() { mMin = QVariant( 0 ); mMax = QVariant( 5 ); mStep = QVariant( 1 );}
503  RangeData( QVariant theMin, QVariant theMax, QVariant theStep )
504  : mMin( theMin ), mMax( theMax ), mStep( theStep ) {}
505 
506  QVariant mMin;
507  QVariant mMax;
508  QVariant mStep;
509  };
510 
512  {
514  ValueRelationData( QString layer, QString key, QString value, bool allowNull, bool orderByValue,
515  bool allowMulti = false,
516  QString filterExpression = QString::null )
517  : mLayer( layer )
518  , mKey( key )
519  , mValue( value )
520  , mFilterExpression( filterExpression )
521  , mAllowNull( allowNull )
522  , mOrderByValue( orderByValue )
523  , mAllowMulti( allowMulti )
524  {}
525 
526  QString mLayer;
527  QString mKey;
528  QString mValue;
532  bool mAllowMulti; /* allow selection of multiple keys @added in 1.9 */
533  };
534 
535  struct GroupData
536  {
538  GroupData( QString name , QList<QString> fields )
539  : mName( name ), mFields( fields ) {}
540  QString mName;
541  QList<QString> mFields;
542  };
543 
544  struct TabData
545  {
546  TabData() {}
547  TabData( QString name , QList<QString> fields , QList<GroupData> groups )
548  : mName( name ), mFields( fields ), mGroups( groups ) {}
549  QString mName;
550  QList<QString> mFields;
551  QList<GroupData> mGroups;
552  };
553 
567  QgsVectorLayer( QString path = QString::null, QString baseName = QString::null,
568  QString providerLib = QString::null, bool loadDefaultStyleFlag = true );
569 
571  virtual ~QgsVectorLayer();
572 
574  QString storageType() const;
575 
577  QString capabilitiesString() const;
578 
580  QString dataComment() const;
581 
583  void setDisplayField( QString fldName = "" );
584 
586  const QString displayField() const;
587 
595  void setDisplayExpression( const QString &displayExpression );
596 
605  const QString displayExpression();
606 
608  QgsVectorDataProvider* dataProvider();
609 
613  const QgsVectorDataProvider* dataProvider() const;
614 
616  void setProviderEncoding( const QString& encoding );
617 
619  void setCoordinateSystem();
620 
624  void addJoin( const QgsVectorJoinInfo& joinInfo );
625 
628  void removeJoin( const QString& joinLayerId );
629 
631  const QList< QgsVectorJoinInfo >& vectorJoins() const;
632 
641  void addExpressionField( const QString& exp, const QgsField& fld );
642 
650  void removeExpressionField( int index );
651 
653  QgsLabel *label();
654 
655  const QgsLabel *label() const;
656 
657  QgsAttributeAction *actions() { return mActions; }
658 
664  int selectedFeatureCount();
665 
674  void select( QgsRectangle & rect, bool addToSelection );
675 
687  void modifySelection( QgsFeatureIds selectIds, QgsFeatureIds deselectIds );
688 
690  void invertSelection();
691 
693  void selectAll();
694 
696  QgsFeatureIds allFeatureIds();
697 
705  void invertSelectionInRectangle( QgsRectangle & rect );
706 
714  QgsFeatureList selectedFeatures();
715 
722  const QgsFeatureIds &selectedFeaturesIds() const;
723 
731  void setSelectedFeatures( const QgsFeatureIds &ids );
732 
734  QgsRectangle boundingBoxOfSelected();
735 
737  void setDiagramRenderer( QgsDiagramRendererV2* r );
738  const QgsDiagramRendererV2* diagramRenderer() const { return mDiagramRenderer; }
739 
740  void setDiagramLayerSettings( const QgsDiagramLayerSettings& s );
741  const QgsDiagramLayerSettings *diagramLayerSettings() const { return mDiagramLayerSettings; }
742 
745  QgsFeatureRendererV2* rendererV2();
749  void setRendererV2( QgsFeatureRendererV2* r );
750 
752  QGis::GeometryType geometryType() const;
753 
757  bool hasGeometryType() const;
758 
760  QGis::WkbType wkbType() const;
761 
763  QString providerType() const;
764 
768  virtual bool readXml( const QDomNode& layer_node );
769 
773  virtual bool writeXml( QDomNode & layer_node, QDomDocument & doc );
774 
783  virtual void saveStyleToDatabase( QString name, QString description,
784  bool useAsDefault, QString uiFileContent,
785  QString &msgError );
786 
795  virtual int listStylesInDatabase( QStringList &ids, QStringList &names,
796  QStringList &descriptions, QString &msgError );
797 
801  virtual QString getStyleFromDatabase( QString styleId, QString &msgError );
802 
809  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag, bool loadFromLocalDb );
810 
815  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag );
816 
817  virtual bool applyNamedStyle( QString namedStyle , QString errorMsg );
818 
823  QgsAttributeEditorElement* attributeEditorElementFromDomElement( QDomElement &elem, QObject* parent );
824 
830  bool readSymbology( const QDomNode& node, QString& errorMessage );
831 
838  bool writeSymbology( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
839 
840  bool writeSld( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
841  bool readSld( const QDomNode& node, QString& errorMessage );
842 
850  virtual long featureCount() const;
851 
858  long featureCount( QgsSymbolV2* symbol );
859 
865  bool countSymbolFeatures( bool showProgress = true );
866 
874  virtual bool setSubsetString( QString subset );
875 
880  virtual QString subsetString();
881 
885  QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() );
886 
892  bool addFeature( QgsFeature& f, bool alsoUpdateExtent = true );
893 
901  bool updateFeature( QgsFeature &f );
902 
907  bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
908 
913  bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
914 
917  bool deleteVertex( QgsFeatureId atFeatureId, int atVertex );
918 
922  bool deleteSelectedFeatures();
923 
933  int addRing( const QList<QgsPoint>& ring );
934 
945  int addPart( const QList<QgsPoint>& ring );
946 
952  int translateFeature( QgsFeatureId featureId, double dx, double dy );
953 
961  int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
962 
970  int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
971 
980  Q_DECL_DEPRECATED int removePolygonIntersections( QgsGeometry* geom, QgsFeatureIds ignoreFeatures = QgsFeatureIds() );
981 
987  int addTopologicalPoints( QgsGeometry* geom );
988 
996  int addTopologicalPoints( const QgsPoint& p );
997 
1003  int insertSegmentVerticesForSnap( const QList<QgsSnappingResult>& snapResults );
1004 
1006  void enableLabels( bool on );
1007 
1009  bool hasLabelsEnabled() const;
1010 
1012  virtual bool isEditable() const;
1013 
1017  virtual bool isReadOnly() const;
1018 
1020  virtual bool isModified() const;
1021 
1028  bool snapPoint( QgsPoint& point, double tolerance );
1029 
1037  int snapWithContext( const QgsPoint& startPoint,
1038  double snappingTolerance,
1039  QMultiMap < double, QgsSnappingResult > &snappingResults,
1040  QgsSnapper::SnappingType snap_to );
1041 
1044  virtual void reload();
1045 
1049  virtual QgsMapLayerRenderer* createMapRenderer( QgsRenderContext& rendererContext );
1050 
1054  bool draw( QgsRenderContext& rendererContext );
1055 
1057  void drawLabels( QgsRenderContext& rendererContext );
1058 
1060  QgsRectangle extent();
1061 
1063  const QgsFields &pendingFields() const;
1064 
1066  QgsAttributeList pendingAllAttributesList();
1067 
1071  QgsAttributeList pendingPkAttributesList();
1072 
1074  int pendingFeatureCount();
1075 
1080  bool setReadOnly( bool readonly = true );
1081 
1083  bool startEditing();
1084 
1087  bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom );
1088 
1095  Q_DECL_DEPRECATED bool changeAttributeValue( QgsFeatureId fid, int field, QVariant value, bool emitSignal );
1096 
1107  bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant() );
1108 
1112  bool addAttribute( const QgsField &field );
1113 
1118  void addAttributeAlias( int attIndex, QString aliasString );
1119 
1124  void remAttributeAlias( int attIndex );
1125 
1130  void addAttributeEditorWidget( QgsAttributeEditorElement* data );
1131 
1139  const QString editorWidgetV2( int fieldIdx ) const;
1140 
1150  const QString editorWidgetV2( const QString& fieldName ) const;
1151 
1159  const QgsEditorWidgetConfig editorWidgetV2Config( int fieldIdx ) const;
1160 
1170  const QgsEditorWidgetConfig editorWidgetV2Config( const QString& fieldName ) const;
1171 
1176  QList< QgsAttributeEditorElement* > &attributeEditorElements();
1181  void clearAttributeEditorWidgets();
1182 
1187  QString attributeAlias( int attributeIndex ) const;
1188 
1193  QString attributeDisplayName( int attributeIndex ) const;
1194 
1195  const QMap< QString, QString >& attributeAliases() const { return mAttributeAliasMap; }
1196 
1197  const QSet<QString>& excludeAttributesWMS() const { return mExcludeAttributesWMS; }
1198  void setExcludeAttributesWMS( const QSet<QString>& att ) { mExcludeAttributesWMS = att; }
1199 
1200  const QSet<QString>& excludeAttributesWFS() const { return mExcludeAttributesWFS; }
1201  void setExcludeAttributesWFS( const QSet<QString>& att ) { mExcludeAttributesWFS = att; }
1202 
1204  bool deleteAttribute( int attr );
1205 
1213  bool deleteAttributes( QList<int> attrs );
1214 
1216  bool addFeatures( QgsFeatureList features, bool makeSelected = true );
1217 
1219  bool deleteFeature( QgsFeatureId fid );
1220 
1236  bool commitChanges();
1237  const QStringList &commitErrors();
1238 
1242  bool rollBack( bool deleteBuffer = true );
1243 
1249  Q_DECL_DEPRECATED EditType editType( int idx );
1250 
1256  Q_DECL_DEPRECATED void setEditType( int idx, EditType edit );
1257 
1259  EditorLayout editorLayout();
1260 
1262  void setEditorLayout( EditorLayout editorLayout );
1263 
1270  void setEditorWidgetV2( int attrIdx, const QString& widgetType );
1271 
1278  void setEditorWidgetV2Config( int attrIdx, const QgsEditorWidgetConfig& config );
1279 
1285  Q_DECL_DEPRECATED void setCheckedState( int idx, QString checked, QString notChecked );
1286 
1288  QString editForm();
1289 
1291  void setEditForm( QString ui );
1292 
1295  QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const { return mFeatureFormSuppress; }
1296 
1299  void setFeatureFormSuppress( QgsVectorLayer::FeatureFormSuppress s ) { mFeatureFormSuppress = s; }
1300 
1302  QString annotationForm() const { return mAnnotationForm; }
1303 
1305  void setAnnotationForm( const QString& ui );
1306 
1308  QString editFormInit();
1309 
1311  void setEditFormInit( QString function );
1312 
1317  Q_DECL_DEPRECATED QMap<QString, QVariant> valueMap( int idx );
1318 
1324  Q_DECL_DEPRECATED RangeData range( int idx );
1325 
1331  ValueRelationData valueRelation( int idx );
1332 
1339  QList<QgsRelation> referencingRelations( int idx );
1340 
1348  Q_DECL_DEPRECATED QString dateFormat( int idx );
1349 
1357  Q_DECL_DEPRECATED QSize widgetSize( int idx );
1358 
1362  bool fieldEditable( int idx );
1363 
1367  bool labelOnTop( int idx );
1368 
1372  void setFieldEditable( int idx, bool editable );
1373 
1377  void setLabelOnTop( int idx, bool onTop );
1378 
1380  QgsVectorLayerEditBuffer* editBuffer() { return mEditBuffer; }
1381 
1386  void beginEditCommand( QString text );
1387 
1389  void endEditCommand();
1390 
1392  void destroyEditCommand();
1393 
1397  int fieldNameIndex( const QString& fieldName ) const;
1398 
1402  {
1405  NoMarker /* added in version 1.1 */
1406  };
1407 
1410  static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
1411 
1414  void updateFields();
1415 
1418  void createJoinCaches();
1419 
1425  void uniqueValues( int index, QList<QVariant> &uniqueValues, int limit = -1 );
1426 
1429  QVariant minimumValue( int index );
1430 
1433  QVariant maximumValue( int index );
1434 
1435  /* Set the blending mode used for rendering each feature
1436  * @note added in 2.0
1437  */
1438  void setFeatureBlendMode( const QPainter::CompositionMode &blendMode );
1439  /* Returns the current blending mode for features
1440  * @note added in 2.0
1441  */
1442  QPainter::CompositionMode featureBlendMode() const;
1443 
1444  /* Set the transparency for the vector layer
1445  * @note added in 2.0
1446  */
1447  void setLayerTransparency( int layerTransparency );
1448  /* Returns the current transparency for the vector layer
1449  * @note added in 2.0
1450  */
1451  int layerTransparency() const;
1452 
1453  QString metadata();
1454 
1456  inline QgsGeometryCache* cache() { return mCache; }
1457 
1461  void setSimplifyMethod( const QgsVectorSimplifyMethod& simplifyMethod ) { mSimplifyMethod = simplifyMethod; }
1465  inline const QgsVectorSimplifyMethod& simplifyMethod() const { return mSimplifyMethod; }
1466 
1471  bool simplifyDrawingCanbeApplied( const QgsRenderContext& renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint ) const;
1472 
1473  public slots:
1481  void select( const QgsFeatureId &featureId );
1482 
1490  void select( const QgsFeatureIds& featureIds );
1491 
1499  void deselect( const QgsFeatureId featureId );
1500 
1508  void deselect( const QgsFeatureIds& featureIds );
1509 
1515  void removeSelection();
1516 
1521  void triggerRepaint();
1522 
1526  virtual void updateExtents();
1527 
1530  void checkJoinLayerRemove( QString theLayerId );
1531 
1532  protected slots:
1533  void invalidateSymbolCountedFlag();
1534 
1535  signals:
1536 
1544  void selectionChanged( const QgsFeatureIds selected, const QgsFeatureIds deselected, const bool clearAndSelect );
1545 
1547  void selectionChanged();
1548 
1550  void layerModified();
1551 
1553  void beforeModifiedCheck() const;
1554 
1556  void editingStarted();
1557 
1559  void editingStopped();
1560 
1562  void beforeCommitChanges();
1563 
1565  void beforeRollBack();
1566 
1575  void attributeAdded( int idx );
1584  void attributeDeleted( int idx );
1585  void featureAdded( QgsFeatureId fid ); // added in 1.7
1586  void featureDeleted( QgsFeatureId fid );
1593  void updatedFields();
1594  void layerDeleted();
1595 
1596  void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant & );
1597  void geometryChanged( QgsFeatureId fid, QgsGeometry &geom ); // added in 1.9
1598 
1601  void committedAttributesDeleted( const QString& layerId, const QgsAttributeList& deletedAttributes );
1602  void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
1603  void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );
1604  void committedFeaturesRemoved( const QString& layerId, const QgsFeatureIds& deletedFeatureIds );
1605  void committedAttributeValuesChanges( const QString& layerId, const QgsChangedAttributesMap& changedAttributesValues );
1606  void committedGeometriesChanges( const QString& layerId, const QgsGeometryMap& changedGeometries );
1607 
1608  void saveLayerToProject();
1609 
1613  void labelingFontNotFound( QgsVectorLayer* layer, const QString& fontfamily );
1614 
1616  void featureBlendModeChanged( const QPainter::CompositionMode &blendMode );
1617 
1619  void layerTransparencyChanged( int layerTransparency );
1620 
1626  void editCommandStarted( const QString& text );
1627 
1633  void editCommandEnded();
1634 
1640  void editCommandDestroyed();
1641 
1642  private slots:
1643  void onRelationsLoaded();
1644 
1645  protected:
1647  void setExtent( const QgsRectangle &rect );
1648 
1649  private: // Private methods
1650 
1652  QgsVectorLayer( const QgsVectorLayer & rhs );
1653 
1655  QgsVectorLayer & operator=( QgsVectorLayer const & rhs );
1656 
1661  bool setDataProvider( QString const & provider );
1662 
1664  QgsFeatureId findFreeId();
1665 
1674  void snapToGeometry( const QgsPoint& startPoint,
1675  QgsFeatureId featureId,
1676  QgsGeometry* geom,
1677  double sqrSnappingTolerance,
1678  QMultiMap<double, QgsSnappingResult>& snappingResults,
1679  QgsSnapper::SnappingType snap_to ) const;
1680 
1682  //void addJoinedAttributes( QgsFeature& f, bool all = false );
1683 
1685  void readSldLabeling( const QDomNode& node );
1686 
1687  private: // Private attributes
1688 
1691 
1693  QString mDisplayField;
1694 
1697 
1699  QString mProviderKey;
1700 
1703 
1706 
1712 
1715 
1717  QMap< QString, QString > mAttributeAliasMap;
1718 
1720  QList< QgsAttributeEditorElement* > mAttributeEditorElements;
1721 
1723  QSet<QString> mExcludeAttributesWMS;
1725  QSet<QString> mExcludeAttributesWFS;
1726 
1728  QList< TabData > mTabs;
1729 
1732 
1735 
1738 
1741 
1743  bool mLabelOn;
1744 
1747 
1749  QPainter::CompositionMode mFeatureBlendMode;
1750 
1753 
1756 
1759 
1762 
1763  QStringList mCommitErrors;
1764 
1765  QMap< QString, bool> mFieldEditables;
1766  QMap< QString, bool> mLabelOnTop;
1767 
1768  QMap<QString, QString> mEditorWidgetV2Types;
1769  QMap<QString, QgsEditorWidgetConfig > mEditorWidgetV2Configs;
1770 
1773 
1774  QString mEditForm, mEditFormInit;
1775 
1779 
1780  //annotation form for this layer
1782 
1785 
1789 
1790  //stores information about joined layers
1792 
1795 
1796  //diagram rendering object. 0 if diagram drawing is disabled
1798 
1799  //stores infos about diagram placement (placement type, priority, position distance)
1801 
1804 
1805  // Features in renderer classes counted
1807 
1808  // Feature counts for each renderer symbol
1809  QMap<QgsSymbolV2*, long> mSymbolFeatureCountMap;
1810 
1812 };
1813 
1814 #endif
virtual bool isEditable() const
True if the layer can be edited.
EditorLayout mEditorLayout
Defines the default layout to use for the attribute editor (Drag and drop, UI File, Generated)
int mWkbType
Geometry type as defined in enum WkbType (qgis.h)
Wrapper for iterator of features from vector data provider or vector layer.
QString annotationForm() const
get annotation form (added in 1.5)
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
Definition: qgsfeature.h:323
static unsigned index
int mCurrentVertexMarkerSize
The current size of editing marker.
A rectangle specified with double values.
Definition: qgsrectangle.h:35
Base class for all map layer types.
Definition: qgsmaplayer.h:48
QSet< QString > mExcludeAttributesWFS
Attributes which are not published in WFS.
QgsVectorLayer::FeatureFormSuppress mFeatureFormSuppress
Type of feature form suppression after feature creation.
QString joinFieldName
Join field in the source layer.
const QSet< QString > & excludeAttributesWMS() const
QgsVectorDataProvider * mDataProvider
Pointer to data provider derived from the abastract base class QgsDataProvider.
QgsVectorLayer::VertexMarkerType mCurrentVertexMarkerType
The current type of editing marker.
void setExcludeAttributesWFS(const QSet< QString > &att)
virtual QString metadata()
Obtain Metadata for this layer.
QString targetFieldName
Join field in the target layer.
virtual void drawLabels(QgsRenderContext &rendererContext)
Draw labels.
GeometryType
Definition: qgis.h:155
virtual bool isGroupBox() const
RangeData(QVariant theMin, QVariant theMax, QVariant theStep)
QgsAttributeAction * actions()
EditorLayout
The different types to layout the attribute editor.
QMap< QString, QgsEditorWidgetConfig > mEditorWidgetV2Configs
The attribute value should not be changed in the attribute form.
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeature.h:325
QList< QgsFeature > QgsFeatureList
Definition: qgsfeature.h:330
Manages an editor widget Widget and wrapper share the same parent.
QList< QgsAttributeEditorElement * > mAttributeEditorElements
Stores a list of attribute editor elements (Each holding a tree structure for a tab in the attribute ...
void setExcludeAttributesWMS(const QSet< QString > &att)
QgsFeatureRendererV2 * mRendererV2
Renderer object which holds the information about how to display the features.
int joinFieldIndex
Join field index in the source layer.
virtual bool readSymbology(const QDomNode &node, QString &errorMessage)=0
Read the symbology for the current layer from the Dom node supplied.
Storage and management of actions associated with Qgis layer attributes.
const QgsVectorSimplifyMethod & simplifyMethod() const
Returns the simplification settings for fast rendering of features.
virtual void reload()
Synchronises with changes in the datasource.
Definition: qgsmaplayer.h:132
VertexMarkerType
Editing vertex markers.
QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const
Type of feature form pop-up suppression after feature creation (overrides app setting) ...
SimplifyHint
Simplification flags for fast rendering of features.
QString mDisplayExpression
the preview expression used to generate a human readable preview string for features ...
Container of fields for a vector layer.
Definition: qgsfield.h:163
WkbType
Used for symbology operations.
Definition: qgis.h:53
QMap< QString, bool > mFieldEditables
virtual ~QgsAttributeEditorElement()
virtual QgsMapLayerRenderer * createMapRenderer(QgsRenderContext &rendererContext)
Return new instance of QgsMapLayerRenderer that will be used for rendering of given context...
Definition: qgsmaplayer.h:137
const QgsRelation & relation() const
bool memoryCache
True if the join is cached in virtual memory.
int targetFieldIndex
Join field index in the target layer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:113
const QgsDiagramLayerSettings * diagramLayerSettings() const
QStringList mCommitErrors
QgsAttributeEditorField(QString name, int idx, QObject *parent)
TabData(QString name, QList< QString > fields, QList< GroupData > groups)
bool mVertexMarkerOnlyForSelection
Flag if the vertex markers should be drawn only for selection (true) or for all features (false) ...
virtual bool writeSymbology(QDomNode &node, QDomDocument &doc, QString &errorMessage) const =0
Write the symbology for the layer into the docment provided.
QgsGeometryCache * cache()
QgsAttributeEditorRelation(QString name, const QString &relationId, QObject *parent)
Returns diagram settings for a feature.
Manages joined fields for a vector layer.
virtual bool draw(QgsRenderContext &rendererContext)
This is the method that does the actual work of drawing the layer onto a paint device.
QString mAnnotationForm
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:33
SnappingType
Snap to vertex, to segment or both.
Definition: qgssnapper.h:66
QList< QgsAttributeEditorElement * > mChildren
QgsVectorLayerEditBuffer * editBuffer()
Buffer with uncommitted editing operations. Only valid after editing has been turned on...
bool mLabelFontNotFoundNotified
Whether 'labeling font not found' has be shown for this layer (only show once in QgsMessageBar, on first rendering)
QgsGeometryCache * mCache
cache for some vector layer data - currently only geometries for faster editing
virtual bool writeXml(QDomNode &layer_node, QDomDocument &document)
called by writeLayerXML(), used by children to write state specific to them to project files...
The attribute value should not be shown in the attribute form.
const QSet< QString > & excludeAttributesWFS() const
virtual void setExtent(const QgsRectangle &rect)
Set the extent.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
QList< int > QgsAttributeList
AttributeEditorType type() const
QgsExpressionFieldBuffer * mExpressionFieldBuffer
stores information about expression fields on this layer
QgsVectorSimplifyMethod mSimplifyMethod
Simplification object which holds the information about how to simplify the features for fast renderi...
QgsDiagramLayerSettings * mDiagramLayerSettings
Encapsulate a field in an attribute table or data source.
Definition: qgsfield.h:33
QMap< QgsSymbolV2 *, long > mSymbolFeatureCountMap
const QMap< QString, QString > & attributeAliases() const
const QgsDiagramRendererV2 * diagramRenderer() const
A class to represent a point geometry.
Definition: qgspoint.h:63
virtual bool readSld(const QDomNode &node, QString &errorMessage)
Definition: qgsmaplayer.h:351
QMap< QString, QString > mAttributeAliasMap
Map that stores the aliases for attributes.
QList< TabData > mTabs
Map that stores the tab for attributes in the edit form.
QList< QgsAttributeEditorElement * > children() const
QgsVectorLayerEditBuffer * mEditBuffer
stores information about uncommitted changes to layer
Partial snapshot of vector layer's state (only the members necessary for access to features) ...
QgsMapLayer & operator=(QgsMapLayer const &)
private assign operator - QgsMapLayer not copyable
QList< QString > mFields
A class to render labels.
Definition: qgslabel.h:51
uuid generator - readonly and automatically intialized
QgsDiagramRendererV2 * mDiagramRenderer
This class contains information how to simplify geometries fetched from a vector layer.
Contains information about the context of a rendering operation.
ValueRelationData(QString layer, QString key, QString value, bool allowNull, bool orderByValue, bool allowMulti=false, QString filterExpression=QString::null)
QString mDisplayField
index of the primary label field
Buffers information about expression fields for a vector layer.
virtual QDomElement toDomElement(QDomDocument &doc) const =0
QSet< QString > mExcludeAttributesWMS
Attributes which are not published in WMS.
QHash< QString, QgsAttributes > cachedAttributes
Cache for joined attributes to provide fast lookup (size is 0 if no memory caching) ...
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
Definition: qgsfeature.h:320
QMap< QString, QString > mEditorWidgetV2Types
bool mLabelOn
Display labels.
QgsVectorLayerJoinBuffer * mJoinBuffer
GroupData(QString name, QList< QString > fields)
virtual void setIsGroupBox(bool isGroupBox)
This class manages a set of relations between layers.
virtual bool readXml(const QDomNode &layer_node)
called by readLayerXML(), used by children to read state specific to them from project files...
QgsAttributeEditorRelation(QString name, const QgsRelation &relation, QObject *parent)
Class for doing transforms between two map coordinate systems.
QMap< QString, bool > mLabelOnTop
void setSimplifyMethod(const QgsVectorSimplifyMethod &simplifyMethod)
Set the simplification settings for fast rendering of features.
QMap< QString, QVariant > QgsEditorWidgetConfig
Holds a set of configuration parameters for a editor widget wrapper.
qint64 QgsFeatureId
Definition: qgsfeature.h:30
Base class for utility classes that encapsulate information necessary for rendering of map layers...
void setFeatureFormSuppress(QgsVectorLayer::FeatureFormSuppress s)
Set type of feature form pop-up suppression after feature creation (overrides app setting) ...
int mLayerTransparency
Layer transparency.
virtual QString loadNamedStyle(const QString &theURI, bool &theResultFlag)
Retrieve a named style for this layer if one exists (either as a .qml file on disk or as a record in ...
QList< QString > mFields
QgsAttributeEditorElement(AttributeEditorType type, QString name, QObject *parent=NULL)
QgsLabel * mLabel
Label.
QSet< int > QgsAttributeIds
QgsAttributeEditorContainer(QString name, QObject *parent)
FeatureFormSuppress
Types of feature form suppression after feature creation.
This is the base class for vector data providers.
QList< int > QgsAttributeList
QgsFields mUpdatedFields
field map to commit
QPainter::CompositionMode mFeatureBlendMode
Blend mode for features.
virtual QgsRectangle extent()
Return the extent of the layer.
Represents a vector layer which manages a vector based data sets.
modularized edit widgets
bool mReadOnly
Flag indicating whether the layer is in read-only mode (editing disabled) or not. ...
QgsFeatureIds mSelectedFeatureIds
Set holding the feature IDs that are activated.
QString joinLayerId
Source layer.
value map from an table
AttributeEditorType mType
Abstract base class for simplify geometries using a specific algorithm.
QString mProviderKey
Data provider key.
QgsAttributeAction * mActions
The user-defined actions that are accessed from the Identify Results dialog box.
QList< GroupData > mGroups