QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsvectorlayer.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvectorlayer.h - description
3  -------------------
4  begin : Oct 29, 2003
5  copyright : (C) 2003 by Gary E.Sherman
6  email : sherman at mrcc.com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSVECTORLAYER_H
19 #define QGSVECTORLAYER_H
20 
21 #include <QMap>
22 #include <QSet>
23 #include <QList>
24 #include <QStringList>
25 
26 #include "qgis.h"
27 #include "qgsmaplayer.h"
28 #include "qgsfeature.h"
29 #include "qgsfeatureiterator.h"
30 #include "qgseditorwidgetconfig.h"
31 #include "qgsfield.h"
32 #include "qgssnapper.h"
33 #include "qgsfield.h"
34 #include "qgsrelation.h"
36 
37 class QPainter;
38 class QImage;
39 
40 class QgsAttributeAction;
43 class QgsFeatureRequest;
44 class QgsGeometry;
45 class QgsGeometryVertexIndex;
46 class QgsLabel;
47 class QgsMapToPixel;
48 class QgsRectangle;
49 class QgsRelation;
50 class QgsRelationManager;
53 class QgsRectangle;
58 class QgsGeometryCache;
60 class QgsSymbolV2;
62 
63 typedef QList<int> QgsAttributeList;
64 typedef QSet<int> QgsAttributeIds;
65 
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 
97 {
98  public:
99  QgsAttributeEditorContainer( QString name, QObject *parent )
100  : QgsAttributeEditorElement( AeTypeContainer, name, parent )
101  , mIsGroupBox( true )
102  {}
103 
105 
106  virtual QDomElement toDomElement( QDomDocument& doc ) const;
107  virtual void addChildElement( QgsAttributeEditorElement *widget );
108  virtual void setIsGroupBox( bool isGroupBox ) { mIsGroupBox = isGroupBox; }
109  virtual bool isGroupBox() const { return mIsGroupBox; }
110  QList<QgsAttributeEditorElement*> children() const { return mChildren; }
111  virtual QList<QgsAttributeEditorElement*> findElements( AttributeEditorType type ) const;
112 
113  private:
115  QList<QgsAttributeEditorElement*> mChildren;
116 };
117 
120 {
121  public:
122  QgsAttributeEditorField( QString name , int idx, QObject *parent )
123  : QgsAttributeEditorElement( AeTypeField, name, parent ), mIdx( idx ) {}
124 
126 
127  virtual QDomElement toDomElement( QDomDocument& doc ) const;
128  int idx() const { return mIdx; }
129 
130  private:
131  int mIdx;
132 };
133 
136 {
137  public:
138  QgsAttributeEditorRelation( QString name, const QString &relationId, QObject *parent )
139  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
140  , mRelationId( relationId ) {}
141 
142  QgsAttributeEditorRelation( QString name, const QgsRelation& relation, QObject *parent )
143  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
144  , mRelationId( relation.id() )
145  , mRelation( relation ) {}
146 
148 
149  virtual QDomElement toDomElement( QDomDocument& doc ) const;
150  const QgsRelation& relation() const { return mRelation; }
151 
158  bool init( QgsRelationManager *relManager );
159 
160  private:
161  QString mRelationId;
163 };
164 
166 struct CORE_EXPORT QgsVectorJoinInfo
167 {
171  QString joinLayerId;
173  QString joinFieldName;
179  QHash< QString, QgsAttributes> cachedAttributes;
180 
185 };
186 
449 class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
450 {
451  Q_OBJECT
452 
453  public:
456  {
457  GeneratedLayout = 0,
458  TabLayout = 1,
459  UiFileLayout = 2
460  };
461 
465  enum EditType
466  {
488  };
489 
493  {
494  SuppressDefault = 0, // use the application-wide setting
495  SuppressOn = 1,
496  SuppressOff = 2
497  };
498 
499  struct RangeData
500  {
501  RangeData() { mMin = QVariant( 0 ); mMax = QVariant( 5 ); mStep = QVariant( 1 );}
502  RangeData( QVariant theMin, QVariant theMax, QVariant theStep )
503  : mMin( theMin ), mMax( theMax ), mStep( theStep ) {}
504 
505  QVariant mMin;
506  QVariant mMax;
507  QVariant mStep;
508  };
509 
511  {
513  ValueRelationData( QString layer, QString key, QString value, bool allowNull, bool orderByValue,
514  bool allowMulti = false,
515  QString filterExpression = QString::null )
516  : mLayer( layer )
517  , mKey( key )
518  , mValue( value )
519  , mFilterExpression( filterExpression )
520  , mAllowNull( allowNull )
521  , mOrderByValue( orderByValue )
522  , mAllowMulti( allowMulti )
523  {}
524 
525  QString mLayer;
526  QString mKey;
527  QString mValue;
531  bool mAllowMulti; /* allow selection of multiple keys @added in 1.9 */
532  };
533 
534  struct GroupData
535  {
537  GroupData( QString name , QList<QString> fields )
538  : mName( name ), mFields( fields ) {}
539  QString mName;
540  QList<QString> mFields;
541  };
542 
543  struct TabData
544  {
545  TabData() {}
546  TabData( QString name , QList<QString> fields , QList<GroupData> groups )
547  : mName( name ), mFields( fields ), mGroups( groups ) {}
548  QString mName;
549  QList<QString> mFields;
550  QList<GroupData> mGroups;
551  };
552 
566  QgsVectorLayer( QString path = QString::null, QString baseName = QString::null,
567  QString providerLib = QString::null, bool loadDefaultStyleFlag = true );
568 
570  virtual ~QgsVectorLayer();
571 
573  QString storageType() const;
574 
576  QString capabilitiesString() const;
577 
579  QString dataComment() const;
580 
582  void setDisplayField( QString fldName = "" );
583 
585  const QString displayField() const;
586 
594  void setDisplayExpression( const QString &displayExpression );
595 
604  const QString displayExpression();
605 
607  QgsVectorDataProvider* dataProvider();
608 
612  const QgsVectorDataProvider* dataProvider() const;
613 
615  void setProviderEncoding( const QString& encoding );
616 
618  void setCoordinateSystem();
619 
623  void addJoin( const QgsVectorJoinInfo& joinInfo );
624 
627  void removeJoin( const QString& joinLayerId );
628 
630  const QList< QgsVectorJoinInfo >& vectorJoins() const;
631 
633  QgsLabel *label();
634 
635  const QgsLabel *label() const;
636 
637  QgsAttributeAction *actions() { return mActions; }
638 
644  int selectedFeatureCount();
645 
654  void select( QgsRectangle & rect, bool addToSelection );
655 
667  void modifySelection( QgsFeatureIds selectIds, QgsFeatureIds deselectIds );
668 
670  void invertSelection();
671 
673  void selectAll();
674 
676  QgsFeatureIds allFeatureIds();
677 
685  void invertSelectionInRectangle( QgsRectangle & rect );
686 
694  QgsFeatureList selectedFeatures();
695 
702  const QgsFeatureIds &selectedFeaturesIds() const;
703 
711  void setSelectedFeatures( const QgsFeatureIds &ids );
712 
714  QgsRectangle boundingBoxOfSelected();
715 
717  void setDiagramRenderer( QgsDiagramRendererV2* r );
718  const QgsDiagramRendererV2* diagramRenderer() const { return mDiagramRenderer; }
719 
720  void setDiagramLayerSettings( const QgsDiagramLayerSettings& s );
721  const QgsDiagramLayerSettings *diagramLayerSettings() const { return mDiagramLayerSettings; }
722 
725  QgsFeatureRendererV2* rendererV2();
729  void setRendererV2( QgsFeatureRendererV2* r );
730 
732  QGis::GeometryType geometryType() const;
733 
737  bool hasGeometryType() const;
738 
740  QGis::WkbType wkbType() const;
741 
743  QString providerType() const;
744 
748  virtual bool readXml( const QDomNode& layer_node );
749 
753  virtual bool writeXml( QDomNode & layer_node, QDomDocument & doc );
754 
763  virtual void saveStyleToDatabase( QString name, QString description,
764  bool useAsDefault, QString uiFileContent,
765  QString &msgError );
766 
775  virtual int listStylesInDatabase( QStringList &ids, QStringList &names,
776  QStringList &descriptions, QString &msgError );
777 
781  virtual QString getStyleFromDatabase( QString styleId, QString &msgError );
782 
789  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag, bool loadFromLocalDb );
790 
795  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag );
796 
797  virtual bool applyNamedStyle( QString namedStyle , QString errorMsg );
798 
803  QgsAttributeEditorElement* attributeEditorElementFromDomElement( QDomElement &elem, QObject* parent );
804 
810  bool readSymbology( const QDomNode& node, QString& errorMessage );
811 
818  bool writeSymbology( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
819 
820  bool writeSld( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
821  bool readSld( const QDomNode& node, QString& errorMessage );
822 
830  virtual long featureCount() const;
831 
838  long featureCount( QgsSymbolV2* symbol );
839 
845  bool countSymbolFeatures( bool showProgress = true );
846 
854  virtual bool setSubsetString( QString subset );
855 
860  virtual QString subsetString();
861 
865  QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() );
866 
872  bool addFeature( QgsFeature& f, bool alsoUpdateExtent = true );
873 
881  bool updateFeature( QgsFeature &f );
882 
887  bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
888 
893  bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
894 
897  bool deleteVertex( QgsFeatureId atFeatureId, int atVertex );
898 
902  bool deleteSelectedFeatures();
903 
913  int addRing( const QList<QgsPoint>& ring );
914 
925  int addPart( const QList<QgsPoint>& ring );
926 
932  int translateFeature( QgsFeatureId featureId, double dx, double dy );
933 
941  int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
942 
950  int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
951 
960  Q_DECL_DEPRECATED int removePolygonIntersections( QgsGeometry* geom, QgsFeatureIds ignoreFeatures = QgsFeatureIds() );
961 
967  int addTopologicalPoints( QgsGeometry* geom );
968 
976  int addTopologicalPoints( const QgsPoint& p );
977 
983  int insertSegmentVerticesForSnap( const QList<QgsSnappingResult>& snapResults );
984 
986  void enableLabels( bool on );
987 
989  bool hasLabelsEnabled() const;
990 
992  virtual bool isEditable() const;
993 
997  virtual bool isReadOnly() const;
998 
1000  virtual bool isModified() const;
1001 
1008  bool snapPoint( QgsPoint& point, double tolerance );
1009 
1017  int snapWithContext( const QgsPoint& startPoint,
1018  double snappingTolerance,
1019  QMultiMap < double, QgsSnappingResult > &snappingResults,
1020  QgsSnapper::SnappingType snap_to );
1021 
1024  virtual void reload();
1025 
1029  virtual QgsMapLayerRenderer* createMapRenderer( QgsRenderContext& rendererContext );
1030 
1034  bool draw( QgsRenderContext& rendererContext );
1035 
1037  void drawLabels( QgsRenderContext& rendererContext );
1038 
1040  QgsRectangle extent();
1041 
1043  const QgsFields &pendingFields() const;
1044 
1046  QgsAttributeList pendingAllAttributesList();
1047 
1051  QgsAttributeList pendingPkAttributesList();
1052 
1054  int pendingFeatureCount();
1055 
1060  bool setReadOnly( bool readonly = true );
1061 
1063  bool startEditing();
1064 
1067  bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom );
1068 
1075  Q_DECL_DEPRECATED bool changeAttributeValue( QgsFeatureId fid, int field, QVariant value, bool emitSignal );
1076 
1087  bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant() );
1088 
1092  bool addAttribute( const QgsField &field );
1093 
1098  void addAttributeAlias( int attIndex, QString aliasString );
1099 
1104  void addAttributeEditorWidget( QgsAttributeEditorElement* data );
1105 
1113  const QString editorWidgetV2( int fieldIdx ) const;
1114 
1124  const QString editorWidgetV2( const QString& fieldName ) const;
1125 
1133  const QgsEditorWidgetConfig editorWidgetV2Config( int fieldIdx ) const;
1134 
1144  const QgsEditorWidgetConfig editorWidgetV2Config( const QString& fieldName ) const;
1145 
1150  QList< QgsAttributeEditorElement* > &attributeEditorElements();
1155  void clearAttributeEditorWidgets();
1156 
1161  QString attributeAlias( int attributeIndex ) const;
1162 
1167  QString attributeDisplayName( int attributeIndex ) const;
1168 
1169  const QMap< QString, QString >& attributeAliases() const { return mAttributeAliasMap; }
1170 
1171  const QSet<QString>& excludeAttributesWMS() const { return mExcludeAttributesWMS; }
1172  void setExcludeAttributesWMS( const QSet<QString>& att ) { mExcludeAttributesWMS = att; }
1173 
1174  const QSet<QString>& excludeAttributesWFS() const { return mExcludeAttributesWFS; }
1175  void setExcludeAttributesWFS( const QSet<QString>& att ) { mExcludeAttributesWFS = att; }
1176 
1178  bool deleteAttribute( int attr );
1179 
1187  bool deleteAttributes( QList<int> attrs );
1188 
1190  bool addFeatures( QgsFeatureList features, bool makeSelected = true );
1191 
1193  bool deleteFeature( QgsFeatureId fid );
1194 
1210  bool commitChanges();
1211  const QStringList &commitErrors();
1212 
1216  bool rollBack( bool deleteBuffer = true );
1217 
1223  Q_DECL_DEPRECATED EditType editType( int idx );
1224 
1230  Q_DECL_DEPRECATED void setEditType( int idx, EditType edit );
1231 
1233  EditorLayout editorLayout();
1234 
1236  void setEditorLayout( EditorLayout editorLayout );
1237 
1244  void setEditorWidgetV2( int attrIdx, const QString& widgetType );
1245 
1252  void setEditorWidgetV2Config( int attrIdx, const QgsEditorWidgetConfig& config );
1253 
1259  Q_DECL_DEPRECATED void setCheckedState( int idx, QString checked, QString notChecked );
1260 
1262  QString editForm();
1263 
1265  void setEditForm( QString ui );
1266 
1269  QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const { return mFeatureFormSuppress; }
1270 
1273  void setFeatureFormSuppress( QgsVectorLayer::FeatureFormSuppress s ) { mFeatureFormSuppress = s; }
1274 
1276  QString annotationForm() const { return mAnnotationForm; }
1277 
1279  void setAnnotationForm( const QString& ui );
1280 
1282  QString editFormInit();
1283 
1285  void setEditFormInit( QString function );
1286 
1291  Q_DECL_DEPRECATED QMap<QString, QVariant> valueMap( int idx );
1292 
1298  Q_DECL_DEPRECATED RangeData range( int idx );
1299 
1305  ValueRelationData valueRelation( int idx );
1306 
1313  QList<QgsRelation> referencingRelations( int idx );
1314 
1322  Q_DECL_DEPRECATED QString dateFormat( int idx );
1323 
1331  Q_DECL_DEPRECATED QSize widgetSize( int idx );
1332 
1336  bool fieldEditable( int idx );
1337 
1341  bool labelOnTop( int idx );
1342 
1346  void setFieldEditable( int idx, bool editable );
1347 
1351  void setLabelOnTop( int idx, bool onTop );
1352 
1354  QgsVectorLayerEditBuffer* editBuffer() { return mEditBuffer; }
1355 
1360  void beginEditCommand( QString text );
1361 
1363  void endEditCommand();
1364 
1366  void destroyEditCommand();
1367 
1371  int fieldNameIndex( const QString& fieldName ) const;
1372 
1376  {
1379  NoMarker /* added in version 1.1 */
1380  };
1381 
1384  static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
1385 
1388  void updateFields();
1389 
1392  void createJoinCaches();
1393 
1399  void uniqueValues( int index, QList<QVariant> &uniqueValues, int limit = -1 );
1400 
1403  QVariant minimumValue( int index );
1404 
1407  QVariant maximumValue( int index );
1408 
1409  /* Set the blending mode used for rendering each feature
1410  * @note added in 2.0
1411  */
1412  void setFeatureBlendMode( const QPainter::CompositionMode &blendMode );
1413  /* Returns the current blending mode for features
1414  * @note added in 2.0
1415  */
1416  QPainter::CompositionMode featureBlendMode() const;
1417 
1418  /* Set the transparency for the vector layer
1419  * @note added in 2.0
1420  */
1421  void setLayerTransparency( int layerTransparency );
1422  /* Returns the current transparency for the vector layer
1423  * @note added in 2.0
1424  */
1425  int layerTransparency() const;
1426 
1427  QString metadata();
1428 
1430  inline QgsGeometryCache* cache() { return mCache; }
1431 
1435  void setSimplifyMethod( const QgsVectorSimplifyMethod& simplifyMethod ) { mSimplifyMethod = simplifyMethod; }
1439  inline const QgsVectorSimplifyMethod& simplifyMethod() const { return mSimplifyMethod; }
1440 
1445  bool simplifyDrawingCanbeApplied( const QgsRenderContext& renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint ) const;
1446 
1447  public slots:
1455  void select( const QgsFeatureId &featureId );
1456 
1464  void select( const QgsFeatureIds& featureIds );
1465 
1473  void deselect( const QgsFeatureId featureId );
1474 
1482  void deselect( const QgsFeatureIds& featureIds );
1483 
1489  void removeSelection();
1490 
1491  void triggerRepaint();
1492 
1496  virtual void updateExtents();
1497 
1500  void checkJoinLayerRemove( QString theLayerId );
1501 
1502  protected slots:
1503  void invalidateSymbolCountedFlag();
1504 
1505  signals:
1506 
1514  void selectionChanged( const QgsFeatureIds selected, const QgsFeatureIds deselected, const bool clearAndSelect );
1515 
1517  void selectionChanged();
1518 
1520  void layerModified();
1521 
1523  void beforeModifiedCheck() const;
1524 
1526  void editingStarted();
1527 
1529  void editingStopped();
1530 
1532  void beforeCommitChanges();
1533 
1535  void beforeRollBack();
1536 
1545  void attributeAdded( int idx );
1554  void attributeDeleted( int idx );
1555  void featureAdded( QgsFeatureId fid ); // added in 1.7
1556  void featureDeleted( QgsFeatureId fid );
1563  void updatedFields();
1564  void layerDeleted();
1565 
1566  void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant & );
1567  void geometryChanged( QgsFeatureId fid, QgsGeometry &geom ); // added in 1.9
1568 
1571  void committedAttributesDeleted( const QString& layerId, const QgsAttributeList& deletedAttributes );
1572  void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
1573  void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );
1574  void committedFeaturesRemoved( const QString& layerId, const QgsFeatureIds& deletedFeatureIds );
1575  void committedAttributeValuesChanges( const QString& layerId, const QgsChangedAttributesMap& changedAttributesValues );
1576  void committedGeometriesChanges( const QString& layerId, const QgsGeometryMap& changedGeometries );
1577 
1578  void saveLayerToProject();
1579 
1583  void labelingFontNotFound( QgsVectorLayer* layer, const QString& fontfamily );
1584 
1586  void featureBlendModeChanged( const QPainter::CompositionMode &blendMode );
1587 
1589  void layerTransparencyChanged( int layerTransparency );
1590 
1596  void editCommandStarted( const QString& text );
1597 
1603  void editCommandEnded();
1604 
1610  void editCommandDestroyed();
1611 
1612  private slots:
1613  void onRelationsLoaded();
1614 
1615  protected:
1617  void setExtent( const QgsRectangle &rect );
1618 
1619  private: // Private methods
1620 
1622  QgsVectorLayer( const QgsVectorLayer & rhs );
1623 
1625  QgsVectorLayer & operator=( QgsVectorLayer const & rhs );
1626 
1631  bool setDataProvider( QString const & provider );
1632 
1634  QgsFeatureId findFreeId();
1635 
1644  void snapToGeometry( const QgsPoint& startPoint,
1645  QgsFeatureId featureId,
1646  QgsGeometry* geom,
1647  double sqrSnappingTolerance,
1648  QMultiMap<double, QgsSnappingResult>& snappingResults,
1649  QgsSnapper::SnappingType snap_to ) const;
1650 
1652  //void addJoinedAttributes( QgsFeature& f, bool all = false );
1653 
1655  void readSldLabeling( const QDomNode& node );
1656 
1657  private: // Private attributes
1658 
1661 
1663  QString mDisplayField;
1664 
1667 
1669  QString mProviderKey;
1670 
1673 
1676 
1682 
1685 
1687  QMap< QString, QString > mAttributeAliasMap;
1688 
1690  QList< QgsAttributeEditorElement* > mAttributeEditorElements;
1691 
1693  QSet<QString> mExcludeAttributesWMS;
1695  QSet<QString> mExcludeAttributesWFS;
1696 
1698  QList< TabData > mTabs;
1699 
1702 
1705 
1708 
1711 
1713  bool mLabelOn;
1714 
1717 
1719  QPainter::CompositionMode mFeatureBlendMode;
1720 
1723 
1726 
1729 
1732 
1733  QStringList mCommitErrors;
1734 
1735  QMap< QString, bool> mFieldEditables;
1736  QMap< QString, bool> mLabelOnTop;
1737 
1738  QMap<QString, QString> mEditorWidgetV2Types;
1739  QMap<QString, QgsEditorWidgetConfig > mEditorWidgetV2Configs;
1740 
1743 
1744  QString mEditForm, mEditFormInit;
1745 
1749 
1750  //annotation form for this layer
1752 
1755 
1759 
1760  //stores information about joined layers
1762 
1763  //diagram rendering object. 0 if diagram drawing is disabled
1765 
1766  //stores infos about diagram placement (placement type, priority, position distance)
1768 
1771 
1772  // Features in renderer classes counted
1774 
1775  // Feature counts for each renderer symbol
1776  QMap<QgsSymbolV2*, long> mSymbolFeatureCountMap;
1777 
1779 };
1780 
1781 #endif
virtual bool isEditable() const
True if the layer can be edited.
EditorLayout mEditorLayout
Defines the default layout to use for the attribute editor (Drag and drop, UI File, Generated)
int mWkbType
Geometry type as defined in enum WkbType (qgis.h)
Wrapper for iterator of features from vector data provider or vector layer.
QString annotationForm() const
get annotation form (added in 1.5)
QMap< QgsFeatureId, QgsGeometry > QgsGeometryMap
Definition: qgsfeature.h:323
static unsigned index
int mCurrentVertexMarkerSize
The current size of editing marker.
A rectangle specified with double values.
Definition: qgsrectangle.h:35
Base class for all map layer types.
Definition: qgsmaplayer.h:48
QSet< QString > mExcludeAttributesWFS
Attributes which are not published in WFS.
QgsVectorLayer::FeatureFormSuppress mFeatureFormSuppress
Type of feature form suppression after feature creation.
QString joinFieldName
Join field in the source layer.
const QSet< QString > & excludeAttributesWMS() const
QgsVectorDataProvider * mDataProvider
Pointer to data provider derived from the abastract base class QgsDataProvider.
QgsVectorLayer::VertexMarkerType mCurrentVertexMarkerType
The current type of editing marker.
void setExcludeAttributesWFS(const QSet< QString > &att)
virtual QString metadata()
Obtain Metadata for this layer.
QString targetFieldName
Join field in the target layer.
virtual void drawLabels(QgsRenderContext &rendererContext)
Draw labels.
GeometryType
Definition: qgis.h:155
virtual bool isGroupBox() const
RangeData(QVariant theMin, QVariant theMax, QVariant theStep)
QgsAttributeAction * actions()
EditorLayout
The different types to layout the attribute editor.
QMap< QString, QgsEditorWidgetConfig > mEditorWidgetV2Configs
The attribute value should not be changed in the attribute form.
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeature.h:325
QList< QgsFeature > QgsFeatureList
Definition: qgsfeature.h:330
Manages an editor widget Widget and wrapper share the same parent.
QList< QgsAttributeEditorElement * > mAttributeEditorElements
Stores a list of attribute editor elements (Each holding a tree structure for a tab in the attribute ...
void setExcludeAttributesWMS(const QSet< QString > &att)
QgsFeatureRendererV2 * mRendererV2
Renderer object which holds the information about how to display the features.
int joinFieldIndex
Join field index in the source layer.
virtual bool readSymbology(const QDomNode &node, QString &errorMessage)=0
Read the symbology for the current layer from the Dom node supplied.
Storage and management of actions associated with Qgis layer attributes.
const QgsVectorSimplifyMethod & simplifyMethod() const
Returns the simplification settings for fast rendering of features.
virtual void reload()
Synchronises with changes in the datasource.
Definition: qgsmaplayer.h:132
VertexMarkerType
Editing vertex markers.
QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const
Type of feature form pop-up suppression after feature creation (overrides app setting) ...
SimplifyHint
Simplification flags for fast rendering of features.
QString mDisplayExpression
the preview expression used to generate a human readable preview string for features ...
Container of fields for a vector layer.
Definition: qgsfield.h:161
WkbType
Used for symbology operations.
Definition: qgis.h:53
QMap< QString, bool > mFieldEditables
virtual ~QgsAttributeEditorElement()
virtual QgsMapLayerRenderer * createMapRenderer(QgsRenderContext &rendererContext)
Return new instance of QgsMapLayerRenderer that will be used for rendering of given context...
Definition: qgsmaplayer.h:137
const QgsRelation & relation() const
bool memoryCache
True if the join is cached in virtual memory.
int targetFieldIndex
Join field index in the target layer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:113
const QgsDiagramLayerSettings * diagramLayerSettings() const
QStringList mCommitErrors
QgsAttributeEditorField(QString name, int idx, QObject *parent)
TabData(QString name, QList< QString > fields, QList< GroupData > groups)
bool mVertexMarkerOnlyForSelection
Flag if the vertex markers should be drawn only for selection (true) or for all features (false) ...
virtual bool writeSymbology(QDomNode &node, QDomDocument &doc, QString &errorMessage) const =0
Write the symbology for the layer into the docment provided.
QgsGeometryCache * cache()
QgsAttributeEditorRelation(QString name, const QString &relationId, QObject *parent)
Returns diagram settings for a feature.
Manages joined fields for a vector layer.
virtual bool draw(QgsRenderContext &rendererContext)
This is the method that does the actual work of drawing the layer onto a paint device.
QString mAnnotationForm
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:33
SnappingType
Snap to vertex, to segment or both.
Definition: qgssnapper.h:66
QList< QgsAttributeEditorElement * > mChildren
QgsVectorLayerEditBuffer * editBuffer()
Buffer with uncommitted editing operations. Only valid after editing has been turned on...
bool mLabelFontNotFoundNotified
Whether 'labeling font not found' has be shown for this layer (only show once in QgsMessageBar, on first rendering)
QgsGeometryCache * mCache
cache for some vector layer data - currently only geometries for faster editing
virtual bool writeXml(QDomNode &layer_node, QDomDocument &document)
called by writeLayerXML(), used by children to write state specific to them to project files...
The attribute value should not be shown in the attribute form.
const QSet< QString > & excludeAttributesWFS() const
virtual void setExtent(const QgsRectangle &rect)
Set the extent.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
QList< int > QgsAttributeList
AttributeEditorType type() const
QgsVectorSimplifyMethod mSimplifyMethod
Simplification object which holds the information about how to simplify the features for fast renderi...
QgsDiagramLayerSettings * mDiagramLayerSettings
Encapsulate a field in an attribute table or data source.
Definition: qgsfield.h:31
QMap< QgsSymbolV2 *, long > mSymbolFeatureCountMap
const QMap< QString, QString > & attributeAliases() const
const QgsDiagramRendererV2 * diagramRenderer() const
A class to represent a point geometry.
Definition: qgspoint.h:63
virtual bool readSld(const QDomNode &node, QString &errorMessage)
Definition: qgsmaplayer.h:351
QMap< QString, QString > mAttributeAliasMap
Map that stores the aliases for attributes.
QList< TabData > mTabs
Map that stores the tab for attributes in the edit form.
QList< QgsAttributeEditorElement * > children() const
QgsVectorLayerEditBuffer * mEditBuffer
stores information about uncommitted changes to layer
Partial snapshot of vector layer's state (only the members necessary for access to features) ...
QgsMapLayer & operator=(QgsMapLayer const &)
private assign operator - QgsMapLayer not copyable
QList< QString > mFields
A class to render labels.
Definition: qgslabel.h:51
uuid generator - readonly and automatically intialized
QgsDiagramRendererV2 * mDiagramRenderer
This class contains information how to simplify geometries fetched from a vector layer.
Contains information about the context of a rendering operation.
ValueRelationData(QString layer, QString key, QString value, bool allowNull, bool orderByValue, bool allowMulti=false, QString filterExpression=QString::null)
QString mDisplayField
index of the primary label field
virtual QDomElement toDomElement(QDomDocument &doc) const =0
QSet< QString > mExcludeAttributesWMS
Attributes which are not published in WMS.
QHash< QString, QgsAttributes > cachedAttributes
Cache for joined attributes to provide fast lookup (size is 0 if no memory caching) ...
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
Definition: qgsfeature.h:320
QMap< QString, QString > mEditorWidgetV2Types
bool mLabelOn
Display labels.
QgsVectorLayerJoinBuffer * mJoinBuffer
GroupData(QString name, QList< QString > fields)
virtual void setIsGroupBox(bool isGroupBox)
This class manages a set of relations between layers.
virtual bool readXml(const QDomNode &layer_node)
called by readLayerXML(), used by children to read state specific to them from project files...
QgsAttributeEditorRelation(QString name, const QgsRelation &relation, QObject *parent)
Class for doing transforms between two map coordinate systems.
QMap< QString, bool > mLabelOnTop
void setSimplifyMethod(const QgsVectorSimplifyMethod &simplifyMethod)
Set the simplification settings for fast rendering of features.
QMap< QString, QVariant > QgsEditorWidgetConfig
Holds a set of configuration parameters for a editor widget wrapper.
qint64 QgsFeatureId
Definition: qgsfeature.h:30
Base class for utility classes that encapsulate information necessary for rendering of map layers...
void setFeatureFormSuppress(QgsVectorLayer::FeatureFormSuppress s)
Set type of feature form pop-up suppression after feature creation (overrides app setting) ...
int mLayerTransparency
Layer transparency.
virtual QString loadNamedStyle(const QString &theURI, bool &theResultFlag)
Retrieve a named style for this layer if one exists (either as a .qml file on disk or as a record in ...
QList< QString > mFields
QgsAttributeEditorElement(AttributeEditorType type, QString name, QObject *parent=NULL)
QgsLabel * mLabel
Label.
QSet< int > QgsAttributeIds
QgsAttributeEditorContainer(QString name, QObject *parent)
FeatureFormSuppress
Types of feature form suppression after feature creation.
This is the base class for vector data providers.
QList< int > QgsAttributeList
QgsFields mUpdatedFields
field map to commit
QPainter::CompositionMode mFeatureBlendMode
Blend mode for features.
virtual QgsRectangle extent()
Return the extent of the layer.
Represents a vector layer which manages a vector based data sets.
modularized edit widgets
bool mReadOnly
Flag indicating whether the layer is in read-only mode (editing disabled) or not. ...
QgsFeatureIds mSelectedFeatureIds
Set holding the feature IDs that are activated.
QString joinLayerId
Source layer.
value map from an table
AttributeEditorType mType
Abstract base class for simplify geometries using a specific algorithm.
QString mProviderKey
Data provider key.
QgsAttributeAction * mActions
The user-defined actions that are accessed from the Identify Results dialog box.
QList< GroupData > mGroups