QGIS API Documentation  2.5.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 "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;
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;
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;
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 
185  bool operator==( const QgsVectorJoinInfo& other ) const
186  {
187  return targetFieldName == other.targetFieldName &&
188  joinLayerId == other.joinLayerId &&
189  joinFieldName == other.joinFieldName &&
190  joinFieldsSubset == other.joinFieldsSubset &&
191  memoryCache == other.memoryCache;
192  }
193 
196  void setJoinFieldNamesSubset( QStringList* fieldNamesSubset ) { joinFieldsSubset = QSharedPointer<QStringList>( fieldNamesSubset ); }
199  QStringList* joinFieldNamesSubset() const { return joinFieldsSubset.data(); }
200 
201 protected:
203  QSharedPointer<QStringList> joinFieldsSubset;
204 };
205 
468 class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
469 {
470  Q_OBJECT
471 
472  public:
475  {
476  GeneratedLayout = 0,
477  TabLayout = 1,
478  UiFileLayout = 2
479  };
480 
484  enum EditType
485  {
507  };
508 
512  {
513  SuppressDefault = 0, // use the application-wide setting
514  SuppressOn = 1,
515  SuppressOff = 2
516  };
517 
518  struct RangeData
519  {
520  RangeData() { mMin = QVariant( 0 ); mMax = QVariant( 5 ); mStep = QVariant( 1 );}
521  RangeData( QVariant theMin, QVariant theMax, QVariant theStep )
522  : mMin( theMin ), mMax( theMax ), mStep( theStep ) {}
523 
524  QVariant mMin;
525  QVariant mMax;
526  QVariant mStep;
527  };
528 
530  {
532  ValueRelationData( QString layer, QString key, QString value, bool allowNull, bool orderByValue,
533  bool allowMulti = false,
534  QString filterExpression = QString::null )
535  : mLayer( layer )
536  , mKey( key )
537  , mValue( value )
538  , mFilterExpression( filterExpression )
539  , mAllowNull( allowNull )
540  , mOrderByValue( orderByValue )
541  , mAllowMulti( allowMulti )
542  {}
543 
544  QString mLayer;
545  QString mKey;
546  QString mValue;
550  bool mAllowMulti; /* allow selection of multiple keys */
551  };
552 
553  struct GroupData
554  {
556  GroupData( QString name, QList<QString> fields )
557  : mName( name ), mFields( fields ) {}
558  QString mName;
559  QList<QString> mFields;
560  };
561 
562  struct TabData
563  {
564  TabData() {}
565  TabData( QString name, QList<QString> fields, QList<GroupData> groups )
566  : mName( name ), mFields( fields ), mGroups( groups ) {}
567  QString mName;
568  QList<QString> mFields;
569  QList<GroupData> mGroups;
570  };
571 
585  QgsVectorLayer( QString path = QString::null, QString baseName = QString::null,
586  QString providerLib = QString::null, bool loadDefaultStyleFlag = true );
587 
589  virtual ~QgsVectorLayer();
590 
592  QString storageType() const;
593 
595  QString capabilitiesString() const;
596 
598  QString dataComment() const;
599 
601  void setDisplayField( QString fldName = "" );
602 
604  const QString displayField() const;
605 
612  void setDisplayExpression( const QString &displayExpression );
613 
620  const QString displayExpression();
621 
623  QgsVectorDataProvider* dataProvider();
624 
628  const QgsVectorDataProvider* dataProvider() const;
629 
631  void setProviderEncoding( const QString& encoding );
632 
634  void setCoordinateSystem();
635 
639  bool addJoin( const QgsVectorJoinInfo& joinInfo );
640 
642  void removeJoin( const QString& joinLayerId );
643 
644  const QList< QgsVectorJoinInfo >& vectorJoins() const;
645 
654  void addExpressionField( const QString& exp, const QgsField& fld );
655 
663  void removeExpressionField( int index );
664 
666  QgsLabel *label();
667 
668  const QgsLabel *label() const;
669 
670  QgsAttributeAction *actions() { return mActions; }
671 
677  int selectedFeatureCount();
678 
687  void select( QgsRectangle & rect, bool addToSelection );
688 
700  void modifySelection( QgsFeatureIds selectIds, QgsFeatureIds deselectIds );
701 
703  void invertSelection();
704 
706  void selectAll();
707 
709  QgsFeatureIds allFeatureIds();
710 
718  void invertSelectionInRectangle( QgsRectangle & rect );
719 
728  QgsFeatureList selectedFeatures();
729 
741  QgsFeatureIterator selectedFeaturesIterator( QgsFeatureRequest request = QgsFeatureRequest() );
742 
749  const QgsFeatureIds &selectedFeaturesIds() const;
750 
758  void setSelectedFeatures( const QgsFeatureIds &ids );
759 
761  QgsRectangle boundingBoxOfSelected();
762 
764  void setDiagramRenderer( QgsDiagramRendererV2* r );
765  const QgsDiagramRendererV2* diagramRenderer() const { return mDiagramRenderer; }
766 
767  void setDiagramLayerSettings( const QgsDiagramLayerSettings& s );
768  const QgsDiagramLayerSettings *diagramLayerSettings() const { return mDiagramLayerSettings; }
769 
771  QgsFeatureRendererV2* rendererV2();
774  void setRendererV2( QgsFeatureRendererV2* r );
775 
777  QGis::GeometryType geometryType() const;
778 
780  bool hasGeometryType() const;
781 
783  QGis::WkbType wkbType() const;
784 
786  QString providerType() const;
787 
791  virtual bool readXml( const QDomNode& layer_node );
792 
796  virtual bool writeXml( QDomNode & layer_node, QDomDocument & doc );
797 
806  virtual void saveStyleToDatabase( QString name, QString description,
807  bool useAsDefault, QString uiFileContent,
808  QString &msgError );
809 
818  virtual int listStylesInDatabase( QStringList &ids, QStringList &names,
819  QStringList &descriptions, QString &msgError );
820 
824  virtual QString getStyleFromDatabase( QString styleId, QString &msgError );
825 
832  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag, bool loadFromLocalDb );
833 
838  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag );
839 
840  virtual bool applyNamedStyle( QString namedStyle, QString errorMsg );
841 
846  QgsAttributeEditorElement* attributeEditorElementFromDomElement( QDomElement &elem, QObject* parent );
847 
853  bool readSymbology( const QDomNode& node, QString& errorMessage );
854 
861  bool writeSymbology( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
862 
863  bool writeSld( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
864  bool readSld( const QDomNode& node, QString& errorMessage );
865 
873  virtual long featureCount() const;
874 
881  long featureCount( QgsSymbolV2* symbol );
882 
888  bool countSymbolFeatures( bool showProgress = true );
889 
897  virtual bool setSubsetString( QString subset );
898 
903  virtual QString subsetString();
904 
908  QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() );
909 
915  bool addFeature( QgsFeature& f, bool alsoUpdateExtent = true );
916 
923  bool updateFeature( QgsFeature &f );
924 
929  bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
930 
935  bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
936 
939  bool deleteVertex( QgsFeatureId atFeatureId, int atVertex );
940 
944  bool deleteSelectedFeatures();
945 
955  int addRing( const QList<QgsPoint>& ring );
956 
967  int addPart( const QList<QgsPoint>& ring );
968 
974  int translateFeature( QgsFeatureId featureId, double dx, double dy );
975 
983  int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
984 
992  int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
993 
1002  Q_DECL_DEPRECATED int removePolygonIntersections( QgsGeometry* geom, QgsFeatureIds ignoreFeatures = QgsFeatureIds() );
1003 
1009  int addTopologicalPoints( QgsGeometry* geom );
1010 
1018  int addTopologicalPoints( const QgsPoint& p );
1019 
1025  int insertSegmentVerticesForSnap( const QList<QgsSnappingResult>& snapResults );
1026 
1028  void enableLabels( bool on );
1029 
1031  bool hasLabelsEnabled() const;
1032 
1034  virtual bool isEditable() const;
1035 
1038  virtual bool isReadOnly() const;
1039 
1041  virtual bool isModified() const;
1042 
1049  bool snapPoint( QgsPoint& point, double tolerance );
1050 
1058  int snapWithContext( const QgsPoint& startPoint,
1059  double snappingTolerance,
1060  QMultiMap < double, QgsSnappingResult > &snappingResults,
1061  QgsSnapper::SnappingType snap_to );
1062 
1064  virtual void reload();
1065 
1069  virtual QgsMapLayerRenderer* createMapRenderer( QgsRenderContext& rendererContext );
1070 
1074  bool draw( QgsRenderContext& rendererContext );
1075 
1077  void drawLabels( QgsRenderContext& rendererContext );
1078 
1080  QgsRectangle extent();
1081 
1083  const QgsFields &pendingFields() const;
1084 
1086  QgsAttributeList pendingAllAttributesList();
1087 
1089  QgsAttributeList pendingPkAttributesList();
1090 
1092  int pendingFeatureCount();
1093 
1097  bool setReadOnly( bool readonly = true );
1098 
1100  bool startEditing();
1101 
1103  bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom );
1104 
1111  Q_DECL_DEPRECATED bool changeAttributeValue( QgsFeatureId fid, int field, QVariant value, bool emitSignal );
1112 
1123  bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant() );
1124 
1128  bool addAttribute( const QgsField &field );
1129 
1131  void addAttributeAlias( int attIndex, QString aliasString );
1132 
1134  void remAttributeAlias( int attIndex );
1135 
1139  void addAttributeEditorWidget( QgsAttributeEditorElement* data );
1140 
1148  const QString editorWidgetV2( int fieldIdx ) const;
1149 
1159  const QString editorWidgetV2( const QString& fieldName ) const;
1160 
1168  const QgsEditorWidgetConfig editorWidgetV2Config( int fieldIdx ) const;
1169 
1179  const QgsEditorWidgetConfig editorWidgetV2Config( const QString& fieldName ) const;
1180 
1184  QList< QgsAttributeEditorElement* > &attributeEditorElements();
1188  void clearAttributeEditorWidgets();
1189 
1191  QString attributeAlias( int attributeIndex ) const;
1192 
1194  QString attributeDisplayName( int attributeIndex ) const;
1195 
1196  const QMap< QString, QString >& attributeAliases() const { return mAttributeAliasMap; }
1197 
1198  const QSet<QString>& excludeAttributesWMS() const { return mExcludeAttributesWMS; }
1199  void setExcludeAttributesWMS( const QSet<QString>& att ) { mExcludeAttributesWMS = att; }
1200 
1201  const QSet<QString>& excludeAttributesWFS() const { return mExcludeAttributesWFS; }
1202  void setExcludeAttributesWFS( const QSet<QString>& att ) { mExcludeAttributesWFS = att; }
1203 
1205  bool deleteAttribute( int attr );
1206 
1214  bool deleteAttributes( QList<int> attrs );
1215 
1217  bool addFeatures( QgsFeatureList features, bool makeSelected = true );
1218 
1220  bool deleteFeature( QgsFeatureId fid );
1221 
1237  bool commitChanges();
1238  const QStringList &commitErrors();
1239 
1243  bool rollBack( bool deleteBuffer = true );
1244 
1250  Q_DECL_DEPRECATED EditType editType( int idx );
1251 
1257  Q_DECL_DEPRECATED void setEditType( int idx, EditType edit );
1258 
1260  EditorLayout editorLayout();
1261 
1263  void setEditorLayout( EditorLayout editorLayout );
1264 
1293  void setEditorWidgetV2( int attrIdx, const QString& widgetType );
1294 
1310  void setEditorWidgetV2Config( int attrIdx, const QgsEditorWidgetConfig& config );
1311 
1317  Q_DECL_DEPRECATED void setCheckedState( int idx, QString checked, QString notChecked );
1318 
1320  QString editForm();
1321 
1323  void setEditForm( QString ui );
1324 
1327  QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const { return mFeatureFormSuppress; }
1328 
1331  void setFeatureFormSuppress( QgsVectorLayer::FeatureFormSuppress s ) { mFeatureFormSuppress = s; }
1332 
1334  QString annotationForm() const { return mAnnotationForm; }
1335 
1337  void setAnnotationForm( const QString& ui );
1338 
1340  QString editFormInit();
1341 
1343  void setEditFormInit( QString function );
1344 
1349  Q_DECL_DEPRECATED QMap<QString, QVariant> valueMap( int idx );
1350 
1356  Q_DECL_DEPRECATED RangeData range( int idx );
1357 
1359  ValueRelationData valueRelation( int idx );
1360 
1367  QList<QgsRelation> referencingRelations( int idx );
1368 
1374  Q_DECL_DEPRECATED QString dateFormat( int idx );
1375 
1381  Q_DECL_DEPRECATED QSize widgetSize( int idx );
1382 
1384  bool fieldEditable( int idx );
1385 
1387  bool labelOnTop( int idx );
1388 
1390  void setFieldEditable( int idx, bool editable );
1391 
1393  void setLabelOnTop( int idx, bool onTop );
1394 
1396  QgsVectorLayerEditBuffer* editBuffer() { return mEditBuffer; }
1397 
1402  void beginEditCommand( QString text );
1403 
1405  void endEditCommand();
1406 
1408  void destroyEditCommand();
1409 
1412  int fieldNameIndex( const QString& fieldName ) const;
1413 
1417  {
1420  NoMarker
1421  };
1422 
1425  static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
1426 
1428  void updateFields();
1429 
1431  void createJoinCaches();
1432 
1437  void uniqueValues( int index, QList<QVariant> &uniqueValues, int limit = -1 );
1438 
1440  QVariant minimumValue( int index );
1441 
1443  QVariant maximumValue( int index );
1444 
1445  /* Set the blending mode used for rendering each feature */
1446  void setFeatureBlendMode( const QPainter::CompositionMode &blendMode );
1447  /* Returns the current blending mode for features */
1448  QPainter::CompositionMode featureBlendMode() const;
1449 
1450  /* Set the transparency for the vector layer */
1451  void setLayerTransparency( int layerTransparency );
1452  /* Returns the current transparency for the vector layer */
1453  int layerTransparency() const;
1454 
1455  QString metadata();
1456 
1458  inline QgsGeometryCache* cache() { return mCache; }
1459 
1463  void setSimplifyMethod( const QgsVectorSimplifyMethod& simplifyMethod ) { mSimplifyMethod = simplifyMethod; }
1467  inline const QgsVectorSimplifyMethod& simplifyMethod() const { return mSimplifyMethod; }
1468 
1473  bool simplifyDrawingCanbeApplied( const QgsRenderContext& renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint ) const;
1474 
1475  public slots:
1483  void select( const QgsFeatureId &featureId );
1484 
1492  void select( const QgsFeatureIds& featureIds );
1493 
1501  void deselect( const QgsFeatureId featureId );
1502 
1510  void deselect( const QgsFeatureIds& featureIds );
1511 
1517  void removeSelection();
1518 
1522  virtual void updateExtents();
1523 
1525  void checkJoinLayerRemove( QString theLayerId );
1526 
1527  protected slots:
1528  void invalidateSymbolCountedFlag();
1529 
1530  signals:
1531 
1539  void selectionChanged( const QgsFeatureIds selected, const QgsFeatureIds deselected, const bool clearAndSelect );
1540 
1542  void selectionChanged();
1543 
1545  void layerModified();
1546 
1548  void beforeModifiedCheck() const;
1549 
1551  void editingStarted();
1552 
1554  void editingStopped();
1555 
1557  void beforeCommitChanges();
1558 
1560  void beforeRollBack();
1561 
1570  void attributeAdded( int idx );
1579  void attributeDeleted( int idx );
1580  void featureAdded( QgsFeatureId fid );
1581  void featureDeleted( QgsFeatureId fid );
1586  void updatedFields();
1587  void layerDeleted();
1588 
1589  void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant & );
1590  void geometryChanged( QgsFeatureId fid, QgsGeometry &geom );
1591 
1593  void committedAttributesDeleted( const QString& layerId, const QgsAttributeList& deletedAttributes );
1594  void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
1595  void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );
1596  void committedFeaturesRemoved( const QString& layerId, const QgsFeatureIds& deletedFeatureIds );
1597  void committedAttributeValuesChanges( const QString& layerId, const QgsChangedAttributesMap& changedAttributesValues );
1598  void committedGeometriesChanges( const QString& layerId, const QgsGeometryMap& changedGeometries );
1599 
1600  void saveLayerToProject();
1601 
1603  void labelingFontNotFound( QgsVectorLayer* layer, const QString& fontfamily );
1604 
1606  void featureBlendModeChanged( const QPainter::CompositionMode &blendMode );
1607 
1609  void layerTransparencyChanged( int layerTransparency );
1610 
1616  void editCommandStarted( const QString& text );
1617 
1623  void editCommandEnded();
1624 
1630  void editCommandDestroyed();
1631 
1641  void readCustomSymbology( const QDomElement& element, QString& errorMessage );
1642 
1652  void writeCustomSymbology( QDomElement& element, QDomDocument& doc, QString& errorMessage ) const;
1653 
1654  private slots:
1655  void onRelationsLoaded();
1656  void onJoinedFieldsChanged();
1657 
1658  protected:
1660  void setExtent( const QgsRectangle &rect );
1661 
1662  private: // Private methods
1663 
1665  QgsVectorLayer( const QgsVectorLayer & rhs );
1666 
1668  QgsVectorLayer & operator=( QgsVectorLayer const & rhs );
1669 
1674  bool setDataProvider( QString const & provider );
1675 
1677  QgsFeatureId findFreeId();
1678 
1687  void snapToGeometry( const QgsPoint& startPoint,
1688  QgsFeatureId featureId,
1689  QgsGeometry* geom,
1690  double sqrSnappingTolerance,
1691  QMultiMap<double, QgsSnappingResult>& snappingResults,
1692  QgsSnapper::SnappingType snap_to ) const;
1693 
1695  //void addJoinedAttributes( QgsFeature& f, bool all = false );
1696 
1698  void readSldLabeling( const QDomNode& node );
1699 
1700  private: // Private attributes
1701 
1703  QgsVectorDataProvider *mDataProvider;
1704 
1706  QString mDisplayField;
1707 
1709  QString mDisplayExpression;
1710 
1712  QString mProviderKey;
1713 
1715  QgsAttributeAction* mActions;
1716 
1718  bool mReadOnly;
1719 
1724  QgsFeatureIds mSelectedFeatureIds;
1725 
1727  QgsFields mUpdatedFields;
1728 
1730  QMap< QString, QString > mAttributeAliasMap;
1731 
1733  QList< QgsAttributeEditorElement* > mAttributeEditorElements;
1734 
1736  QSet<QString> mExcludeAttributesWMS;
1738  QSet<QString> mExcludeAttributesWFS;
1739 
1741  QList< TabData > mTabs;
1742 
1744  int mWkbType;
1745 
1747  QgsFeatureRendererV2 *mRendererV2;
1748 
1750  QgsVectorSimplifyMethod mSimplifyMethod;
1751 
1753  QgsLabel *mLabel;
1754 
1756  bool mLabelOn;
1757 
1759  bool mLabelFontNotFoundNotified;
1760 
1762  QPainter::CompositionMode mFeatureBlendMode;
1763 
1765  int mLayerTransparency;
1766 
1768  QgsVectorLayer::VertexMarkerType mCurrentVertexMarkerType;
1769 
1771  int mCurrentVertexMarkerSize;
1772 
1774  bool mVertexMarkerOnlyForSelection;
1775 
1776  QStringList mCommitErrors;
1777 
1778  QMap< QString, bool> mFieldEditables;
1779  QMap< QString, bool> mLabelOnTop;
1780 
1781  QMap<QString, QString> mEditorWidgetV2Types;
1782  QMap<QString, QgsEditorWidgetConfig > mEditorWidgetV2Configs;
1783 
1785  EditorLayout mEditorLayout;
1786 
1787  QString mEditForm, mEditFormInit;
1788 
1791  QgsVectorLayer::FeatureFormSuppress mFeatureFormSuppress;
1792 
1793  //annotation form for this layer
1794  QString mAnnotationForm;
1795 
1797  QgsGeometryCache* mCache;
1798 
1800  QgsVectorLayerEditBuffer* mEditBuffer;
1802 
1803  //stores information about joined layers
1804  QgsVectorLayerJoinBuffer* mJoinBuffer;
1805 
1807  QgsExpressionFieldBuffer* mExpressionFieldBuffer;
1808 
1809  //diagram rendering object. 0 if diagram drawing is disabled
1810  QgsDiagramRendererV2* mDiagramRenderer;
1811 
1812  //stores infos about diagram placement (placement type, priority, position distance)
1813  QgsDiagramLayerSettings *mDiagramLayerSettings;
1814 
1815  bool mValidExtent;
1816  bool mLazyExtent;
1817 
1818  // Features in renderer classes counted
1819  bool mSymbolFeatureCounted;
1820 
1821  // Feature counts for each renderer symbol
1822  QMap<QgsSymbolV2*, long> mSymbolFeatureCountMap;
1823 
1825 };
1826 
1827 #endif
QString mName
Definition: qgsvectorlayer.h:92
Definition: qgsvectorlayer.h:529
virtual bool isEditable() const
True if the layer can be edited.
Definition: qgsmaplayer.cpp:1391
Wrapper for iterator of features from vector data provider or vector layer.
Definition: qgsfeatureiterator.h:139
QString annotationForm() const
get annotation form
Definition: qgsvectorlayer.h:1334
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
Definition: qgsfeature.h:315
static unsigned index
Definition: mersenne-twister.cpp:36
Definition: qgsvectorlayer.h:494
A rectangle specified with double values.
Definition: qgsrectangle.h:35
Base class for all map layer types.
Definition: qgsmaplayer.h:48
QString mName
Definition: qgsvectorlayer.h:567
Definition: qgsvectorlayer.h:74
QString joinFieldName
Join field in the source layer.
Definition: qgsvectorlayer.h:172
const QSet< QString > & excludeAttributesWMS() const
Definition: qgsvectorlayer.h:1198
void setExcludeAttributesWFS(const QSet< QString > &att)
Definition: qgsvectorlayer.h:1202
Definition: qgsvectorlayer.h:67
virtual QString metadata()
Obtain Metadata for this layer.
Definition: qgsmaplayer.cpp:1435
QString targetFieldName
Join field in the target layer.
Definition: qgsvectorlayer.h:168
virtual void drawLabels(QgsRenderContext &rendererContext)
Draw labels.
Definition: qgsmaplayer.cpp:156
Definition: qgsvectorlayer.h:562
phote widget
Definition: qgsvectorlayer.h:503
virtual bool isGroupBox() const
Definition: qgsvectorlayer.h:108
RangeData(QVariant theMin, QVariant theMax, QVariant theStep)
Definition: qgsvectorlayer.h:521
QgsAttributeAction * actions()
Definition: qgsvectorlayer.h:670
ValueRelationData()
Definition: qgsvectorlayer.h:531
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeature.h:317
QList< QgsFeature > QgsFeatureList
Definition: qgsfeature.h:322
EditorLayout
The different types to layout the attribute editor.
Definition: qgsvectorlayer.h:474
Manages an editor widget Widget and wrapper share the same parent.
Definition: qgseditorwidgetwrapper.h:41
Definition: qgsvectorlayer.h:1418
void setExcludeAttributesWMS(const QSet< QString > &att)
Definition: qgsvectorlayer.h:1199
int joinFieldIndex
Join field index in the source layer.
Definition: qgsvectorlayer.h:183
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.
Definition: qgsattributeaction.h:106
const QgsVectorSimplifyMethod & simplifyMethod() const
Returns the simplification settings for fast rendering of features.
Definition: qgsvectorlayer.h:1467
bool mOrderByValue
Definition: qgsvectorlayer.h:549
virtual void reload()
Synchronises with changes in the datasource.
Definition: qgsmaplayer.h:128
webview widget
Definition: qgsvectorlayer.h:504
QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const
Type of feature form pop-up suppression after feature creation (overrides app setting) ...
Definition: qgsvectorlayer.h:1327
TabData()
Definition: qgsvectorlayer.h:564
FeatureFormSuppress
Types of feature form suppression after feature creation.
Definition: qgsvectorlayer.h:511
QVariant mStep
Definition: qgsvectorlayer.h:526
SimplifyHint
Simplification flags for fast rendering of features.
Definition: qgsvectorsimplifymethod.h:35
multiline edit
Definition: qgsvectorlayer.h:498
Definition: qgsvectorlayer.h:75
QVariant mMax
Definition: qgsvectorlayer.h:525
Container of fields for a vector layer.
Definition: qgsfield.h:172
Definition: qgsgeometry.h:69
Definition: qgsvectorlayer.h:118
GeometryType
Definition: qgis.h:155
virtual ~QgsAttributeEditorElement()
Definition: qgsvectorlayer.h:83
bool mAllowMulti
Definition: qgsvectorlayer.h:550
Definition: qgsvectorlayer.h:134
virtual QgsMapLayerRenderer * createMapRenderer(QgsRenderContext &rendererContext)
Return new instance of QgsMapLayerRenderer that will be used for rendering of given context...
Definition: qgsmaplayer.h:133
WkbType
Used for symbology operations.
Definition: qgis.h:53
const QgsRelation & relation() const
Definition: qgsvectorlayer.h:149
Definition: qgssinglesymbolrendererv2.h:24
bool memoryCache
True if the join is cached in virtual memory.
Definition: qgsvectorlayer.h:174
int targetFieldIndex
Join field index in the target layer.
Definition: qgsvectorlayer.h:181
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:113
Definition: qgsvectorlayer.h:518
const QgsDiagramLayerSettings * diagramLayerSettings() const
Definition: qgsvectorlayer.h:768
Definition: qgsvectorlayer.h:491
QString mValue
Definition: qgsvectorlayer.h:546
EditType
Definition: qgsvectorlayer.h:484
QgsAttributeEditorField(QString name, int idx, QObject *parent)
Definition: qgsvectorlayer.h:121
int idx() const
Definition: qgsvectorlayer.h:127
TabData(QString name, QList< QString > fields, QList< GroupData > groups)
Definition: qgsvectorlayer.h:565
color
Definition: qgsvectorlayer.h:505
virtual bool writeSymbology(QDomNode &node, QDomDocument &doc, QString &errorMessage) const =0
Write the symbology for the layer into the docment provided.
QgsGeometryCache * cache()
Definition: qgsvectorlayer.h:1458
QgsAttributeEditorRelation(QString name, const QString &relationId, QObject *parent)
Definition: qgsvectorlayer.h:137
Returns diagram settings for a feature.
Definition: qgsdiagramrendererv2.h:155
QString name() const
Definition: qgsvectorlayer.h:85
Manages joined fields for a vector layer.
Definition: qgsvectorlayerjoinbuffer.h:32
Definition: qgsvectorlayer.h:553
virtual bool draw(QgsRenderContext &rendererContext)
This is the method that does the actual work of drawing the layer onto a paint device.
Definition: qgsmaplayer.cpp:150
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:33
SnappingType
Snap to vertex, to segment or both.
Definition: qgssnapper.h:66
QgsVectorLayerEditBuffer * editBuffer()
Buffer with uncommitted editing operations. Only valid after editing has been turned on...
Definition: qgsvectorlayer.h:1396
Definition: qgsvectorlayer.h:492
void setJoinFieldNamesSubset(QStringList *fieldNamesSubset)
Set subset of fields to be used from joined layer.
Definition: qgsvectorlayer.h:196
bool operator==(const QgsVectorJoinInfo &other) const
Definition: qgsvectorlayer.h:185
value map from an table
Definition: qgsvectorlayer.h:501
QVariant mMin
Definition: qgsvectorlayer.h:524
virtual bool writeXml(QDomNode &layer_node, QDomDocument &document)
called by writeLayerXML(), used by children to write state specific to them to project files...
Definition: qgsmaplayer.cpp:685
bool mAllowNull
Definition: qgsvectorlayer.h:548
const QSet< QString > & excludeAttributesWFS() const
Definition: qgsvectorlayer.h:1201
VertexMarkerType
Editing vertex markers.
Definition: qgsvectorlayer.h:1416
GroupData()
Definition: qgsvectorlayer.h:555
virtual void setExtent(const QgsRectangle &rect)
Set the extent.
Definition: qgsmaplayer.cpp:1440
The attribute value should not be changed in the attribute form.
Definition: qgsvectorlayer.h:496
~QgsAttributeEditorRelation()
Definition: qgsvectorlayer.h:146
This class wraps a request for features to a vector layer (or directly its vector data provider)...
Definition: qgsfeaturerequest.h:58
Definition: qgsvectorlayer.h:493
QList< int > QgsAttributeList
Definition: qgsfeaturerequest.h:26
AttributeEditorType type() const
Definition: qgsvectorlayer.h:86
QSharedPointer< QStringList > joinFieldsSubset
Subset of fields to use from joined layer.
Definition: qgsvectorlayer.h:203
QString mLayer
Definition: qgsvectorlayer.h:544
~QgsAttributeEditorField()
Definition: qgsvectorlayer.h:124
Encapsulate a field in an attribute table or data source.
Definition: qgsfield.h:33
const QMap< QString, QString > & attributeAliases() const
Definition: qgsvectorlayer.h:1196
Definition: qgssymbolv2.h:43
const QgsDiagramRendererV2 * diagramRenderer() const
Definition: qgsvectorlayer.h:765
A class to represent a point geometry.
Definition: qgspoint.h:63
virtual bool readSld(const QDomNode &node, QString &errorMessage)
Definition: qgsmaplayer.h:343
QList< QgsAttributeEditorElement * > children() const
Definition: qgsvectorlayer.h:109
QString mName
Definition: qgsvectorlayer.h:558
Partial snapshot of vector layer's state (only the members necessary for access to features) ...
Definition: qgsvectorlayerfeatureiterator.h:33
QList< QString > mFields
Definition: qgsvectorlayer.h:559
A class to render labels.
Definition: qgslabel.h:51
dial range
Definition: qgsvectorlayer.h:500
Definition: qgsdiagramrendererv2.h:39
Definition: qgsvectorlayer.h:495
Definition: qgsvectorlayer.h:490
QString mKey
Definition: qgsvectorlayer.h:545
~QgsAttributeEditorContainer()
Definition: qgsvectorlayer.h:103
Definition: qgsgeometrycache.h:10
modularized edit widgets
Definition: qgsvectorlayer.h:506
Definition: qgsrelation.h:28
This class contains information how to simplify geometries fetched from a vector layer.
Definition: qgsvectorsimplifymethod.h:24
Contains information about the context of a rendering operation.
Definition: qgsrendercontext.h:39
ValueRelationData(QString layer, QString key, QString value, bool allowNull, bool orderByValue, bool allowMulti=false, QString filterExpression=QString::null)
Definition: qgsvectorlayer.h:532
Buffers information about expression fields for a vector layer.
Definition: qgsexpressionfieldbuffer.h:32
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) ...
Definition: qgsvectorlayer.h:178
Definition: qgsvectorlayereditbuffer.h:33
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
Definition: qgsfeature.h:312
Definition: qgsvectorlayer.h:76
Definition: qgsvectorlayer.h:486
The attribute value should not be shown in the attribute form.
Definition: qgsvectorlayer.h:497
GroupData(QString name, QList< QString > fields)
Definition: qgsvectorlayer.h:556
Definition: qgsvectorlayer.h:165
virtual void setIsGroupBox(bool isGroupBox)
Definition: qgsvectorlayer.h:107
This class manages a set of relations between layers.
Definition: qgsrelationmanager.h:32
virtual bool readXml(const QDomNode &layer_node)
called by readLayerXML(), used by children to read state specific to them from project files...
Definition: qgsmaplayer.cpp:431
QString mFilterExpression
Definition: qgsvectorlayer.h:547
uuid generator - readonly and automatically intialized
Definition: qgsvectorlayer.h:502
QgsAttributeEditorRelation(QString name, const QgsRelation &relation, QObject *parent)
Definition: qgsvectorlayer.h:141
Definition: qgsvectorlayer.h:95
Class for doing transforms between two map coordinate systems.
Definition: qgscoordinatetransform.h:52
void setSimplifyMethod(const QgsVectorSimplifyMethod &simplifyMethod)
Set the simplification settings for fast rendering of features.
Definition: qgsvectorlayer.h:1463
Definition: qgsvectorlayer.h:488
QMap< QString, QVariant > QgsEditorWidgetConfig
Holds a set of configuration parameters for a editor widget wrapper.
Definition: qgseditorwidgetconfig.h:19
Definition: qgsvectorlayer.h:1419
qint64 QgsFeatureId
Definition: qgsfeature.h:30
Base class for utility classes that encapsulate information necessary for rendering of map layers...
Definition: qgsmaplayerrenderer.h:43
void setFeatureFormSuppress(QgsVectorLayer::FeatureFormSuppress s)
Set type of feature form pop-up suppression after feature creation (overrides app setting) ...
Definition: qgsvectorlayer.h:1331
QStringList * joinFieldNamesSubset() const
Get subset of fields to be used from joined layer.
Definition: qgsvectorlayer.h:199
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 ...
Definition: qgsmaplayer.cpp:926
QList< QString > mFields
Definition: qgsvectorlayer.h:568
Definition: qgsrendererv2.h:72
QgsAttributeEditorElement(AttributeEditorType type, QString name, QObject *parent=NULL)
Definition: qgsvectorlayer.h:80
QSet< int > QgsAttributeIds
Definition: qgsvectorlayer.h:65
QgsAttributeEditorContainer(QString name, QObject *parent)
Definition: qgsvectorlayer.h:98
AttributeEditorType
Definition: qgsvectorlayer.h:72
This is the base class for vector data providers.
Definition: qgsvectordataprovider.h:48
QList< int > QgsAttributeList
Definition: qgsvectorlayer.h:62
virtual QgsRectangle extent()
Return the extent of the layer.
Definition: qgsmaplayer.cpp:132
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:468
RangeData()
Definition: qgsvectorlayer.h:520
QString joinLayerId
Source layer.
Definition: qgsvectorlayer.h:170
calendar widget
Definition: qgsvectorlayer.h:499
Definition: qgsvectorlayer.h:487
AttributeEditorType mType
Definition: qgsvectorlayer.h:91
Abstract base class for simplify geometries using a specific algorithm.
Definition: qgsgeometrysimplifier.h:25
Definition: qgsvectorlayer.h:489
QList< GroupData > mGroups
Definition: qgsvectorlayer.h:569