QGIS API Documentation  2.8.6-Wien
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 
67 class CORE_EXPORT QgsAttributeEditorElement : public QObject
68 {
69  Q_OBJECT
70  public:
71 
73  {
77  AeTypeInvalid
78  };
79 
80  QgsAttributeEditorElement( AttributeEditorType type, QString name, QObject *parent = NULL )
81  : QObject( parent ), mType( type ), mName( name ) {}
82 
84 
85  QString name() const { return mName; }
86  AttributeEditorType type() const { return mType; }
87 
88  virtual QDomElement toDomElement( QDomDocument& doc ) const = 0;
89 
90  protected:
92  QString mName;
93 };
94 
96 {
97  public:
98  QgsAttributeEditorContainer( QString name, QObject *parent )
99  : QgsAttributeEditorElement( AeTypeContainer, name, parent )
100  , mIsGroupBox( true )
101  {}
102 
104 
105  virtual QDomElement toDomElement( QDomDocument& doc ) const override;
106  virtual void addChildElement( QgsAttributeEditorElement *widget );
107  virtual void setIsGroupBox( bool isGroupBox ) { mIsGroupBox = isGroupBox; }
108  virtual bool isGroupBox() const { return mIsGroupBox; }
109  QList<QgsAttributeEditorElement*> children() const { return mChildren; }
110  virtual QList<QgsAttributeEditorElement*> findElements( AttributeEditorType type ) const;
111 
112  private:
113  bool mIsGroupBox;
114  QList<QgsAttributeEditorElement*> mChildren;
115 };
116 
117 
119 {
120  public:
121  QgsAttributeEditorField( QString name, int idx, QObject *parent )
122  : QgsAttributeEditorElement( AeTypeField, name, parent ), mIdx( idx ) {}
123 
125 
126  virtual QDomElement toDomElement( QDomDocument& doc ) const override;
127  int idx() const { return mIdx; }
128 
129  private:
130  int mIdx;
131 };
132 
135 {
136  public:
137  QgsAttributeEditorRelation( QString name, const QString &relationId, QObject *parent )
138  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
139  , mRelationId( relationId ) {}
140 
141  QgsAttributeEditorRelation( QString name, const QgsRelation& relation, QObject *parent )
142  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
143  , mRelationId( relation.id() )
144  , mRelation( relation ) {}
145 
147 
148  virtual QDomElement toDomElement( QDomDocument& doc ) const override;
149  const QgsRelation& relation() const { return mRelation; }
150 
157  bool init( QgsRelationManager *relManager );
158 
159  private:
160  QString mRelationId;
161  QgsRelation mRelation;
162 };
163 
164 
165 struct CORE_EXPORT QgsVectorJoinInfo
166 {
170  QString joinLayerId;
172  QString joinFieldName;
178  QHash< QString, QgsAttributes> cachedAttributes;
179 
184 
188  QString prefix;
189 
190  bool operator==( const QgsVectorJoinInfo& other ) const
191  {
192  return targetFieldName == other.targetFieldName &&
193  joinLayerId == other.joinLayerId &&
194  joinFieldName == other.joinFieldName &&
195  joinFieldsSubset == other.joinFieldsSubset &&
196  memoryCache == other.memoryCache &&
197  prefix == other.prefix;
198  }
199 
202  void setJoinFieldNamesSubset( QStringList* fieldNamesSubset ) { joinFieldsSubset = QSharedPointer<QStringList>( fieldNamesSubset ); }
205  QStringList* joinFieldNamesSubset() const { return joinFieldsSubset.data(); }
206 
207 protected:
209  QSharedPointer<QStringList> joinFieldsSubset;
210 };
211 
474 class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
475 {
476  Q_OBJECT
477 
478  public:
481  {
482  GeneratedLayout = 0,
483  TabLayout = 1,
484  UiFileLayout = 2
485  };
486 
490  enum EditType
491  {
513  };
514 
518  {
519  SuppressDefault = 0, // use the application-wide setting
520  SuppressOn = 1,
521  SuppressOff = 2
522  };
523 
524  struct RangeData
525  {
526  RangeData() { mMin = QVariant( 0 ); mMax = QVariant( 5 ); mStep = QVariant( 1 );}
527  RangeData( QVariant theMin, QVariant theMax, QVariant theStep )
528  : mMin( theMin ), mMax( theMax ), mStep( theStep ) {}
529 
530  QVariant mMin;
531  QVariant mMax;
532  QVariant mStep;
533  };
534 
536  {
537  ValueRelationData() : mAllowNull( false ), mOrderByValue( false ), mAllowMulti( false ) {}
538  ValueRelationData( QString layer, QString key, QString value, bool allowNull, bool orderByValue,
539  bool allowMulti = false,
540  QString filterExpression = QString::null )
541  : mLayer( layer )
542  , mKey( key )
543  , mValue( value )
544  , mFilterExpression( filterExpression )
545  , mAllowNull( allowNull )
546  , mOrderByValue( orderByValue )
547  , mAllowMulti( allowMulti )
548  {}
549 
550  QString mLayer;
551  QString mKey;
552  QString mValue;
556  bool mAllowMulti; /* allow selection of multiple keys */
557  };
558 
559  struct GroupData
560  {
562  GroupData( QString name, QList<QString> fields )
563  : mName( name ), mFields( fields ) {}
564  QString mName;
565  QList<QString> mFields;
566  };
567 
568  struct TabData
569  {
570  TabData() {}
571  TabData( QString name, QList<QString> fields, QList<GroupData> groups )
572  : mName( name ), mFields( fields ), mGroups( groups ) {}
573  QString mName;
574  QList<QString> mFields;
575  QList<GroupData> mGroups;
576  };
577 
591  QgsVectorLayer( QString path = QString::null, QString baseName = QString::null,
592  QString providerLib = QString::null, bool loadDefaultStyleFlag = true );
593 
595  virtual ~QgsVectorLayer();
596 
598  QString storageType() const;
599 
601  QString capabilitiesString() const;
602 
604  QString dataComment() const;
605 
607  void setDisplayField( QString fldName = "" );
608 
610  const QString displayField() const;
611 
618  void setDisplayExpression( const QString &displayExpression );
619 
626  const QString displayExpression();
627 
629  QgsVectorDataProvider* dataProvider();
630 
634  const QgsVectorDataProvider* dataProvider() const;
635 
637  void setProviderEncoding( const QString& encoding );
638 
640  void setCoordinateSystem();
641 
645  bool addJoin( const QgsVectorJoinInfo& joinInfo );
646 
648  void removeJoin( const QString& joinLayerId );
649 
650  const QList<QgsVectorJoinInfo> vectorJoins() const;
651 
660  void addExpressionField( const QString& exp, const QgsField& fld );
661 
669  void removeExpressionField( int index );
670 
672  QgsLabel *label();
673 
674  const QgsLabel *label() const;
675 
676  QgsAttributeAction *actions() { return mActions; }
677 
683  int selectedFeatureCount();
684 
693  void select( QgsRectangle & rect, bool addToSelection );
694 
706  void modifySelection( QgsFeatureIds selectIds, QgsFeatureIds deselectIds );
707 
709  void invertSelection();
710 
712  void selectAll();
713 
715  QgsFeatureIds allFeatureIds();
716 
724  void invertSelectionInRectangle( QgsRectangle & rect );
725 
734  QgsFeatureList selectedFeatures();
735 
747  QgsFeatureIterator selectedFeaturesIterator( QgsFeatureRequest request = QgsFeatureRequest() );
748 
755  const QgsFeatureIds &selectedFeaturesIds() const;
756 
764  void setSelectedFeatures( const QgsFeatureIds &ids );
765 
767  QgsRectangle boundingBoxOfSelected();
768 
770  void setDiagramRenderer( QgsDiagramRendererV2* r );
771  const QgsDiagramRendererV2* diagramRenderer() const { return mDiagramRenderer; }
772 
773  void setDiagramLayerSettings( const QgsDiagramLayerSettings& s );
774  const QgsDiagramLayerSettings *diagramLayerSettings() const { return mDiagramLayerSettings; }
775 
777  QgsFeatureRendererV2* rendererV2();
779  void setRendererV2( QgsFeatureRendererV2* r );
780 
782  QGis::GeometryType geometryType() const;
783 
785  bool hasGeometryType() const;
786 
788  QGis::WkbType wkbType() const;
789 
791  QString providerType() const;
792 
796  virtual bool readXml( const QDomNode& layer_node ) override;
797 
801  virtual bool writeXml( QDomNode & layer_node, QDomDocument & doc ) override;
802 
811  virtual void saveStyleToDatabase( QString name, QString description,
812  bool useAsDefault, QString uiFileContent,
813  QString &msgError );
814 
823  virtual int listStylesInDatabase( QStringList &ids, QStringList &names,
824  QStringList &descriptions, QString &msgError );
825 
829  virtual QString getStyleFromDatabase( QString styleId, QString &msgError );
830 
837  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag, bool loadFromLocalDb );
838 
843  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag ) override;
844 
855  virtual bool applyNamedStyle( QString namedStyle, QString &errorMsg );
856 
861  QgsAttributeEditorElement* attributeEditorElementFromDomElement( QDomElement &elem, QObject* parent );
862 
868  bool readSymbology( const QDomNode& node, QString& errorMessage ) override;
869 
876  bool writeSymbology( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const override;
877 
878  bool writeSld( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
879  bool readSld( const QDomNode& node, QString& errorMessage ) override;
880 
888  virtual long featureCount() const;
889 
896  long featureCount( QgsSymbolV2* symbol );
897 
903  bool countSymbolFeatures( bool showProgress = true );
904 
912  virtual bool setSubsetString( QString subset );
913 
918  virtual QString subsetString();
919 
923  QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() );
924 
930  bool addFeature( QgsFeature& f, bool alsoUpdateExtent = true );
931 
938  bool updateFeature( QgsFeature &f );
939 
944  bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
945 
950  bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
951 
954  bool deleteVertex( QgsFeatureId atFeatureId, int atVertex );
955 
959  bool deleteSelectedFeatures( int *deletedCount = 0 );
960 
972  int addRing( const QList<QgsPoint>& ring, QgsFeatureId* featureId = 0 );
973 
984  int addPart( const QList<QgsPoint>& ring );
985 
991  int translateFeature( QgsFeatureId featureId, double dx, double dy );
992 
1000  int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
1001 
1009  int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
1010 
1019  Q_DECL_DEPRECATED int removePolygonIntersections( QgsGeometry* geom, QgsFeatureIds ignoreFeatures = QgsFeatureIds() );
1020 
1026  int addTopologicalPoints( QgsGeometry* geom );
1027 
1035  int addTopologicalPoints( const QgsPoint& p );
1036 
1042  int insertSegmentVerticesForSnap( const QList<QgsSnappingResult>& snapResults );
1043 
1045  void enableLabels( bool on );
1046 
1048  bool hasLabelsEnabled() const;
1049 
1051  virtual bool isEditable() const override;
1052 
1054  virtual bool isReadOnly() const;
1055 
1057  virtual bool isModified() const;
1058 
1065  bool snapPoint( QgsPoint& point, double tolerance );
1066 
1074  int snapWithContext( const QgsPoint& startPoint,
1075  double snappingTolerance,
1076  QMultiMap < double, QgsSnappingResult > &snappingResults,
1077  QgsSnapper::SnappingType snap_to );
1078 
1080  virtual void reload() override;
1081 
1085  virtual QgsMapLayerRenderer* createMapRenderer( QgsRenderContext& rendererContext ) override;
1086 
1090  bool draw( QgsRenderContext& rendererContext ) override;
1091 
1093  void drawLabels( QgsRenderContext& rendererContext ) override;
1094 
1096  QgsRectangle extent() override;
1097 
1099  const QgsFields &pendingFields() const;
1100 
1102  QgsAttributeList pendingAllAttributesList();
1103 
1105  QgsAttributeList pendingPkAttributesList();
1106 
1108  int pendingFeatureCount();
1109 
1113  bool setReadOnly( bool readonly = true );
1114 
1116  bool startEditing();
1117 
1119  bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom );
1120 
1127  Q_DECL_DEPRECATED bool changeAttributeValue( QgsFeatureId fid, int field, QVariant value, bool emitSignal );
1128 
1139  bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant() );
1140 
1143  bool addAttribute( const QgsField &field );
1144 
1146  void addAttributeAlias( int attIndex, QString aliasString );
1147 
1149  void remAttributeAlias( int attIndex );
1150 
1154  void addAttributeEditorWidget( QgsAttributeEditorElement* data );
1155 
1163  const QString editorWidgetV2( int fieldIdx ) const;
1164 
1174  const QString editorWidgetV2( const QString& fieldName ) const;
1175 
1183  const QgsEditorWidgetConfig editorWidgetV2Config( int fieldIdx ) const;
1184 
1194  const QgsEditorWidgetConfig editorWidgetV2Config( const QString& fieldName ) const;
1195 
1199  QList< QgsAttributeEditorElement* > &attributeEditorElements();
1203  void clearAttributeEditorWidgets();
1204 
1206  QString attributeAlias( int attributeIndex ) const;
1207 
1209  QString attributeDisplayName( int attributeIndex ) const;
1210 
1211  const QMap< QString, QString >& attributeAliases() const { return mAttributeAliasMap; }
1212 
1213  const QSet<QString>& excludeAttributesWMS() const { return mExcludeAttributesWMS; }
1214  void setExcludeAttributesWMS( const QSet<QString>& att ) { mExcludeAttributesWMS = att; }
1215 
1216  const QSet<QString>& excludeAttributesWFS() const { return mExcludeAttributesWFS; }
1217  void setExcludeAttributesWFS( const QSet<QString>& att ) { mExcludeAttributesWFS = att; }
1218 
1220  bool deleteAttribute( int attr );
1221 
1229  bool deleteAttributes( QList<int> attrs );
1230 
1232  bool addFeatures( QgsFeatureList features, bool makeSelected = true );
1233 
1235  bool deleteFeature( QgsFeatureId fid );
1236 
1252  bool commitChanges();
1253  const QStringList &commitErrors();
1254 
1258  bool rollBack( bool deleteBuffer = true );
1259 
1265  Q_DECL_DEPRECATED EditType editType( int idx );
1266 
1272  Q_DECL_DEPRECATED void setEditType( int idx, EditType edit );
1273 
1275  EditorLayout editorLayout();
1276 
1278  void setEditorLayout( EditorLayout editorLayout );
1279 
1308  void setEditorWidgetV2( int attrIdx, const QString& widgetType );
1309 
1325  void setEditorWidgetV2Config( int attrIdx, const QgsEditorWidgetConfig& config );
1326 
1332  Q_DECL_DEPRECATED void setCheckedState( int idx, QString checked, QString notChecked );
1333 
1335  QString editForm();
1336 
1338  void setEditForm( QString ui );
1339 
1342  QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const { return mFeatureFormSuppress; }
1343 
1346  void setFeatureFormSuppress( QgsVectorLayer::FeatureFormSuppress s ) { mFeatureFormSuppress = s; }
1347 
1349  QString annotationForm() const { return mAnnotationForm; }
1350 
1352  void setAnnotationForm( const QString& ui );
1353 
1355  QString editFormInit();
1356 
1358  void setEditFormInit( QString function );
1359 
1364  Q_DECL_DEPRECATED QMap<QString, QVariant> valueMap( int idx );
1365 
1371  Q_DECL_DEPRECATED RangeData range( int idx );
1372 
1374  ValueRelationData valueRelation( int idx );
1375 
1382  QList<QgsRelation> referencingRelations( int idx );
1383 
1389  Q_DECL_DEPRECATED QString dateFormat( int idx );
1390 
1396  Q_DECL_DEPRECATED QSize widgetSize( int idx );
1397 
1399  bool fieldEditable( int idx );
1400 
1402  bool labelOnTop( int idx );
1403 
1405  void setFieldEditable( int idx, bool editable );
1406 
1408  void setLabelOnTop( int idx, bool onTop );
1409 
1411  QgsVectorLayerEditBuffer* editBuffer() { return mEditBuffer; }
1412 
1417  void beginEditCommand( QString text );
1418 
1420  void endEditCommand();
1421 
1423  void destroyEditCommand();
1424 
1426  int fieldNameIndex( const QString& fieldName ) const;
1427 
1430  {
1433  NoMarker
1434  };
1435 
1437  static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
1438 
1440  void updateFields();
1441 
1443  void createJoinCaches();
1444 
1449  void uniqueValues( int index, QList<QVariant> &uniqueValues, int limit = -1 );
1450 
1452  QVariant minimumValue( int index );
1453 
1455  QVariant maximumValue( int index );
1456 
1457  /* Set the blending mode used for rendering each feature */
1458  void setFeatureBlendMode( const QPainter::CompositionMode &blendMode );
1459  /* Returns the current blending mode for features */
1460  QPainter::CompositionMode featureBlendMode() const;
1461 
1462  /* Set the transparency for the vector layer */
1463  void setLayerTransparency( int layerTransparency );
1464  /* Returns the current transparency for the vector layer */
1465  int layerTransparency() const;
1466 
1467  QString metadata() override;
1468 
1470  inline QgsGeometryCache* cache() { return mCache; }
1471 
1475  void setSimplifyMethod( const QgsVectorSimplifyMethod& simplifyMethod ) { mSimplifyMethod = simplifyMethod; }
1479  inline const QgsVectorSimplifyMethod& simplifyMethod() const { return mSimplifyMethod; }
1480 
1485  bool simplifyDrawingCanbeApplied( const QgsRenderContext& renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint ) const;
1486 
1487  public slots:
1495  void select( const QgsFeatureId &featureId );
1496 
1504  void select( const QgsFeatureIds& featureIds );
1505 
1513  void deselect( const QgsFeatureId featureId );
1514 
1522  void deselect( const QgsFeatureIds& featureIds );
1523 
1529  void removeSelection();
1530 
1534  virtual void updateExtents();
1535 
1537  void checkJoinLayerRemove( QString theLayerId );
1538 
1539  protected slots:
1540  void invalidateSymbolCountedFlag();
1541 
1542  signals:
1543 
1551  void selectionChanged( const QgsFeatureIds selected, const QgsFeatureIds deselected, const bool clearAndSelect );
1552 
1554  void selectionChanged();
1555 
1557  void layerModified();
1558 
1560  void beforeModifiedCheck() const;
1561 
1563  void editingStarted();
1564 
1566  void editingStopped();
1567 
1569  void beforeCommitChanges();
1570 
1572  void beforeRollBack();
1573 
1582  void attributeAdded( int idx );
1591  void attributeDeleted( int idx );
1592  void featureAdded( QgsFeatureId fid );
1593  void featureDeleted( QgsFeatureId fid );
1598  void updatedFields();
1599  void layerDeleted();
1600 
1601  void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant & );
1602  void geometryChanged( QgsFeatureId fid, QgsGeometry &geom );
1603 
1605  void committedAttributesDeleted( const QString& layerId, const QgsAttributeList& deletedAttributes );
1606  void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
1607  void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );
1608  void committedFeaturesRemoved( const QString& layerId, const QgsFeatureIds& deletedFeatureIds );
1609  void committedAttributeValuesChanges( const QString& layerId, const QgsChangedAttributesMap& changedAttributesValues );
1610  void committedGeometriesChanges( const QString& layerId, const QgsGeometryMap& changedGeometries );
1611 
1612  void saveLayerToProject();
1613 
1615  void labelingFontNotFound( QgsVectorLayer* layer, const QString& fontfamily );
1616 
1618  void featureBlendModeChanged( const QPainter::CompositionMode &blendMode );
1619 
1621  void layerTransparencyChanged( int layerTransparency );
1622 
1628  void editCommandStarted( const QString& text );
1629 
1635  void editCommandEnded();
1636 
1642  void editCommandDestroyed();
1643 
1653  void readCustomSymbology( const QDomElement& element, QString& errorMessage );
1654 
1664  void writeCustomSymbology( QDomElement& element, QDomDocument& doc, QString& errorMessage ) const;
1665 
1666  private slots:
1667  void onRelationsLoaded();
1668  void onJoinedFieldsChanged();
1669 
1670  protected:
1672  void setExtent( const QgsRectangle &rect ) override;
1673 
1674  private: // Private methods
1675 
1677  QgsVectorLayer( const QgsVectorLayer & rhs );
1678 
1680  QgsVectorLayer & operator=( QgsVectorLayer const & rhs );
1681 
1686  bool setDataProvider( QString const & provider );
1687 
1689  QgsFeatureId findFreeId();
1690 
1699  void snapToGeometry( const QgsPoint& startPoint,
1700  QgsFeatureId featureId,
1701  QgsGeometry* geom,
1702  double sqrSnappingTolerance,
1703  QMultiMap<double, QgsSnappingResult>& snappingResults,
1704  QgsSnapper::SnappingType snap_to ) const;
1705 
1707  //void addJoinedAttributes( QgsFeature& f, bool all = false );
1708 
1710  void readSldLabeling( const QDomNode& node );
1711 
1712  private: // Private attributes
1713 
1715  QgsVectorDataProvider *mDataProvider;
1716 
1718  QString mDisplayField;
1719 
1721  QString mDisplayExpression;
1722 
1724  QString mProviderKey;
1725 
1727  QgsAttributeAction* mActions;
1728 
1730  bool mReadOnly;
1731 
1736  QgsFeatureIds mSelectedFeatureIds;
1737 
1739  QgsFields mUpdatedFields;
1740 
1742  QMap< QString, QString > mAttributeAliasMap;
1743 
1745  QList< QgsAttributeEditorElement* > mAttributeEditorElements;
1746 
1748  QSet<QString> mExcludeAttributesWMS;
1750  QSet<QString> mExcludeAttributesWFS;
1751 
1753  QList< TabData > mTabs;
1754 
1756  QGis::WkbType mWkbType;
1757 
1759  QgsFeatureRendererV2 *mRendererV2;
1760 
1762  QgsVectorSimplifyMethod mSimplifyMethod;
1763 
1765  QgsLabel *mLabel;
1766 
1768  bool mLabelOn;
1769 
1771  bool mLabelFontNotFoundNotified;
1772 
1774  QPainter::CompositionMode mFeatureBlendMode;
1775 
1777  int mLayerTransparency;
1778 
1780  bool mVertexMarkerOnlyForSelection;
1781 
1782  QStringList mCommitErrors;
1783 
1784  QMap< QString, bool> mFieldEditables;
1785  QMap< QString, bool> mLabelOnTop;
1786 
1787  QMap<QString, QString> mEditorWidgetV2Types;
1788  QMap<QString, QgsEditorWidgetConfig > mEditorWidgetV2Configs;
1789 
1791  EditorLayout mEditorLayout;
1792 
1793  QString mEditForm, mEditFormInit;
1794 
1797  QgsVectorLayer::FeatureFormSuppress mFeatureFormSuppress;
1798 
1799  //annotation form for this layer
1800  QString mAnnotationForm;
1801 
1803  QgsGeometryCache* mCache;
1804 
1806  QgsVectorLayerEditBuffer* mEditBuffer;
1808 
1809  //stores information about joined layers
1810  QgsVectorLayerJoinBuffer* mJoinBuffer;
1811 
1813  QgsExpressionFieldBuffer* mExpressionFieldBuffer;
1814 
1815  //diagram rendering object. 0 if diagram drawing is disabled
1816  QgsDiagramRendererV2* mDiagramRenderer;
1817 
1818  //stores infos about diagram placement (placement type, priority, position distance)
1819  QgsDiagramLayerSettings *mDiagramLayerSettings;
1820 
1821  bool mValidExtent;
1822  bool mLazyExtent;
1823 
1824  // Features in renderer classes counted
1825  bool mSymbolFeatureCounted;
1826 
1827  // Feature counts for each renderer symbol
1828  QMap<QgsSymbolV2*, long> mSymbolFeatureCountMap;
1829 
1831 };
1832 
1833 #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:358
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:360
QList< QgsFeature > QgsFeatureList
Definition: qgsfeature.h:365
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:156
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:355
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