QGIS API Documentation  2.9.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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 "qgsrelation.h"
35 
36 class QPainter;
37 class QImage;
38 
40 class QgsAttributeAction;
47 class QgsFeatureRequest;
48 class QgsGeometry;
49 class QgsGeometryCache;
50 class QgsGeometryVertexIndex;
51 class QgsLabel;
52 class QgsMapToPixel;
53 class QgsRectangle;
54 class QgsRectangle;
55 class QgsRelation;
56 class QgsRelationManager;
58 class QgsSymbolV2;
62 
63 typedef QList<int> QgsAttributeList;
64 typedef QSet<int> QgsAttributeIds;
65 
66 class CORE_EXPORT QgsAttributeEditorElement : public QObject
67 {
68  Q_OBJECT
69  public:
70 
72  {
76  AeTypeInvalid
77  };
78 
79  QgsAttributeEditorElement( AttributeEditorType type, QString name, QObject *parent = NULL )
80  : QObject( parent ), mType( type ), mName( name ) {}
81 
83 
84  QString name() const { return mName; }
85  AttributeEditorType type() const { return mType; }
86 
87  virtual QDomElement toDomElement( QDomDocument& doc ) const = 0;
88 
89  protected:
91  QString mName;
92 };
93 
95 {
96  public:
97  QgsAttributeEditorContainer( QString name, QObject *parent )
98  : QgsAttributeEditorElement( AeTypeContainer, name, parent )
99  , mIsGroupBox( true )
100  {}
101 
103 
104  virtual QDomElement toDomElement( QDomDocument& doc ) const override;
105  virtual void addChildElement( QgsAttributeEditorElement *widget );
106  virtual void setIsGroupBox( bool isGroupBox ) { mIsGroupBox = isGroupBox; }
107  virtual bool isGroupBox() const { return mIsGroupBox; }
108  QList<QgsAttributeEditorElement*> children() const { return mChildren; }
109  virtual QList<QgsAttributeEditorElement*> findElements( AttributeEditorType type ) const;
110 
111  private:
112  bool mIsGroupBox;
113  QList<QgsAttributeEditorElement*> mChildren;
114 };
115 
116 
118 {
119  public:
120  QgsAttributeEditorField( QString name, int idx, QObject *parent )
121  : QgsAttributeEditorElement( AeTypeField, name, parent ), mIdx( idx ) {}
122 
124 
125  virtual QDomElement toDomElement( QDomDocument& doc ) const override;
126  int idx() const { return mIdx; }
127 
128  private:
129  int mIdx;
130 };
131 
134 {
135  public:
136  QgsAttributeEditorRelation( QString name, const QString &relationId, QObject *parent )
137  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
138  , mRelationId( relationId ) {}
139 
140  QgsAttributeEditorRelation( QString name, const QgsRelation& relation, QObject *parent )
141  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
142  , mRelationId( relation.id() )
143  , mRelation( relation ) {}
144 
146 
147  virtual QDomElement toDomElement( QDomDocument& doc ) const override;
148  const QgsRelation& relation() const { return mRelation; }
149 
156  bool init( QgsRelationManager *relManager );
157 
158  private:
159  QString mRelationId;
160  QgsRelation mRelation;
161 };
162 
163 
164 struct CORE_EXPORT QgsVectorJoinInfo
165 {
169  QString joinLayerId;
171  QString joinFieldName;
177  QHash< QString, QgsAttributes> cachedAttributes;
178 
183 
187  QString prefix;
188 
189  bool operator==( const QgsVectorJoinInfo& other ) const
190  {
191  return targetFieldName == other.targetFieldName &&
192  joinLayerId == other.joinLayerId &&
193  joinFieldName == other.joinFieldName &&
194  joinFieldsSubset == other.joinFieldsSubset &&
195  memoryCache == other.memoryCache &&
196  prefix == other.prefix;
197  }
198 
201  void setJoinFieldNamesSubset( QStringList* fieldNamesSubset ) { joinFieldsSubset = QSharedPointer<QStringList>( fieldNamesSubset ); }
204  QStringList* joinFieldNamesSubset() const { return joinFieldsSubset.data(); }
205 
206 protected:
208  QSharedPointer<QStringList> joinFieldsSubset;
209 };
210 
473 class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
474 {
475  Q_OBJECT
476 
477  public:
480  {
481  GeneratedLayout = 0,
482  TabLayout = 1,
483  UiFileLayout = 2
484  };
485 
489  enum EditType
490  {
512  };
513 
517  {
518  SuppressDefault = 0, // use the application-wide setting
519  SuppressOn = 1,
520  SuppressOff = 2
521  };
522 
523  struct RangeData
524  {
525  RangeData() { mMin = QVariant( 0 ); mMax = QVariant( 5 ); mStep = QVariant( 1 );}
526  RangeData( QVariant theMin, QVariant theMax, QVariant theStep )
527  : mMin( theMin ), mMax( theMax ), mStep( theStep ) {}
528 
529  QVariant mMin;
530  QVariant mMax;
531  QVariant mStep;
532  };
533 
535  {
536  ValueRelationData() : mAllowNull( false ), mOrderByValue( false ), mAllowMulti( false ) {}
537  ValueRelationData( QString layer, QString key, QString value, bool allowNull, bool orderByValue,
538  bool allowMulti = false,
539  QString filterExpression = QString::null )
540  : mLayer( layer )
541  , mKey( key )
542  , mValue( value )
543  , mFilterExpression( filterExpression )
544  , mAllowNull( allowNull )
545  , mOrderByValue( orderByValue )
546  , mAllowMulti( allowMulti )
547  {}
548 
549  QString mLayer;
550  QString mKey;
551  QString mValue;
555  bool mAllowMulti; /* allow selection of multiple keys */
556  };
557 
558  struct GroupData
559  {
561  GroupData( QString name, QList<QString> fields )
562  : mName( name ), mFields( fields ) {}
563  QString mName;
564  QList<QString> mFields;
565  };
566 
567  struct TabData
568  {
569  TabData() {}
570  TabData( QString name, QList<QString> fields, QList<GroupData> groups )
571  : mName( name ), mFields( fields ), mGroups( groups ) {}
572  QString mName;
573  QList<QString> mFields;
574  QList<GroupData> mGroups;
575  };
576 
590  QgsVectorLayer( QString path = QString::null, QString baseName = QString::null,
591  QString providerLib = QString::null, bool loadDefaultStyleFlag = true );
592 
594  virtual ~QgsVectorLayer();
595 
597  QString storageType() const;
598 
600  QString capabilitiesString() const;
601 
603  QString dataComment() const;
604 
606  void setDisplayField( QString fldName = "" );
607 
609  const QString displayField() const;
610 
617  void setDisplayExpression( const QString &displayExpression );
618 
625  const QString displayExpression();
626 
628  QgsVectorDataProvider* dataProvider();
629 
633  const QgsVectorDataProvider* dataProvider() const;
634 
636  void setProviderEncoding( const QString& encoding );
637 
639  void setCoordinateSystem();
640 
644  bool addJoin( const QgsVectorJoinInfo& joinInfo );
645 
647  void removeJoin( const QString& joinLayerId );
648 
649  const QList< QgsVectorJoinInfo >& vectorJoins() const;
650 
661  int addExpressionField( const QString& exp, const QgsField& fld );
662 
670  void removeExpressionField( int index );
671 
681  const QString expressionField( int index );
682 
692  void updateExpressionField( int index, const QString& exp );
693 
695  QgsLabel *label();
696 
697  const QgsLabel *label() const;
698 
699  QgsAttributeAction *actions() { return mActions; }
700 
706  int selectedFeatureCount();
707 
716  void select( QgsRectangle & rect, bool addToSelection );
717 
729  void modifySelection( QgsFeatureIds selectIds, QgsFeatureIds deselectIds );
730 
732  void invertSelection();
733 
735  void selectAll();
736 
738  QgsFeatureIds allFeatureIds();
739 
747  void invertSelectionInRectangle( QgsRectangle & rect );
748 
757  QgsFeatureList selectedFeatures();
758 
770  QgsFeatureIterator selectedFeaturesIterator( QgsFeatureRequest request = QgsFeatureRequest() );
771 
778  const QgsFeatureIds &selectedFeaturesIds() const;
779 
787  void setSelectedFeatures( const QgsFeatureIds &ids );
788 
790  QgsRectangle boundingBoxOfSelected();
791 
796  bool labelsEnabled() const;
797 
802  bool diagramsEnabled() const;
803 
805  void setDiagramRenderer( QgsDiagramRendererV2* r );
806  const QgsDiagramRendererV2* diagramRenderer() const { return mDiagramRenderer; }
807 
808  void setDiagramLayerSettings( const QgsDiagramLayerSettings& s );
809  const QgsDiagramLayerSettings *diagramLayerSettings() const { return mDiagramLayerSettings; }
810 
812  QgsFeatureRendererV2* rendererV2();
814  void setRendererV2( QgsFeatureRendererV2* r );
815 
817  QGis::GeometryType geometryType() const;
818 
820  bool hasGeometryType() const;
821 
823  QGis::WkbType wkbType() const;
824 
826  QString providerType() const;
827 
831  virtual bool readXml( const QDomNode& layer_node ) override;
832 
836  virtual bool writeXml( QDomNode & layer_node, QDomDocument & doc ) override;
837 
846  virtual void saveStyleToDatabase( QString name, QString description,
847  bool useAsDefault, QString uiFileContent,
848  QString &msgError );
849 
858  virtual int listStylesInDatabase( QStringList &ids, QStringList &names,
859  QStringList &descriptions, QString &msgError );
860 
864  virtual QString getStyleFromDatabase( QString styleId, QString &msgError );
865 
872  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag, bool loadFromLocalDb );
873 
878  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag ) override;
879 
890  virtual bool applyNamedStyle( QString namedStyle, QString &errorMsg );
891 
896  QgsAttributeEditorElement* attributeEditorElementFromDomElement( QDomElement &elem, QObject* parent );
897 
903  bool readSymbology( const QDomNode& node, QString& errorMessage ) override;
904 
911  bool writeSymbology( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const override;
912 
913  bool writeSld( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
914  bool readSld( const QDomNode& node, QString& errorMessage ) override;
915 
923  virtual long featureCount() const;
924 
931  long featureCount( QgsSymbolV2* symbol );
932 
938  bool countSymbolFeatures( bool showProgress = true );
939 
947  virtual bool setSubsetString( QString subset );
948 
953  virtual QString subsetString();
954 
958  QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() );
959 
965  bool addFeature( QgsFeature& f, bool alsoUpdateExtent = true );
966 
973  bool updateFeature( QgsFeature &f );
974 
979  bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
980 
985  bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
986 
989  bool deleteVertex( QgsFeatureId atFeatureId, int atVertex );
990 
994  bool deleteSelectedFeatures( int *deletedCount = 0 );
995 
1005  int addRing( const QList<QgsPoint>& ring );
1006 
1017  int addPart( const QList<QgsPoint>& ring );
1018 
1024  int translateFeature( QgsFeatureId featureId, double dx, double dy );
1025 
1033  int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
1034 
1042  int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
1043 
1052  Q_DECL_DEPRECATED int removePolygonIntersections( QgsGeometry* geom, QgsFeatureIds ignoreFeatures = QgsFeatureIds() );
1053 
1059  int addTopologicalPoints( QgsGeometry* geom );
1060 
1068  int addTopologicalPoints( const QgsPoint& p );
1069 
1075  int insertSegmentVerticesForSnap( const QList<QgsSnappingResult>& snapResults );
1076 
1080  Q_DECL_DEPRECATED void enableLabels( bool on );
1081 
1085  Q_DECL_DEPRECATED bool hasLabelsEnabled() const;
1086 
1088  virtual bool isEditable() const override;
1089 
1091  virtual bool isReadOnly() const;
1092 
1094  virtual bool isModified() const;
1095 
1102  bool snapPoint( QgsPoint& point, double tolerance );
1103 
1111  int snapWithContext( const QgsPoint& startPoint,
1112  double snappingTolerance,
1113  QMultiMap < double, QgsSnappingResult > &snappingResults,
1114  QgsSnapper::SnappingType snap_to );
1115 
1117  virtual void reload() override;
1118 
1122  virtual QgsMapLayerRenderer* createMapRenderer( QgsRenderContext& rendererContext ) override;
1123 
1127  bool draw( QgsRenderContext& rendererContext ) override;
1128 
1132  Q_DECL_DEPRECATED void drawLabels( QgsRenderContext& rendererContext ) override;
1133 
1135  QgsRectangle extent() override;
1136 
1138  const QgsFields &pendingFields() const;
1139 
1141  QgsAttributeList pendingAllAttributesList();
1142 
1144  QgsAttributeList pendingPkAttributesList();
1145 
1147  int pendingFeatureCount();
1148 
1152  bool setReadOnly( bool readonly = true );
1153 
1155  bool startEditing();
1156 
1158  bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom );
1159 
1166  Q_DECL_DEPRECATED bool changeAttributeValue( QgsFeatureId fid, int field, QVariant value, bool emitSignal );
1167 
1178  bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant() );
1179 
1182  bool addAttribute( const QgsField &field );
1183 
1185  void addAttributeAlias( int attIndex, QString aliasString );
1186 
1188  void remAttributeAlias( int attIndex );
1189 
1193  void addAttributeEditorWidget( QgsAttributeEditorElement* data );
1194 
1202  const QString editorWidgetV2( int fieldIdx ) const;
1203 
1213  const QString editorWidgetV2( const QString& fieldName ) const;
1214 
1222  const QgsEditorWidgetConfig editorWidgetV2Config( int fieldIdx ) const;
1223 
1233  const QgsEditorWidgetConfig editorWidgetV2Config( const QString& fieldName ) const;
1234 
1238  QList< QgsAttributeEditorElement* > &attributeEditorElements();
1242  void clearAttributeEditorWidgets();
1243 
1245  QString attributeAlias( int attributeIndex ) const;
1246 
1248  QString attributeDisplayName( int attributeIndex ) const;
1249 
1250  const QMap< QString, QString >& attributeAliases() const { return mAttributeAliasMap; }
1251 
1252  const QSet<QString>& excludeAttributesWMS() const { return mExcludeAttributesWMS; }
1253  void setExcludeAttributesWMS( const QSet<QString>& att ) { mExcludeAttributesWMS = att; }
1254 
1255  const QSet<QString>& excludeAttributesWFS() const { return mExcludeAttributesWFS; }
1256  void setExcludeAttributesWFS( const QSet<QString>& att ) { mExcludeAttributesWFS = att; }
1257 
1259  bool deleteAttribute( int attr );
1260 
1268  bool deleteAttributes( QList<int> attrs );
1269 
1271  bool addFeatures( QgsFeatureList features, bool makeSelected = true );
1272 
1274  bool deleteFeature( QgsFeatureId fid );
1275 
1291  bool commitChanges();
1292  const QStringList &commitErrors();
1293 
1297  bool rollBack( bool deleteBuffer = true );
1298 
1304  Q_DECL_DEPRECATED EditType editType( int idx );
1305 
1311  Q_DECL_DEPRECATED void setEditType( int idx, EditType edit );
1312 
1314  EditorLayout editorLayout();
1315 
1317  void setEditorLayout( EditorLayout editorLayout );
1318 
1347  void setEditorWidgetV2( int attrIdx, const QString& widgetType );
1348 
1364  void setEditorWidgetV2Config( int attrIdx, const QgsEditorWidgetConfig& config );
1365 
1371  Q_DECL_DEPRECATED void setCheckedState( int idx, QString checked, QString notChecked );
1372 
1374  QString editForm();
1375 
1377  void setEditForm( QString ui );
1378 
1381  QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const { return mFeatureFormSuppress; }
1382 
1385  void setFeatureFormSuppress( QgsVectorLayer::FeatureFormSuppress s ) { mFeatureFormSuppress = s; }
1386 
1388  QString annotationForm() const { return mAnnotationForm; }
1389 
1391  void setAnnotationForm( const QString& ui );
1392 
1394  QString editFormInit();
1395 
1397  void setEditFormInit( QString function );
1398 
1403  Q_DECL_DEPRECATED QMap<QString, QVariant> valueMap( int idx );
1404 
1410  Q_DECL_DEPRECATED RangeData range( int idx );
1411 
1413  ValueRelationData valueRelation( int idx );
1414 
1421  QList<QgsRelation> referencingRelations( int idx );
1422 
1428  Q_DECL_DEPRECATED QString dateFormat( int idx );
1429 
1435  Q_DECL_DEPRECATED QSize widgetSize( int idx );
1436 
1438  bool fieldEditable( int idx );
1439 
1441  bool labelOnTop( int idx );
1442 
1444  void setFieldEditable( int idx, bool editable );
1445 
1447  void setLabelOnTop( int idx, bool onTop );
1448 
1450  QgsVectorLayerEditBuffer* editBuffer() { return mEditBuffer; }
1451 
1456  void beginEditCommand( QString text );
1457 
1459  void endEditCommand();
1460 
1462  void destroyEditCommand();
1463 
1465  int fieldNameIndex( const QString& fieldName ) const;
1466 
1469  {
1472  NoMarker
1473  };
1474 
1476  static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
1477 
1479  void updateFields();
1480 
1482  void createJoinCaches();
1483 
1488  void uniqueValues( int index, QList<QVariant> &uniqueValues, int limit = -1 );
1489 
1491  QVariant minimumValue( int index );
1492 
1494  QVariant maximumValue( int index );
1495 
1496  /* Set the blending mode used for rendering each feature */
1497  void setFeatureBlendMode( const QPainter::CompositionMode &blendMode );
1498  /* Returns the current blending mode for features */
1499  QPainter::CompositionMode featureBlendMode() const;
1500 
1501  /* Set the transparency for the vector layer */
1502  void setLayerTransparency( int layerTransparency );
1503  /* Returns the current transparency for the vector layer */
1504  int layerTransparency() const;
1505 
1506  QString metadata() override;
1507 
1509  inline QgsGeometryCache* cache() { return mCache; }
1510 
1514  void setSimplifyMethod( const QgsVectorSimplifyMethod& simplifyMethod ) { mSimplifyMethod = simplifyMethod; }
1518  inline const QgsVectorSimplifyMethod& simplifyMethod() const { return mSimplifyMethod; }
1519 
1524  bool simplifyDrawingCanbeApplied( const QgsRenderContext& renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint ) const;
1525 
1526  public slots:
1534  void select( const QgsFeatureId &featureId );
1535 
1543  void select( const QgsFeatureIds& featureIds );
1544 
1552  void deselect( const QgsFeatureId featureId );
1553 
1561  void deselect( const QgsFeatureIds& featureIds );
1562 
1568  void removeSelection();
1569 
1573  virtual void updateExtents();
1574 
1576  void checkJoinLayerRemove( QString theLayerId );
1577 
1578  protected slots:
1579  void invalidateSymbolCountedFlag();
1580 
1581  signals:
1582 
1590  void selectionChanged( const QgsFeatureIds selected, const QgsFeatureIds deselected, const bool clearAndSelect );
1591 
1593  void selectionChanged();
1594 
1596  void layerModified();
1597 
1599  void beforeModifiedCheck() const;
1600 
1602  void editingStarted();
1603 
1605  void editingStopped();
1606 
1608  void beforeCommitChanges();
1609 
1611  void beforeRollBack();
1612 
1621  void attributeAdded( int idx );
1630  void attributeDeleted( int idx );
1631  void featureAdded( QgsFeatureId fid );
1632  void featureDeleted( QgsFeatureId fid );
1637  void updatedFields();
1638  void layerDeleted();
1639 
1640  void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant & );
1641  void geometryChanged( QgsFeatureId fid, QgsGeometry &geom );
1642 
1644  void committedAttributesDeleted( const QString& layerId, const QgsAttributeList& deletedAttributes );
1645  void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
1646  void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );
1647  void committedFeaturesRemoved( const QString& layerId, const QgsFeatureIds& deletedFeatureIds );
1648  void committedAttributeValuesChanges( const QString& layerId, const QgsChangedAttributesMap& changedAttributesValues );
1649  void committedGeometriesChanges( const QString& layerId, const QgsGeometryMap& changedGeometries );
1650 
1651  void saveLayerToProject();
1652 
1654  void labelingFontNotFound( QgsVectorLayer* layer, const QString& fontfamily );
1655 
1657  void featureBlendModeChanged( const QPainter::CompositionMode &blendMode );
1658 
1660  void layerTransparencyChanged( int layerTransparency );
1661 
1667  void editCommandStarted( const QString& text );
1668 
1674  void editCommandEnded();
1675 
1681  void editCommandDestroyed();
1682 
1692  void readCustomSymbology( const QDomElement& element, QString& errorMessage );
1693 
1703  void writeCustomSymbology( QDomElement& element, QDomDocument& doc, QString& errorMessage ) const;
1704 
1705  private slots:
1706  void onRelationsLoaded();
1707  void onJoinedFieldsChanged();
1708 
1709  protected:
1711  void setExtent( const QgsRectangle &rect ) override;
1712 
1713  private: // Private methods
1714 
1716  QgsVectorLayer( const QgsVectorLayer & rhs );
1717 
1719  QgsVectorLayer & operator=( QgsVectorLayer const & rhs );
1720 
1725  bool setDataProvider( QString const & provider );
1726 
1728  QgsFeatureId findFreeId();
1729 
1738  void snapToGeometry( const QgsPoint& startPoint,
1739  QgsFeatureId featureId,
1740  QgsGeometry* geom,
1741  double sqrSnappingTolerance,
1742  QMultiMap<double, QgsSnappingResult>& snappingResults,
1743  QgsSnapper::SnappingType snap_to ) const;
1744 
1746  //void addJoinedAttributes( QgsFeature& f, bool all = false );
1747 
1749  void readSldLabeling( const QDomNode& node );
1750 
1751  private: // Private attributes
1752 
1754  QgsVectorDataProvider *mDataProvider;
1755 
1757  QString mDisplayField;
1758 
1760  QString mDisplayExpression;
1761 
1763  QString mProviderKey;
1764 
1766  QgsAttributeAction* mActions;
1767 
1769  bool mReadOnly;
1770 
1775  QgsFeatureIds mSelectedFeatureIds;
1776 
1778  QgsFields mUpdatedFields;
1779 
1781  QMap< QString, QString > mAttributeAliasMap;
1782 
1784  QList< QgsAttributeEditorElement* > mAttributeEditorElements;
1785 
1787  QSet<QString> mExcludeAttributesWMS;
1789  QSet<QString> mExcludeAttributesWFS;
1790 
1792  QList< TabData > mTabs;
1793 
1795  QGis::WkbType mWkbType;
1796 
1798  QgsFeatureRendererV2 *mRendererV2;
1799 
1801  QgsVectorSimplifyMethod mSimplifyMethod;
1802 
1804  QgsLabel *mLabel;
1805 
1807  bool mLabelOn;
1808 
1810  bool mLabelFontNotFoundNotified;
1811 
1813  QPainter::CompositionMode mFeatureBlendMode;
1814 
1816  int mLayerTransparency;
1817 
1819  bool mVertexMarkerOnlyForSelection;
1820 
1821  QStringList mCommitErrors;
1822 
1823  QMap< QString, bool> mFieldEditables;
1824  QMap< QString, bool> mLabelOnTop;
1825 
1826  QMap<QString, QString> mEditorWidgetV2Types;
1827  QMap<QString, QgsEditorWidgetConfig > mEditorWidgetV2Configs;
1828 
1830  EditorLayout mEditorLayout;
1831 
1832  QString mEditForm, mEditFormInit;
1833 
1836  QgsVectorLayer::FeatureFormSuppress mFeatureFormSuppress;
1837 
1838  //annotation form for this layer
1839  QString mAnnotationForm;
1840 
1842  QgsGeometryCache* mCache;
1843 
1845  QgsVectorLayerEditBuffer* mEditBuffer;
1847 
1848  //stores information about joined layers
1849  QgsVectorLayerJoinBuffer* mJoinBuffer;
1850 
1852  QgsExpressionFieldBuffer* mExpressionFieldBuffer;
1853 
1854  //diagram rendering object. 0 if diagram drawing is disabled
1855  QgsDiagramRendererV2* mDiagramRenderer;
1856 
1857  //stores infos about diagram placement (placement type, priority, position distance)
1858  QgsDiagramLayerSettings *mDiagramLayerSettings;
1859 
1860  bool mValidExtent;
1861  bool mLazyExtent;
1862 
1863  // Features in renderer classes counted
1864  bool mSymbolFeatureCounted;
1865 
1866  // Feature counts for each renderer symbol
1867  QMap<QgsSymbolV2*, long> mSymbolFeatureCountMap;
1868 
1870 };
1871 
1872 #endif
virtual bool isEditable() const
True if the layer can be edited.
Wrapper for iterator of features from vector data provider or vector layer.
QString annotationForm() const
get annotation form
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
Definition: qgsfeature.h:315
static unsigned index
A rectangle specified with double values.
Definition: qgsrectangle.h:35
Base class for all map layer types.
Definition: qgsmaplayer.h:49
QString joinFieldName
Join field in the source layer.
const QSet< QString > & excludeAttributesWMS() const
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.
virtual bool isGroupBox() const
RangeData(QVariant theMin, QVariant theMax, QVariant theStep)
QgsAttributeAction * actions()
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeature.h:317
QList< QgsFeature > QgsFeatureList
Definition: qgsfeature.h:322
EditorLayout
The different types to layout the attribute editor.
Manages an editor widget Widget and wrapper share the same parent.
void setExcludeAttributesWMS(const QSet< QString > &att)
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:129
QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const
Type of feature form pop-up suppression after feature creation (overrides app setting) ...
FeatureFormSuppress
Types of feature form suppression after feature creation.
SimplifyHint
Simplification flags for fast rendering of features.
Container of fields for a vector layer.
Definition: qgsfield.h:172
GeometryType
Definition: qgis.h:155
virtual ~QgsAttributeEditorElement()
virtual QgsMapLayerRenderer * createMapRenderer(QgsRenderContext &rendererContext)
Return new instance of QgsMapLayerRenderer that will be used for rendering of given context...
Definition: qgsmaplayer.h:134
WkbType
Used for symbology operations.
Definition: qgis.h:53
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
QgsAttributeEditorField(QString name, int idx, QObject *parent)
TabData(QString name, QList< QString > fields, QList< GroupData > groups)
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.
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:34
SnappingType
Snap to vertex, to segment or both.
Definition: qgssnapper.h:66
QString prefix
An optional prefix.
QgsVectorLayerEditBuffer * editBuffer()
Buffer with uncommitted editing operations. Only valid after editing has been turned on...
void setJoinFieldNamesSubset(QStringList *fieldNamesSubset)
Set subset of fields to be used from joined layer.
bool operator==(const QgsVectorJoinInfo &other) const
value map from an table
virtual bool writeXml(QDomNode &layer_node, QDomDocument &document)
called by writeLayerXML(), used by children to write state specific to them to project files...
const QSet< QString > & excludeAttributesWFS() const
VertexMarkerType
Editing vertex markers.
virtual void setExtent(const QgsRectangle &rect)
Set the extent.
The attribute value should not be changed in the attribute form.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
QList< int > QgsAttributeList
AttributeEditorType type() const
QSharedPointer< QStringList > joinFieldsSubset
Subset of fields to use from joined layer.
Encapsulate a field in an attribute table or data source.
Definition: qgsfield.h:33
const QMap< QString, QString > & attributeAliases() const
const QgsDiagramRendererV2 * diagramRenderer() const
A class to represent a point.
Definition: qgspoint.h:63
virtual bool readSld(const QDomNode &node, QString &errorMessage)
Definition: qgsmaplayer.h:353
QList< QgsAttributeEditorElement * > children() const
Partial snapshot of vector layer's state (only the members necessary for access to features) ...
QList< QString > mFields
A class to render labels.
Definition: qgslabel.h:51
modularized edit widgets
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)
Buffers information about expression fields for a vector layer.
virtual QDomElement toDomElement(QDomDocument &doc) const =0
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:312
The attribute value should not be shown in the attribute form.
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...
uuid generator - readonly and automatically intialized
QgsAttributeEditorRelation(QString name, const QgsRelation &relation, QObject *parent)
Class for doing transforms between two map coordinate systems.
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) ...
QStringList * joinFieldNamesSubset() const
Get subset of fields to be used from joined layer.
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)
QSet< int > QgsAttributeIds
QgsAttributeEditorContainer(QString name, QObject *parent)
This is the base class for vector data providers.
QList< int > QgsAttributeList
virtual QgsRectangle extent()
Return the extent of the layer.
Represents a vector layer which manages a vector based data sets.
QString joinLayerId
Source layer.
AttributeEditorType mType
Abstract base class for simplify geometries using a specific algorithm.
QList< GroupData > mGroups