QGIS API Documentation  2.11.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 /***************************************************************************
3  qgsvectorlayer.h - description
4  -------------------
5  begin : Oct 29, 2003
6  copyright : (C) 2003 by Gary E.Sherman
7  email : sherman at mrcc.com
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 
19 #ifndef QGSVECTORLAYER_H
20 #define QGSVECTORLAYER_H
21 
22 #include <QMap>
23 #include <QSet>
24 #include <QList>
25 #include <QStringList>
26 
27 #include "qgis.h"
28 #include "qgsmaplayer.h"
29 #include "qgsfeature.h"
30 #include "qgsfeatureiterator.h"
31 #include "qgseditorwidgetconfig.h"
32 #include "qgsfield.h"
33 #include "qgssnapper.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 class QgsPointV2;
64 
67 
77 class CORE_EXPORT QgsAttributeEditorElement : public QObject
78 {
79  Q_OBJECT
80  public:
81 
83  {
87  AeTypeInvalid
88  };
89 
98  : QObject( parent ), mType( type ), mName( name ) {}
99 
102 
108  QString name() const { return mName; }
109 
115  AttributeEditorType type() const { return mType; }
116 
124  virtual QDomElement toDomElement( QDomDocument& doc ) const = 0;
125 
126  protected:
129 };
130 
136 {
137  public:
145  : QgsAttributeEditorElement( AeTypeContainer, name, parent )
146  , mIsGroupBox( true )
147  {}
148 
151 
159  virtual QDomElement toDomElement( QDomDocument& doc ) const override;
160 
166  virtual void addChildElement( QgsAttributeEditorElement* element );
167 
173  virtual void setIsGroupBox( bool isGroupBox ) { mIsGroupBox = isGroupBox; }
174 
180  virtual bool isGroupBox() const { return mIsGroupBox; }
181 
187  QList<QgsAttributeEditorElement*> children() const { return mChildren; }
188 
196  virtual QList<QgsAttributeEditorElement*> findElements( AttributeEditorType type ) const;
197 
203  void setName( const QString& name );
204 
205  private:
206  bool mIsGroupBox;
208 };
209 
214 {
215  public:
223  QgsAttributeEditorField( QString name, int idx, QObject *parent )
224  : QgsAttributeEditorElement( AeTypeField, name, parent ), mIdx( idx ) {}
225 
228 
236  virtual QDomElement toDomElement( QDomDocument& doc ) const override;
237 
242  int idx() const { return mIdx; }
243 
244  private:
245  int mIdx;
246 };
247 
254 {
255  public:
263  QgsAttributeEditorRelation( QString name, const QString &relationId, QObject *parent )
264  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
265  , mRelationId( relationId ) {}
266 
274  QgsAttributeEditorRelation( QString name, const QgsRelation& relation, QObject *parent )
275  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
276  , mRelationId( relation.id() )
277  , mRelation( relation ) {}
278 
281 
289  virtual QDomElement toDomElement( QDomDocument& doc ) const override;
290 
296  const QgsRelation& relation() const { return mRelation; }
297 
304  bool init( QgsRelationManager *relManager );
305 
306  private:
307  QString mRelationId;
308  QgsRelation mRelation;
309 };
310 
311 
312 struct CORE_EXPORT QgsVectorJoinInfo
313 {
326 
331 
336 
337  bool operator==( const QgsVectorJoinInfo& other ) const
338  {
339  return targetFieldName == other.targetFieldName &&
340  joinLayerId == other.joinLayerId &&
341  joinFieldName == other.joinFieldName &&
342  joinFieldsSubset == other.joinFieldsSubset &&
343  memoryCache == other.memoryCache &&
344  prefix == other.prefix;
345  }
346 
349  void setJoinFieldNamesSubset( QStringList* fieldNamesSubset ) { joinFieldsSubset = QSharedPointer<QStringList>( fieldNamesSubset ); }
352  QStringList* joinFieldNamesSubset() const { return joinFieldsSubset.data(); }
353 
354 protected:
357 };
358 
621 class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
622 {
623  Q_OBJECT
624 
625  public:
628  {
629  GeneratedLayout = 0,
630  TabLayout = 1,
631  UiFileLayout = 2
632  };
633 
637  enum EditType
638  {
660  };
661 
665  {
666  SuppressDefault = 0, // use the application-wide setting
667  SuppressOn = 1,
668  SuppressOff = 2
669  };
670 
671  struct RangeData
672  {
673  RangeData() { mMin = QVariant( 0 ); mMax = QVariant( 5 ); mStep = QVariant( 1 );}
674  RangeData( QVariant theMin, QVariant theMax, QVariant theStep )
675  : mMin( theMin ), mMax( theMax ), mStep( theStep ) {}
676 
680  };
681 
683  {
684  ValueRelationData() : mAllowNull( false ), mOrderByValue( false ), mAllowMulti( false ) {}
685  ValueRelationData( QString layer, QString key, QString value, bool allowNull, bool orderByValue,
686  bool allowMulti = false,
687  QString filterExpression = QString::null )
688  : mLayer( layer )
689  , mKey( key )
690  , mValue( value )
691  , mFilterExpression( filterExpression )
692  , mAllowNull( allowNull )
693  , mOrderByValue( orderByValue )
694  , mAllowMulti( allowMulti )
695  {}
696 
703  bool mAllowMulti; /* allow selection of multiple keys */
704  };
705 
706  struct GroupData
707  {
710  : mName( name ), mFields( fields ) {}
713  };
714 
715  struct TabData
716  {
717  TabData() {}
719  : mName( name ), mFields( fields ), mGroups( groups ) {}
723  };
724 
738  QgsVectorLayer( QString path = QString::null, QString baseName = QString::null,
739  QString providerLib = QString::null, bool loadDefaultStyleFlag = true );
740 
742  virtual ~QgsVectorLayer();
743 
745  QString storageType() const;
746 
748  QString capabilitiesString() const;
749 
751  QString dataComment() const;
752 
754  void setDisplayField( QString fldName = "" );
755 
757  const QString displayField() const;
758 
765  void setDisplayExpression( const QString &displayExpression );
766 
773  const QString displayExpression();
774 
776  QgsVectorDataProvider* dataProvider();
777 
781  const QgsVectorDataProvider* dataProvider() const;
782 
784  void setProviderEncoding( const QString& encoding );
785 
787  void setCoordinateSystem();
788 
792  bool addJoin( const QgsVectorJoinInfo& joinInfo );
793 
795  void removeJoin( const QString& joinLayerId );
796 
797  const QList<QgsVectorJoinInfo> vectorJoins() const;
798 
809  int addExpressionField( const QString& exp, const QgsField& fld );
810 
818  void removeExpressionField( int index );
819 
829  const QString expressionField( int index );
830 
840  void updateExpressionField( int index, const QString& exp );
841 
843  QgsLabel *label();
844 
845  const QgsLabel *label() const;
846 
847  QgsAttributeAction *actions() { return mActions; }
848 
854  int selectedFeatureCount();
855 
864  void select( QgsRectangle & rect, bool addToSelection );
865 
877  void modifySelection( QgsFeatureIds selectIds, QgsFeatureIds deselectIds );
878 
880  void invertSelection();
881 
883  void selectAll();
884 
886  QgsFeatureIds allFeatureIds();
887 
895  void invertSelectionInRectangle( QgsRectangle & rect );
896 
905  QgsFeatureList selectedFeatures();
906 
918  QgsFeatureIterator selectedFeaturesIterator( QgsFeatureRequest request = QgsFeatureRequest() );
919 
926  const QgsFeatureIds &selectedFeaturesIds() const;
927 
935  void setSelectedFeatures( const QgsFeatureIds &ids );
936 
938  QgsRectangle boundingBoxOfSelected();
939 
944  bool labelsEnabled() const;
945 
950  bool diagramsEnabled() const;
951 
953  void setDiagramRenderer( QgsDiagramRendererV2* r );
954  const QgsDiagramRendererV2* diagramRenderer() const { return mDiagramRenderer; }
955 
956  void setDiagramLayerSettings( const QgsDiagramLayerSettings& s );
957  const QgsDiagramLayerSettings *diagramLayerSettings() const { return mDiagramLayerSettings; }
958 
960  QgsFeatureRendererV2* rendererV2();
962  void setRendererV2( QgsFeatureRendererV2* r );
963 
965  QGis::GeometryType geometryType() const;
966 
968  bool hasGeometryType() const;
969 
971  QGis::WkbType wkbType() const;
972 
974  QString providerType() const;
975 
979  virtual bool readXml( const QDomNode& layer_node ) override;
980 
984  virtual bool writeXml( QDomNode & layer_node, QDomDocument & doc ) override;
985 
994  virtual void saveStyleToDatabase( QString name, QString description,
995  bool useAsDefault, QString uiFileContent,
996  QString &msgError );
997 
1006  virtual int listStylesInDatabase( QStringList &ids, QStringList &names,
1007  QStringList &descriptions, QString &msgError );
1008 
1012  virtual QString getStyleFromDatabase( QString styleId, QString &msgError );
1013 
1020  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag, bool loadFromLocalDb );
1021 
1026  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag ) override;
1027 
1038  virtual bool applyNamedStyle( QString namedStyle, QString &errorMsg );
1039 
1044  QgsAttributeEditorElement* attributeEditorElementFromDomElement( QDomElement &elem, QObject* parent );
1045 
1051  bool readSymbology( const QDomNode& node, QString& errorMessage ) override;
1052 
1059  bool writeSymbology( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const override;
1060 
1061  bool writeSld( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
1062  bool readSld( const QDomNode& node, QString& errorMessage ) override;
1063 
1071  virtual long featureCount() const;
1072 
1079  long featureCount( QgsSymbolV2* symbol );
1080 
1091  void setDataSource( QString dataSource, QString baseName, QString provider, bool loadDefaultStyleFlag = false );
1092 
1098  bool countSymbolFeatures( bool showProgress = true );
1099 
1107  virtual bool setSubsetString( QString subset );
1108 
1113  virtual QString subsetString();
1114 
1118  QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() );
1119 
1125  bool addFeature( QgsFeature& f, bool alsoUpdateExtent = true );
1126 
1133  bool updateFeature( QgsFeature &f );
1134 
1139  bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
1140 
1145  bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
1146 
1151  bool moveVertex( const QgsPointV2& p, QgsFeatureId atFeatureId, int atVertex );
1152 
1155  bool deleteVertex( QgsFeatureId atFeatureId, int atVertex );
1156 
1160  bool deleteSelectedFeatures( int *deletedCount = 0 );
1161 
1171  int addRing( const QList<QgsPoint>& ring );
1172 
1183  int addPart( const QList<QgsPoint>& ring );
1184 
1190  int translateFeature( QgsFeatureId featureId, double dx, double dy );
1191 
1199  int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
1200 
1208  int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
1209 
1218  Q_DECL_DEPRECATED int removePolygonIntersections( QgsGeometry* geom, QgsFeatureIds ignoreFeatures = QgsFeatureIds() );
1219 
1225  int addTopologicalPoints( const QgsGeometry* geom );
1226 
1234  int addTopologicalPoints( const QgsPoint& p );
1235 
1241  int insertSegmentVerticesForSnap( const QList<QgsSnappingResult>& snapResults );
1242 
1246  Q_DECL_DEPRECATED void enableLabels( bool on );
1247 
1251  Q_DECL_DEPRECATED bool hasLabelsEnabled() const;
1252 
1254  virtual bool isEditable() const override;
1255 
1257  virtual bool isReadOnly() const;
1258 
1260  virtual bool isModified() const;
1261 
1268  bool snapPoint( QgsPoint& point, double tolerance );
1269 
1277  int snapWithContext( const QgsPoint& startPoint,
1278  double snappingTolerance,
1279  QMultiMap < double, QgsSnappingResult > &snappingResults,
1280  QgsSnapper::SnappingType snap_to );
1281 
1283  virtual void reload() override;
1284 
1288  virtual QgsMapLayerRenderer* createMapRenderer( QgsRenderContext& rendererContext ) override;
1289 
1293  bool draw( QgsRenderContext& rendererContext ) override;
1294 
1298  Q_DECL_DEPRECATED void drawLabels( QgsRenderContext& rendererContext ) override;
1299 
1301  QgsRectangle extent() override;
1302 
1304  const QgsFields &pendingFields() const;
1305 
1307  QgsAttributeList pendingAllAttributesList();
1308 
1310  QgsAttributeList pendingPkAttributesList();
1311 
1313  int pendingFeatureCount();
1314 
1318  bool setReadOnly( bool readonly = true );
1319 
1321  bool startEditing();
1322 
1324  bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom );
1325 
1332  Q_DECL_DEPRECATED bool changeAttributeValue( QgsFeatureId fid, int field, QVariant value, bool emitSignal );
1333 
1344  bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant() );
1345 
1348  bool addAttribute( const QgsField &field );
1349 
1351  void addAttributeAlias( int attIndex, QString aliasString );
1352 
1354  void remAttributeAlias( int attIndex );
1355 
1359  void addAttributeEditorWidget( QgsAttributeEditorElement* data );
1360 
1368  const QString editorWidgetV2( int fieldIdx ) const;
1369 
1379  const QString editorWidgetV2( const QString& fieldName ) const;
1380 
1388  const QgsEditorWidgetConfig editorWidgetV2Config( int fieldIdx ) const;
1389 
1399  const QgsEditorWidgetConfig editorWidgetV2Config( const QString& fieldName ) const;
1400 
1404  QList< QgsAttributeEditorElement* > &attributeEditorElements();
1408  void clearAttributeEditorWidgets();
1409 
1411  QString attributeAlias( int attributeIndex ) const;
1412 
1414  QString attributeDisplayName( int attributeIndex ) const;
1415 
1416  const QMap< QString, QString >& attributeAliases() const { return mAttributeAliasMap; }
1417 
1418  const QSet<QString>& excludeAttributesWMS() const { return mExcludeAttributesWMS; }
1419  void setExcludeAttributesWMS( const QSet<QString>& att ) { mExcludeAttributesWMS = att; }
1420 
1421  const QSet<QString>& excludeAttributesWFS() const { return mExcludeAttributesWFS; }
1422  void setExcludeAttributesWFS( const QSet<QString>& att ) { mExcludeAttributesWFS = att; }
1423 
1425  bool deleteAttribute( int attr );
1426 
1434  bool deleteAttributes( QList<int> attrs );
1435 
1437  bool addFeatures( QgsFeatureList features, bool makeSelected = true );
1438 
1440  bool deleteFeature( QgsFeatureId fid );
1441 
1457  bool commitChanges();
1458  const QStringList &commitErrors();
1459 
1463  bool rollBack( bool deleteBuffer = true );
1464 
1470  Q_DECL_DEPRECATED EditType editType( int idx );
1471 
1477  Q_DECL_DEPRECATED void setEditType( int idx, EditType edit );
1478 
1480  EditorLayout editorLayout();
1481 
1483  void setEditorLayout( EditorLayout editorLayout );
1484 
1513  void setEditorWidgetV2( int attrIdx, const QString& widgetType );
1514 
1530  void setEditorWidgetV2Config( int attrIdx, const QgsEditorWidgetConfig& config );
1531 
1537  Q_DECL_DEPRECATED void setCheckedState( int idx, QString checked, QString notChecked );
1538 
1540  QString editForm();
1541 
1543  void setEditForm( QString ui );
1544 
1547  QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const { return mFeatureFormSuppress; }
1548 
1551  void setFeatureFormSuppress( QgsVectorLayer::FeatureFormSuppress s ) { mFeatureFormSuppress = s; }
1552 
1554  QString annotationForm() const { return mAnnotationForm; }
1555 
1557  void setAnnotationForm( const QString& ui );
1558 
1560  QString editFormInit();
1561 
1563  void setEditFormInit( QString function );
1564 
1569  Q_DECL_DEPRECATED QMap<QString, QVariant> valueMap( int idx );
1570 
1576  Q_DECL_DEPRECATED RangeData range( int idx );
1577 
1579  ValueRelationData valueRelation( int idx );
1580 
1587  QList<QgsRelation> referencingRelations( int idx );
1588 
1594  Q_DECL_DEPRECATED QString dateFormat( int idx );
1595 
1601  Q_DECL_DEPRECATED QSize widgetSize( int idx );
1602 
1604  bool fieldEditable( int idx );
1605 
1607  bool labelOnTop( int idx );
1608 
1610  void setFieldEditable( int idx, bool editable );
1611 
1613  void setLabelOnTop( int idx, bool onTop );
1614 
1616  QgsVectorLayerEditBuffer* editBuffer() { return mEditBuffer; }
1617 
1622  void beginEditCommand( QString text );
1623 
1625  void endEditCommand();
1626 
1628  void destroyEditCommand();
1629 
1631  int fieldNameIndex( const QString& fieldName ) const;
1632 
1635  {
1638  NoMarker
1639  };
1640 
1642  static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
1643 
1645  void updateFields();
1646 
1648  void createJoinCaches();
1649 
1654  void uniqueValues( int index, QList<QVariant> &uniqueValues, int limit = -1 );
1655 
1657  QVariant minimumValue( int index );
1658 
1660  QVariant maximumValue( int index );
1661 
1670  QList< QVariant > getValues( const QString &fieldOrExpression, bool &ok, bool selectedOnly = false );
1671 
1682  QList< double > getDoubleValues( const QString &fieldOrExpression, bool &ok, bool selectedOnly = false, int* nullCount = 0 );
1683 
1685  void setFeatureBlendMode( const QPainter::CompositionMode &blendMode );
1687  QPainter::CompositionMode featureBlendMode() const;
1688 
1690  void setLayerTransparency( int layerTransparency );
1692  int layerTransparency() const;
1693 
1694  QString metadata() override;
1695 
1697  inline QgsGeometryCache* cache() { return mCache; }
1698 
1702  void setSimplifyMethod( const QgsVectorSimplifyMethod& simplifyMethod ) { mSimplifyMethod = simplifyMethod; }
1706  inline const QgsVectorSimplifyMethod& simplifyMethod() const { return mSimplifyMethod; }
1707 
1712  bool simplifyDrawingCanbeApplied( const QgsRenderContext& renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint ) const;
1713 
1714  public slots:
1722  void select( const QgsFeatureId &featureId );
1723 
1731  void select( const QgsFeatureIds& featureIds );
1732 
1740  void deselect( const QgsFeatureId featureId );
1741 
1749  void deselect( const QgsFeatureIds& featureIds );
1750 
1756  void removeSelection();
1757 
1761  virtual void updateExtents();
1762 
1764  void checkJoinLayerRemove( QString theLayerId );
1765 
1766  protected slots:
1767  void invalidateSymbolCountedFlag();
1768 
1769  signals:
1770 
1778  void selectionChanged( const QgsFeatureIds selected, const QgsFeatureIds deselected, const bool clearAndSelect );
1779 
1781  void selectionChanged();
1782 
1784  void layerModified();
1785 
1787  void beforeModifiedCheck() const;
1788 
1790  void editingStarted();
1791 
1793  void editingStopped();
1794 
1796  void beforeCommitChanges();
1797 
1799  void beforeRollBack();
1800 
1809  void attributeAdded( int idx );
1818  void attributeDeleted( int idx );
1824  void featureAdded( QgsFeatureId fid );
1833  void featureDeleted( QgsFeatureId fid );
1843  void featuresDeleted( QgsFeatureIds fids );
1848  void updatedFields();
1849  void layerDeleted();
1850 
1851  void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant & );
1852  void geometryChanged( QgsFeatureId fid, QgsGeometry &geom );
1853 
1855  void committedAttributesDeleted( const QString& layerId, const QgsAttributeList& deletedAttributes );
1856  void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
1857  void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );
1858  void committedFeaturesRemoved( const QString& layerId, const QgsFeatureIds& deletedFeatureIds );
1859  void committedAttributeValuesChanges( const QString& layerId, const QgsChangedAttributesMap& changedAttributesValues );
1860  void committedGeometriesChanges( const QString& layerId, const QgsGeometryMap& changedGeometries );
1861 
1862  void saveLayerToProject();
1863 
1865  void labelingFontNotFound( QgsVectorLayer* layer, const QString& fontfamily );
1866 
1868  void featureBlendModeChanged( const QPainter::CompositionMode &blendMode );
1869 
1871  void layerTransparencyChanged( int layerTransparency );
1872 
1878  void editCommandStarted( const QString& text );
1879 
1885  void editCommandEnded();
1886 
1892  void editCommandDestroyed();
1893 
1903  void readCustomSymbology( const QDomElement& element, QString& errorMessage );
1904 
1914  void writeCustomSymbology( QDomElement& element, QDomDocument& doc, QString& errorMessage ) const;
1915 
1916  private slots:
1917  void onRelationsLoaded();
1918  void onJoinedFieldsChanged();
1919  void onFeatureDeleted( const QgsFeatureId& fid );
1920 
1921  protected:
1923  void setExtent( const QgsRectangle &rect ) override;
1924 
1925  private: // Private methods
1926 
1928  QgsVectorLayer( const QgsVectorLayer & rhs );
1929 
1931  QgsVectorLayer & operator=( QgsVectorLayer const & rhs );
1932 
1933 
1938  bool setDataProvider( QString const & provider );
1939 
1941  QgsFeatureId findFreeId();
1942 
1951  void snapToGeometry( const QgsPoint& startPoint,
1952  QgsFeatureId featureId,
1953  const QgsGeometry *geom,
1954  double sqrSnappingTolerance,
1955  QMultiMap<double, QgsSnappingResult>& snappingResults,
1956  QgsSnapper::SnappingType snap_to ) const;
1957 
1959  //void addJoinedAttributes( QgsFeature& f, bool all = false );
1960 
1962  void readSldLabeling( const QDomNode& node );
1963 
1964  private: // Private attributes
1965 
1967  QgsVectorDataProvider *mDataProvider;
1968 
1970  QString mDisplayField;
1971 
1973  QString mDisplayExpression;
1974 
1976  QString mProviderKey;
1977 
1979  QgsAttributeAction* mActions;
1980 
1982  bool mReadOnly;
1983 
1988  QgsFeatureIds mSelectedFeatureIds;
1989 
1991  QgsFields mUpdatedFields;
1992 
1994  QMap< QString, QString > mAttributeAliasMap;
1995 
1997  QList< QgsAttributeEditorElement* > mAttributeEditorElements;
1998 
2000  QSet<QString> mExcludeAttributesWMS;
2002  QSet<QString> mExcludeAttributesWFS;
2003 
2005  QList< TabData > mTabs;
2006 
2008  QGis::WkbType mWkbType;
2009 
2011  QgsFeatureRendererV2 *mRendererV2;
2012 
2014  QgsVectorSimplifyMethod mSimplifyMethod;
2015 
2017  QgsLabel *mLabel;
2018 
2020  bool mLabelOn;
2021 
2023  bool mLabelFontNotFoundNotified;
2024 
2026  QPainter::CompositionMode mFeatureBlendMode;
2027 
2029  int mLayerTransparency;
2030 
2032  bool mVertexMarkerOnlyForSelection;
2033 
2034  QStringList mCommitErrors;
2035 
2036  QMap< QString, bool> mFieldEditables;
2037  QMap< QString, bool> mLabelOnTop;
2038 
2039  QMap<QString, QString> mEditorWidgetV2Types;
2040  QMap<QString, QgsEditorWidgetConfig > mEditorWidgetV2Configs;
2041 
2043  EditorLayout mEditorLayout;
2044 
2045  QString mEditForm, mEditFormInit;
2046 
2049  QgsVectorLayer::FeatureFormSuppress mFeatureFormSuppress;
2050 
2051  //annotation form for this layer
2052  QString mAnnotationForm;
2053 
2055  QgsGeometryCache* mCache;
2056 
2058  QgsVectorLayerEditBuffer* mEditBuffer;
2060 
2061  //stores information about joined layers
2062  QgsVectorLayerJoinBuffer* mJoinBuffer;
2063 
2065  QgsExpressionFieldBuffer* mExpressionFieldBuffer;
2066 
2067  //diagram rendering object. 0 if diagram drawing is disabled
2068  QgsDiagramRendererV2* mDiagramRenderer;
2069 
2070  //stores infos about diagram placement (placement type, priority, position distance)
2071  QgsDiagramLayerSettings *mDiagramLayerSettings;
2072 
2073  bool mValidExtent;
2074  bool mLazyExtent;
2075 
2076  // Features in renderer classes counted
2077  bool mSymbolFeatureCounted;
2078 
2079  // Feature counts for each renderer symbol
2080  QMap<QgsSymbolV2*, long> mSymbolFeatureCountMap;
2081 
2083  bool mEditCommandActive;
2084 
2085  QgsFeatureIds mDeletedFids;
2086 
2088 };
2089 
2090 #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.
static unsigned index
A rectangle specified with double values.
Definition: qgsrectangle.h:35
Base class for all map layer types.
Definition: qgsmaplayer.h:49
virtual ~QgsAttributeEditorContainer()
Destructor.
QString joinFieldName
Join field in the source layer.
const QSet< QString > & excludeAttributesWMS() const
void setExcludeAttributesWFS(const QSet< QString > &att)
This is an abstract base class for any elements of a drag and drop form.
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
Returns if this ccontainer is going to be rendered as a group box.
RangeData(QVariant theMin, QVariant theMax, QVariant theStep)
QgsAttributeAction * actions()
EditorLayout
The different types to layout the attribute editor.
The attribute value should not be changed in the attribute form.
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeature.h:408
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
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.
Container of fields for a vector layer.
Definition: qgsfield.h:173
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:75
This element will load a field's widget onto the form.
WkbType
Used for symbology operations.
Definition: qgis.h:53
virtual ~QgsAttributeEditorElement()
Destructor.
This element will load a relation editor onto the form.
virtual QgsMapLayerRenderer * createMapRenderer(QgsRenderContext &rendererContext)
Return new instance of QgsMapLayerRenderer that will be used for rendering of given context...
Definition: qgsmaplayer.h:134
const QgsRelation & relation() const
Get the id of the relation which shall be embedded.
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:162
const QgsDiagramLayerSettings * diagramLayerSettings() const
QgsAttributeEditorField(QString name, int idx, QObject *parent)
Creates a new attribute editor element which represents a field.
int idx() const
Return the index of the field.
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)
Creates a new element which embeds a relation.
Returns diagram settings for a feature.
QString name() const
Return the name of this element.
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
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
Point geometry type.
Definition: qgspointv2.h:29
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)...
AttributeEditorType type() const
The type of this element.
QSharedPointer< QStringList > joinFieldsSubset
Subset of fields to use from joined layer.
virtual ~QgsAttributeEditorField()
Destructor.
Encapsulate a field in an attribute table or data source.
Definition: qgsfield.h:38
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
void setName(const char *name)
virtual ~QgsAttributeEditorRelation()
Destructor.
QList< QgsAttributeEditorElement * > children() const
Get a list of the children elements of this container.
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
uuid generator - readonly and automatically intialized
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
Is reimplemented in classes inheriting from this to serialize it.
QHash< QString, QgsAttributes > cachedAttributes
Cache for joined attributes to provide fast lookup (size is 0 if no memory caching) ...
GroupData(QString name, QList< QString > fields)
virtual void setIsGroupBox(bool isGroupBox)
Determines if this container is rendered as collapsible group box or tab in a tabwidget.
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)
Creates a new element which embeds a relation.
This is a container for attribute editors, used to group them visually in the attribute form if it is...
Class for doing transforms between two map coordinate systems.
void setSimplifyMethod(const QgsVectorSimplifyMethod &simplifyMethod)
Set the simplification settings for fast rendering of features.
qint64 QgsFeatureId
Definition: qgsfeature.h:31
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)
Constructor.
QSet< int > QgsAttributeIds
QgsAttributeEditorContainer(QString name, QObject *parent)
Creates a new attribute editor container.
FeatureFormSuppress
Types of feature form suppression after feature creation.
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.
modularized edit widgets
QString joinLayerId
Source layer.
value map from an table
AttributeEditorType mType
Abstract base class for simplify geometries using a specific algorithm.
QList< GroupData > mGroups