QGIS API Documentation  2.3.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;
42 class QgsEditorWidgetWrapper;
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 
103 
104  virtual QDomElement toDomElement( QDomDocument& doc ) const;
105  virtual void addChildElement( QgsAttributeEditorElement *widget );
106  virtual bool isGroupBox() const { return true; }
107  QList<QgsAttributeEditorElement*> children() const { return mChildren; }
108  virtual QList<QgsAttributeEditorElement*> findElements( AttributeEditorType type ) const;
109 
110  private:
111  QList<QgsAttributeEditorElement*> mChildren;
112 };
113 
116 {
117  public:
118  QgsAttributeEditorField( QString name , int idx, QObject *parent )
119  : QgsAttributeEditorElement( AeTypeField, name, parent ), mIdx( idx ) {}
120 
122 
123  virtual QDomElement toDomElement( QDomDocument& doc ) const;
124  int idx() const { return mIdx; }
125 
126  private:
127  int mIdx;
128 };
129 
132 {
133  public:
134  QgsAttributeEditorRelation( QString name, const QString &relationId, QObject *parent )
135  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
136  , mRelationId( relationId ) {}
137 
138  QgsAttributeEditorRelation( QString name, const QgsRelation& relation, QObject *parent )
139  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
140  , mRelationId( relation.id() )
141  , mRelation( relation ) {}
142 
144 
145  virtual QDomElement toDomElement( QDomDocument& doc ) const;
146  const QgsRelation& relation() const { return mRelation; }
147 
154  bool init( QgsRelationManager *relManager );
155 
156  private:
157  QString mRelationId;
159 };
160 
162 struct CORE_EXPORT QgsVectorJoinInfo
163 {
167  QString joinLayerId;
169  QString joinFieldName;
175  QHash< QString, QgsAttributes> cachedAttributes;
176 
181 };
182 
451 class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
452 {
453  Q_OBJECT
454 
455  public:
458  {
459  GeneratedLayout = 0,
460  TabLayout = 1,
461  UiFileLayout = 2
462  };
463 
464  enum EditType
465  {
487  };
488 
492  {
493  SuppressDefault = 0, // use the application-wide setting
494  SuppressOn = 1,
495  SuppressOff = 2
496  };
497 
498  struct RangeData
499  {
500  RangeData() { mMin = QVariant( 0 ); mMax = QVariant( 5 ); mStep = QVariant( 1 );}
501  RangeData( QVariant theMin, QVariant theMax, QVariant theStep )
502  : mMin( theMin ), mMax( theMax ), mStep( theStep ) {}
503 
504  QVariant mMin;
505  QVariant mMax;
506  QVariant mStep;
507  };
508 
510  {
512  ValueRelationData( QString layer, QString key, QString value, bool allowNull, bool orderByValue,
513  bool allowMulti = false,
514  QString filterExpression = QString::null )
515  : mLayer( layer )
516  , mKey( key )
517  , mValue( value )
518  , mFilterExpression( filterExpression )
519  , mAllowNull( allowNull )
520  , mOrderByValue( orderByValue )
521  , mAllowMulti( allowMulti )
522  {}
523 
524  QString mLayer;
525  QString mKey;
526  QString mValue;
530  bool mAllowMulti; /* allow selection of multiple keys @added in 1.9 */
531  };
532 
533  struct GroupData
534  {
536  GroupData( QString name , QList<QString> fields )
537  : mName( name ), mFields( fields ) {}
538  QString mName;
539  QList<QString> mFields;
540  };
541 
542  struct TabData
543  {
544  TabData() {}
545  TabData( QString name , QList<QString> fields , QList<GroupData> groups )
546  : mName( name ), mFields( fields ), mGroups( groups ) {}
547  QString mName;
548  QList<QString> mFields;
549  QList<GroupData> mGroups;
550  };
551 
565  QgsVectorLayer( QString path = QString::null, QString baseName = QString::null,
566  QString providerLib = QString::null, bool loadDefaultStyleFlag = true );
567 
569  virtual ~QgsVectorLayer();
570 
572  QString storageType() const;
573 
575  QString capabilitiesString() const;
576 
578  QString dataComment() const;
579 
581  void setDisplayField( QString fldName = "" );
582 
584  const QString displayField() const;
585 
593  void setDisplayExpression( const QString &displayExpression );
594 
603  const QString displayExpression();
604 
606  QgsVectorDataProvider* dataProvider();
607 
611  const QgsVectorDataProvider* dataProvider() const;
612 
614  void setProviderEncoding( const QString& encoding );
615 
617  void setCoordinateSystem();
618 
622  void addJoin( const QgsVectorJoinInfo& joinInfo );
623 
626  void removeJoin( const QString& joinLayerId );
627 
629  const QList< QgsVectorJoinInfo >& vectorJoins() const;
630 
632  QgsLabel *label();
633 
634  const QgsLabel *label() const;
635 
636  QgsAttributeAction *actions() { return mActions; }
637 
643  int selectedFeatureCount();
644 
653  void select( QgsRectangle & rect, bool addToSelection );
654 
666  void modifySelection( QgsFeatureIds selectIds, QgsFeatureIds deselectIds );
667 
669  void invertSelection();
670 
672  void selectAll();
673 
675  QgsFeatureIds allFeatureIds();
676 
684  void invertSelectionInRectangle( QgsRectangle & rect );
685 
693  QgsFeatureList selectedFeatures();
694 
701  const QgsFeatureIds &selectedFeaturesIds() const;
702 
710  void setSelectedFeatures( const QgsFeatureIds &ids );
711 
713  QgsRectangle boundingBoxOfSelected();
714 
716  void setDiagramRenderer( QgsDiagramRendererV2* r );
717  const QgsDiagramRendererV2* diagramRenderer() const { return mDiagramRenderer; }
718 
719  void setDiagramLayerSettings( const QgsDiagramLayerSettings& s );
720  const QgsDiagramLayerSettings *diagramLayerSettings() const { return mDiagramLayerSettings; }
721 
724  QgsFeatureRendererV2* rendererV2();
728  void setRendererV2( QgsFeatureRendererV2* r );
729 
731  QGis::GeometryType geometryType() const;
732 
736  bool hasGeometryType() const;
737 
739  QGis::WkbType wkbType() const;
740 
742  QString providerType() const;
743 
747  virtual bool readXml( const QDomNode& layer_node );
748 
752  virtual bool writeXml( QDomNode & layer_node, QDomDocument & doc );
753 
762  virtual void saveStyleToDatabase( QString name, QString description,
763  bool useAsDefault, QString uiFileContent,
764  QString &msgError );
765 
774  virtual int listStylesInDatabase( QStringList &ids, QStringList &names,
775  QStringList &descriptions, QString &msgError );
776 
780  virtual QString getStyleFromDatabase( QString styleId, QString &msgError );
781 
788  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag, bool loadFromLocalDb );
789 
794  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag );
795 
796  virtual bool applyNamedStyle( QString namedStyle , QString errorMsg );
797 
802  QgsAttributeEditorElement* attributeEditorElementFromDomElement( QDomElement &elem, QObject* parent );
803 
809  bool readSymbology( const QDomNode& node, QString& errorMessage );
810 
817  bool writeSymbology( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
818 
819  bool writeSld( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
820  bool readSld( const QDomNode& node, QString& errorMessage );
821 
829  virtual long featureCount() const;
830 
837  long featureCount( QgsSymbolV2* symbol );
838 
844  bool countSymbolFeatures( bool showProgress = true );
845 
853  virtual bool setSubsetString( QString subset );
854 
859  virtual QString subsetString();
860 
864  QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() );
865 
871  bool addFeature( QgsFeature& f, bool alsoUpdateExtent = true );
872 
880  bool updateFeature( QgsFeature &f );
881 
886  bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
887 
892  bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
893 
896  bool deleteVertex( QgsFeatureId atFeatureId, int atVertex );
897 
901  bool deleteSelectedFeatures();
902 
912  int addRing( const QList<QgsPoint>& ring );
913 
924  int addPart( const QList<QgsPoint>& ring );
925 
931  int translateFeature( QgsFeatureId featureId, double dx, double dy );
932 
940  int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
941 
949  int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
950 
959  Q_DECL_DEPRECATED int removePolygonIntersections( QgsGeometry* geom, QgsFeatureIds ignoreFeatures = QgsFeatureIds() );
960 
966  int addTopologicalPoints( QgsGeometry* geom );
967 
975  int addTopologicalPoints( const QgsPoint& p );
976 
982  int insertSegmentVerticesForSnap( const QList<QgsSnappingResult>& snapResults );
983 
985  void enableLabels( bool on );
986 
988  bool hasLabelsEnabled() const;
989 
991  virtual bool isEditable() const;
992 
996  virtual bool isReadOnly() const;
997 
999  virtual bool isModified() const;
1000 
1007  bool snapPoint( QgsPoint& point, double tolerance );
1008 
1016  int snapWithContext( const QgsPoint& startPoint,
1017  double snappingTolerance,
1018  QMultiMap < double, QgsSnappingResult > &snappingResults,
1019  QgsSnapper::SnappingType snap_to );
1020 
1023  virtual void reload();
1024 
1028  virtual QgsMapLayerRenderer* createMapRenderer( QgsRenderContext& rendererContext );
1029 
1033  bool draw( QgsRenderContext& rendererContext );
1034 
1036  void drawLabels( QgsRenderContext& rendererContext );
1037 
1039  QgsRectangle extent();
1040 
1042  const QgsFields &pendingFields() const;
1043 
1045  QgsAttributeList pendingAllAttributesList();
1046 
1050  QgsAttributeList pendingPkAttributesList();
1051 
1053  int pendingFeatureCount();
1054 
1059  bool setReadOnly( bool readonly = true );
1060 
1062  bool startEditing();
1063 
1066  bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom );
1067 
1074  Q_DECL_DEPRECATED bool changeAttributeValue( QgsFeatureId fid, int field, QVariant value, bool emitSignal );
1075 
1086  bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant() );
1087 
1091  bool addAttribute( const QgsField &field );
1092 
1097  void addAttributeAlias( int attIndex, QString aliasString );
1098 
1103  void addAttributeEditorWidget( QgsAttributeEditorElement* data );
1104 
1112  const QString editorWidgetV2( int fieldIdx );
1113 
1121  const QgsEditorWidgetConfig editorWidgetV2Config( int fieldIdx );
1122 
1127  QList< QgsAttributeEditorElement* > &attributeEditorElements();
1132  void clearAttributeEditorWidgets();
1133 
1138  QString attributeAlias( int attributeIndex ) const;
1139 
1144  QString attributeDisplayName( int attributeIndex ) const;
1145 
1146  const QMap< QString, QString >& attributeAliases() const { return mAttributeAliasMap; }
1147 
1148  const QSet<QString>& excludeAttributesWMS() const { return mExcludeAttributesWMS; }
1149  void setExcludeAttributesWMS( const QSet<QString>& att ) { mExcludeAttributesWMS = att; }
1150 
1151  const QSet<QString>& excludeAttributesWFS() const { return mExcludeAttributesWFS; }
1152  void setExcludeAttributesWFS( const QSet<QString>& att ) { mExcludeAttributesWFS = att; }
1153 
1155  bool deleteAttribute( int attr );
1156 
1164  bool deleteAttributes( QList<int> attrs );
1165 
1167  bool addFeatures( QgsFeatureList features, bool makeSelected = true );
1168 
1170  bool deleteFeature( QgsFeatureId fid );
1171 
1187  bool commitChanges();
1188  const QStringList &commitErrors();
1189 
1193  bool rollBack( bool deleteBuffer = true );
1194 
1196  EditType editType( int idx );
1197 
1199  void setEditType( int idx, EditType edit );
1200 
1202  EditorLayout editorLayout();
1203 
1205  void setEditorLayout( EditorLayout editorLayout );
1206 
1207  void setEditorWidgetV2( int attrIdx, const QString& widgetType );
1208 
1209  void setEditorWidgetV2Config( int attrIdx, const QMap<QString, QVariant>& config );
1210 
1212  void setCheckedState( int idx, QString checked, QString notChecked );
1213 
1218  QPair<QString, QString> checkedState( int idx );
1219 
1221  QString editForm();
1222 
1224  void setEditForm( QString ui );
1225 
1228  QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const { return mFeatureFormSuppress; }
1229 
1232  void setFeatureFormSuppress( QgsVectorLayer::FeatureFormSuppress s ) { mFeatureFormSuppress = s; }
1233 
1235  QString annotationForm() const { return mAnnotationForm; }
1236 
1238  void setAnnotationForm( const QString& ui );
1239 
1241  QString editFormInit();
1242 
1244  void setEditFormInit( QString function );
1245 
1247  QMap<QString, QVariant> &valueMap( int idx );
1248 
1250  RangeData &range( int idx );
1251 
1255  ValueRelationData &valueRelation( int idx );
1256 
1263  QList<QgsRelation> referencingRelations( int idx );
1264 
1268  QString &dateFormat( int idx );
1269 
1273  QSize &widgetSize( int idx );
1274 
1278  bool fieldEditable( int idx );
1279 
1283  bool labelOnTop( int idx );
1284 
1288  void setFieldEditable( int idx, bool editable );
1289 
1293  void setLabelOnTop( int idx, bool onTop );
1294 
1296  QgsVectorLayerEditBuffer* editBuffer() { return mEditBuffer; }
1297 
1302  void beginEditCommand( QString text );
1303 
1305  void endEditCommand();
1306 
1308  void destroyEditCommand();
1309 
1313  int fieldNameIndex( const QString& fieldName ) const;
1314 
1318  {
1321  NoMarker /* added in version 1.1 */
1322  };
1323 
1326  static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
1327 
1330  void updateFields();
1331 
1334  void createJoinCaches();
1335 
1341  void uniqueValues( int index, QList<QVariant> &uniqueValues, int limit = -1 );
1342 
1345  QVariant minimumValue( int index );
1346 
1349  QVariant maximumValue( int index );
1350 
1351  /* Set the blending mode used for rendering each feature
1352  * @note added in 2.0
1353  */
1354  void setFeatureBlendMode( const QPainter::CompositionMode &blendMode );
1355  /* Returns the current blending mode for features
1356  * @note added in 2.0
1357  */
1358  QPainter::CompositionMode featureBlendMode() const;
1359 
1360  /* Set the transparency for the vector layer
1361  * @note added in 2.0
1362  */
1363  void setLayerTransparency( int layerTransparency );
1364  /* Returns the current transparency for the vector layer
1365  * @note added in 2.0
1366  */
1367  int layerTransparency() const;
1368 
1369  QString metadata();
1370 
1372  inline QgsGeometryCache* cache() { return mCache; }
1373 
1377  void setSimplifyMethod( const QgsVectorSimplifyMethod& simplifyMethod ) { mSimplifyMethod = simplifyMethod; }
1381  inline const QgsVectorSimplifyMethod& simplifyMethod() const { return mSimplifyMethod; }
1382 
1387  bool simplifyDrawingCanbeApplied( const QgsRenderContext& renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint ) const;
1388 
1389  public slots:
1397  void select( const QgsFeatureId &featureId );
1398 
1406  void select( const QgsFeatureIds& featureIds );
1407 
1415  void deselect( const QgsFeatureId featureId );
1416 
1424  void deselect( const QgsFeatureIds& featureIds );
1425 
1431  void removeSelection();
1432 
1433  void triggerRepaint();
1434 
1438  virtual void updateExtents();
1439 
1442  void checkJoinLayerRemove( QString theLayerId );
1443 
1444  protected slots:
1445  void invalidateSymbolCountedFlag();
1446 
1447  signals:
1448 
1456  void selectionChanged( const QgsFeatureIds selected, const QgsFeatureIds deselected, const bool clearAndSelect );
1457 
1459  void selectionChanged();
1460 
1462  void layerModified();
1463 
1465  void editingStarted();
1466 
1468  void editingStopped();
1469 
1471  void beforeCommitChanges();
1472 
1474  void beforeRollBack();
1475 
1484  void attributeAdded( int idx );
1493  void attributeDeleted( int idx );
1494  void featureAdded( QgsFeatureId fid ); // added in 1.7
1495  void featureDeleted( QgsFeatureId fid );
1502  void updatedFields();
1503  void layerDeleted();
1504 
1505  void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant & );
1506  void geometryChanged( QgsFeatureId fid, QgsGeometry &geom ); // added in 1.9
1507 
1510  void committedAttributesDeleted( const QString& layerId, const QgsAttributeList& deletedAttributes );
1511  void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
1512  void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );
1513  void committedFeaturesRemoved( const QString& layerId, const QgsFeatureIds& deletedFeatureIds );
1514  void committedAttributeValuesChanges( const QString& layerId, const QgsChangedAttributesMap& changedAttributesValues );
1515  void committedGeometriesChanges( const QString& layerId, const QgsGeometryMap& changedGeometries );
1516 
1517  void saveLayerToProject();
1518 
1522  void labelingFontNotFound( QgsVectorLayer* layer, const QString& fontfamily );
1523 
1525  void rendererChanged();
1526 
1528  void featureBlendModeChanged( const QPainter::CompositionMode &blendMode );
1529 
1531  void layerTransparencyChanged( int layerTransparency );
1532 
1538  void editCommandStarted( const QString& text );
1539 
1545  void editCommandEnded();
1546 
1552  void editCommandDestroyed();
1553 
1554  private slots:
1555  void onRelationsLoaded();
1556 
1557  protected:
1559  void setExtent( const QgsRectangle &rect );
1560 
1561  private: // Private methods
1562 
1564  QgsVectorLayer( const QgsVectorLayer & rhs );
1565 
1567  QgsVectorLayer & operator=( QgsVectorLayer const & rhs );
1568 
1573  bool setDataProvider( QString const & provider );
1574 
1576  QgsFeatureId findFreeId();
1577 
1586  void snapToGeometry( const QgsPoint& startPoint,
1587  QgsFeatureId featureId,
1588  QgsGeometry* geom,
1589  double sqrSnappingTolerance,
1590  QMultiMap<double, QgsSnappingResult>& snappingResults,
1591  QgsSnapper::SnappingType snap_to ) const;
1592 
1594  //void addJoinedAttributes( QgsFeature& f, bool all = false );
1595 
1597  void readSldLabeling( const QDomNode& node );
1598 
1599  private: // Private attributes
1600 
1603 
1605  QString mDisplayField;
1606 
1609 
1611  QString mProviderKey;
1612 
1615 
1618 
1624 
1627 
1629  QMap< QString, QString > mAttributeAliasMap;
1630 
1632  QList< QgsAttributeEditorElement* > mAttributeEditorElements;
1633 
1635  QSet<QString> mExcludeAttributesWMS;
1637  QSet<QString> mExcludeAttributesWFS;
1638 
1640  QList< TabData > mTabs;
1641 
1644 
1647 
1650 
1653 
1655  bool mLabelOn;
1656 
1659 
1661  QPainter::CompositionMode mFeatureBlendMode;
1662 
1665 
1668 
1671 
1674 
1675  QStringList mCommitErrors;
1676 
1677  QMap< QString, EditType > mEditTypes;
1678  QMap< QString, bool> mFieldEditables;
1679  QMap< QString, bool> mLabelOnTop;
1680  QMap< QString, QMap<QString, QVariant> > mValueMaps;
1681  QMap< QString, RangeData > mRanges;
1682  QMap< QString, QPair<QString, QString> > mCheckedStates;
1683  QMap< QString, ValueRelationData > mValueRelations;
1684  QMap< QString, QString> mDateFormats;
1685  QMap< QString, QSize> mWidgetSize;
1686 
1687  QMap<int, QString> mEditorWidgetV2Types;
1688  QMap<int, QMap<QString, QVariant> > mEditorWidgetV2Configs;
1689 
1692 
1693  QString mEditForm, mEditFormInit;
1694 
1698 
1699  //annotation form for this layer
1701 
1704 
1708 
1709  //stores information about joined layers
1711 
1712  //diagram rendering object. 0 if diagram drawing is disabled
1714 
1715  //stores infos about diagram placement (placement type, priority, position distance)
1717 
1720 
1721  // Features in renderer classes counted
1723 
1724  // Feature counts for each renderer symbol
1725  QMap<QgsSymbolV2*, long> mSymbolFeatureCountMap;
1726 
1728 };
1729 
1730 #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:324
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:46
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.
The attribute value should not be changed in the attribute form.
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeature.h:326
QList< QgsFeature > QgsFeatureList
Definition: qgsfeature.h:331
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:130
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:164
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:135
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:114
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.
QMap< int, QString > mEditorWidgetV2Types
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
QMap< QString, QPair< QString, QString > > mCheckedStates
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:349
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
QMap< QString, RangeData > mRanges
QList< QString > mFields
A class to render labels.
Definition: qgslabel.h:52
QMap< QString, EditType > mEditTypes
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
QMap< QString, QSize > mWidgetSize
virtual QDomElement toDomElement(QDomDocument &doc) const =0
QSet< QString > mExcludeAttributesWMS
Attributes which are not published in WMS.
QMap< QString, ValueRelationData > mValueRelations
QHash< QString, QgsAttributes > cachedAttributes
Cache for joined attributes to provide fast lookup (size is 0 if no memory caching) ...
QMap< QString, QMap< QString, QVariant > > mValueMaps
QMap< QgsFeatureId, QgsAttributeMap > QgsChangedAttributesMap
Definition: qgsfeature.h:321
bool mLabelOn
Display labels.
QgsVectorLayerJoinBuffer * mJoinBuffer
GroupData(QString name, QList< QString > fields)
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...
QMap< QString, QString > mDateFormats
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
QMap< int, QMap< QString, QVariant > > mEditorWidgetV2Configs
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