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 
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 
68 class CORE_EXPORT QgsAttributeEditorElement : public QObject
69 {
70  Q_OBJECT
71  public:
72 
74  {
78  AeTypeInvalid
79  };
80 
81  QgsAttributeEditorElement( AttributeEditorType type, QString name, QObject *parent = NULL )
82  : QObject( parent ), mType( type ), mName( name ) {}
83 
85 
86  QString name() const { return mName; }
87  AttributeEditorType type() const { return mType; }
88 
89  virtual QDomElement toDomElement( QDomDocument& doc ) const = 0;
90 
91  protected:
93  QString mName;
94 };
95 
98 {
99  public:
100  QgsAttributeEditorContainer( QString name, QObject *parent )
101  : QgsAttributeEditorElement( AeTypeContainer, name, parent )
102  , mIsGroupBox( true )
103  {}
104 
106 
107  virtual QDomElement toDomElement( QDomDocument& doc ) const;
108  virtual void addChildElement( QgsAttributeEditorElement *widget );
109  virtual void setIsGroupBox( bool isGroupBox ) { mIsGroupBox = isGroupBox; }
110  virtual bool isGroupBox() const { return mIsGroupBox; }
111  QList<QgsAttributeEditorElement*> children() const { return mChildren; }
112  virtual QList<QgsAttributeEditorElement*> findElements( AttributeEditorType type ) const;
113 
114  private:
116  QList<QgsAttributeEditorElement*> mChildren;
117 };
118 
121 {
122  public:
123  QgsAttributeEditorField( QString name , int idx, QObject *parent )
124  : QgsAttributeEditorElement( AeTypeField, name, parent ), mIdx( idx ) {}
125 
127 
128  virtual QDomElement toDomElement( QDomDocument& doc ) const;
129  int idx() const { return mIdx; }
130 
131  private:
132  int mIdx;
133 };
134 
137 {
138  public:
139  QgsAttributeEditorRelation( QString name, const QString &relationId, QObject *parent )
140  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
141  , mRelationId( relationId ) {}
142 
143  QgsAttributeEditorRelation( QString name, const QgsRelation& relation, QObject *parent )
144  : QgsAttributeEditorElement( AeTypeRelation, name, parent )
145  , mRelationId( relation.id() )
146  , mRelation( relation ) {}
147 
149 
150  virtual QDomElement toDomElement( QDomDocument& doc ) const;
151  const QgsRelation& relation() const { return mRelation; }
152 
159  bool init( QgsRelationManager *relManager );
160 
161  private:
162  QString mRelationId;
164 };
165 
167 struct CORE_EXPORT QgsVectorJoinInfo
168 {
172  QString joinLayerId;
174  QString joinFieldName;
180  QHash< QString, QgsAttributes> cachedAttributes;
181 
186 };
187 
450 class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
451 {
452  Q_OBJECT
453 
454  public:
457  {
458  GeneratedLayout = 0,
459  TabLayout = 1,
460  UiFileLayout = 2
461  };
462 
466  enum EditType
467  {
489  };
490 
494  {
495  SuppressDefault = 0, // use the application-wide setting
496  SuppressOn = 1,
497  SuppressOff = 2
498  };
499 
500  struct RangeData
501  {
502  RangeData() { mMin = QVariant( 0 ); mMax = QVariant( 5 ); mStep = QVariant( 1 );}
503  RangeData( QVariant theMin, QVariant theMax, QVariant theStep )
504  : mMin( theMin ), mMax( theMax ), mStep( theStep ) {}
505 
506  QVariant mMin;
507  QVariant mMax;
508  QVariant mStep;
509  };
510 
512  {
514  ValueRelationData( QString layer, QString key, QString value, bool allowNull, bool orderByValue,
515  bool allowMulti = false,
516  QString filterExpression = QString::null )
517  : mLayer( layer )
518  , mKey( key )
519  , mValue( value )
520  , mFilterExpression( filterExpression )
521  , mAllowNull( allowNull )
522  , mOrderByValue( orderByValue )
523  , mAllowMulti( allowMulti )
524  {}
525 
526  QString mLayer;
527  QString mKey;
528  QString mValue;
532  bool mAllowMulti; /* allow selection of multiple keys @added in 1.9 */
533  };
534 
535  struct GroupData
536  {
538  GroupData( QString name , QList<QString> fields )
539  : mName( name ), mFields( fields ) {}
540  QString mName;
541  QList<QString> mFields;
542  };
543 
544  struct TabData
545  {
546  TabData() {}
547  TabData( QString name , QList<QString> fields , QList<GroupData> groups )
548  : mName( name ), mFields( fields ), mGroups( groups ) {}
549  QString mName;
550  QList<QString> mFields;
551  QList<GroupData> mGroups;
552  };
553 
567  QgsVectorLayer( QString path = QString::null, QString baseName = QString::null,
568  QString providerLib = QString::null, bool loadDefaultStyleFlag = true );
569 
571  virtual ~QgsVectorLayer();
572 
574  QString storageType() const;
575 
577  QString capabilitiesString() const;
578 
580  QString dataComment() const;
581 
583  void setDisplayField( QString fldName = "" );
584 
586  const QString displayField() const;
587 
595  void setDisplayExpression( const QString &displayExpression );
596 
605  const QString displayExpression();
606 
608  QgsVectorDataProvider* dataProvider();
609 
613  const QgsVectorDataProvider* dataProvider() const;
614 
616  void setProviderEncoding( const QString& encoding );
617 
619  void setCoordinateSystem();
620 
624  void addJoin( const QgsVectorJoinInfo& joinInfo );
625 
628  void removeJoin( const QString& joinLayerId );
629 
631  const QList< QgsVectorJoinInfo >& vectorJoins() const;
632 
640  void addExpressionField( const QString& exp, const QgsField& fld );
641 
649  void removeExpressionField( int index );
650 
652  QgsLabel *label();
653 
654  const QgsLabel *label() const;
655 
656  QgsAttributeAction *actions() { return mActions; }
657 
663  int selectedFeatureCount();
664 
673  void select( QgsRectangle & rect, bool addToSelection );
674 
686  void modifySelection( QgsFeatureIds selectIds, QgsFeatureIds deselectIds );
687 
689  void invertSelection();
690 
692  void selectAll();
693 
695  QgsFeatureIds allFeatureIds();
696 
704  void invertSelectionInRectangle( QgsRectangle & rect );
705 
713  QgsFeatureList selectedFeatures();
714 
721  const QgsFeatureIds &selectedFeaturesIds() const;
722 
730  void setSelectedFeatures( const QgsFeatureIds &ids );
731 
733  QgsRectangle boundingBoxOfSelected();
734 
736  void setDiagramRenderer( QgsDiagramRendererV2* r );
737  const QgsDiagramRendererV2* diagramRenderer() const { return mDiagramRenderer; }
738 
739  void setDiagramLayerSettings( const QgsDiagramLayerSettings& s );
740  const QgsDiagramLayerSettings *diagramLayerSettings() const { return mDiagramLayerSettings; }
741 
744  QgsFeatureRendererV2* rendererV2();
748  void setRendererV2( QgsFeatureRendererV2* r );
749 
751  QGis::GeometryType geometryType() const;
752 
756  bool hasGeometryType() const;
757 
759  QGis::WkbType wkbType() const;
760 
762  QString providerType() const;
763 
767  virtual bool readXml( const QDomNode& layer_node );
768 
772  virtual bool writeXml( QDomNode & layer_node, QDomDocument & doc );
773 
782  virtual void saveStyleToDatabase( QString name, QString description,
783  bool useAsDefault, QString uiFileContent,
784  QString &msgError );
785 
794  virtual int listStylesInDatabase( QStringList &ids, QStringList &names,
795  QStringList &descriptions, QString &msgError );
796 
800  virtual QString getStyleFromDatabase( QString styleId, QString &msgError );
801 
808  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag, bool loadFromLocalDb );
809 
814  virtual QString loadNamedStyle( const QString &theURI, bool &theResultFlag );
815 
816  virtual bool applyNamedStyle( QString namedStyle , QString errorMsg );
817 
822  QgsAttributeEditorElement* attributeEditorElementFromDomElement( QDomElement &elem, QObject* parent );
823 
829  bool readSymbology( const QDomNode& node, QString& errorMessage );
830 
837  bool writeSymbology( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
838 
839  bool writeSld( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;
840  bool readSld( const QDomNode& node, QString& errorMessage );
841 
849  virtual long featureCount() const;
850 
857  long featureCount( QgsSymbolV2* symbol );
858 
864  bool countSymbolFeatures( bool showProgress = true );
865 
873  virtual bool setSubsetString( QString subset );
874 
879  virtual QString subsetString();
880 
884  QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() );
885 
891  bool addFeature( QgsFeature& f, bool alsoUpdateExtent = true );
892 
900  bool updateFeature( QgsFeature &f );
901 
906  bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
907 
912  bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
913 
916  bool deleteVertex( QgsFeatureId atFeatureId, int atVertex );
917 
921  bool deleteSelectedFeatures();
922 
932  int addRing( const QList<QgsPoint>& ring );
933 
944  int addPart( const QList<QgsPoint>& ring );
945 
951  int translateFeature( QgsFeatureId featureId, double dx, double dy );
952 
960  int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
961 
969  int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );
970 
979  Q_DECL_DEPRECATED int removePolygonIntersections( QgsGeometry* geom, QgsFeatureIds ignoreFeatures = QgsFeatureIds() );
980 
986  int addTopologicalPoints( QgsGeometry* geom );
987 
995  int addTopologicalPoints( const QgsPoint& p );
996 
1002  int insertSegmentVerticesForSnap( const QList<QgsSnappingResult>& snapResults );
1003 
1005  void enableLabels( bool on );
1006 
1008  bool hasLabelsEnabled() const;
1009 
1011  virtual bool isEditable() const;
1012 
1016  virtual bool isReadOnly() const;
1017 
1019  virtual bool isModified() const;
1020 
1027  bool snapPoint( QgsPoint& point, double tolerance );
1028 
1036  int snapWithContext( const QgsPoint& startPoint,
1037  double snappingTolerance,
1038  QMultiMap < double, QgsSnappingResult > &snappingResults,
1039  QgsSnapper::SnappingType snap_to );
1040 
1043  virtual void reload();
1044 
1048  virtual QgsMapLayerRenderer* createMapRenderer( QgsRenderContext& rendererContext );
1049 
1053  bool draw( QgsRenderContext& rendererContext );
1054 
1056  void drawLabels( QgsRenderContext& rendererContext );
1057 
1059  QgsRectangle extent();
1060 
1062  const QgsFields &pendingFields() const;
1063 
1065  QgsAttributeList pendingAllAttributesList();
1066 
1070  QgsAttributeList pendingPkAttributesList();
1071 
1073  int pendingFeatureCount();
1074 
1079  bool setReadOnly( bool readonly = true );
1080 
1082  bool startEditing();
1083 
1086  bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom );
1087 
1094  Q_DECL_DEPRECATED bool changeAttributeValue( QgsFeatureId fid, int field, QVariant value, bool emitSignal );
1095 
1106  bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant() );
1107 
1111  bool addAttribute( const QgsField &field );
1112 
1117  void addAttributeAlias( int attIndex, QString aliasString );
1118 
1123  void addAttributeEditorWidget( QgsAttributeEditorElement* data );
1124 
1132  const QString editorWidgetV2( int fieldIdx ) const;
1133 
1143  const QString editorWidgetV2( const QString& fieldName ) const;
1144 
1152  const QgsEditorWidgetConfig editorWidgetV2Config( int fieldIdx ) const;
1153 
1163  const QgsEditorWidgetConfig editorWidgetV2Config( const QString& fieldName ) const;
1164 
1169  QList< QgsAttributeEditorElement* > &attributeEditorElements();
1174  void clearAttributeEditorWidgets();
1175 
1180  QString attributeAlias( int attributeIndex ) const;
1181 
1186  QString attributeDisplayName( int attributeIndex ) const;
1187 
1188  const QMap< QString, QString >& attributeAliases() const { return mAttributeAliasMap; }
1189 
1190  const QSet<QString>& excludeAttributesWMS() const { return mExcludeAttributesWMS; }
1191  void setExcludeAttributesWMS( const QSet<QString>& att ) { mExcludeAttributesWMS = att; }
1192 
1193  const QSet<QString>& excludeAttributesWFS() const { return mExcludeAttributesWFS; }
1194  void setExcludeAttributesWFS( const QSet<QString>& att ) { mExcludeAttributesWFS = att; }
1195 
1197  bool deleteAttribute( int attr );
1198 
1206  bool deleteAttributes( QList<int> attrs );
1207 
1209  bool addFeatures( QgsFeatureList features, bool makeSelected = true );
1210 
1212  bool deleteFeature( QgsFeatureId fid );
1213 
1229  bool commitChanges();
1230  const QStringList &commitErrors();
1231 
1235  bool rollBack( bool deleteBuffer = true );
1236 
1242  Q_DECL_DEPRECATED EditType editType( int idx );
1243 
1249  Q_DECL_DEPRECATED void setEditType( int idx, EditType edit );
1250 
1252  EditorLayout editorLayout();
1253 
1255  void setEditorLayout( EditorLayout editorLayout );
1256 
1263  void setEditorWidgetV2( int attrIdx, const QString& widgetType );
1264 
1271  void setEditorWidgetV2Config( int attrIdx, const QgsEditorWidgetConfig& config );
1272 
1278  Q_DECL_DEPRECATED void setCheckedState( int idx, QString checked, QString notChecked );
1279 
1281  QString editForm();
1282 
1284  void setEditForm( QString ui );
1285 
1288  QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const { return mFeatureFormSuppress; }
1289 
1292  void setFeatureFormSuppress( QgsVectorLayer::FeatureFormSuppress s ) { mFeatureFormSuppress = s; }
1293 
1295  QString annotationForm() const { return mAnnotationForm; }
1296 
1298  void setAnnotationForm( const QString& ui );
1299 
1301  QString editFormInit();
1302 
1304  void setEditFormInit( QString function );
1305 
1310  Q_DECL_DEPRECATED QMap<QString, QVariant> valueMap( int idx );
1311 
1317  Q_DECL_DEPRECATED RangeData range( int idx );
1318 
1324  ValueRelationData valueRelation( int idx );
1325 
1332  QList<QgsRelation> referencingRelations( int idx );
1333 
1341  Q_DECL_DEPRECATED QString dateFormat( int idx );
1342 
1350  Q_DECL_DEPRECATED QSize widgetSize( int idx );
1351 
1355  bool fieldEditable( int idx );
1356 
1360  bool labelOnTop( int idx );
1361 
1365  void setFieldEditable( int idx, bool editable );
1366 
1370  void setLabelOnTop( int idx, bool onTop );
1371 
1373  QgsVectorLayerEditBuffer* editBuffer() { return mEditBuffer; }
1374 
1379  void beginEditCommand( QString text );
1380 
1382  void endEditCommand();
1383 
1385  void destroyEditCommand();
1386 
1390  int fieldNameIndex( const QString& fieldName ) const;
1391 
1395  {
1398  NoMarker /* added in version 1.1 */
1399  };
1400 
1403  static void drawVertexMarker( double x, double y, QPainter& p, QgsVectorLayer::VertexMarkerType type, int vertexSize );
1404 
1407  void updateFields();
1408 
1411  void createJoinCaches();
1412 
1418  void uniqueValues( int index, QList<QVariant> &uniqueValues, int limit = -1 );
1419 
1422  QVariant minimumValue( int index );
1423 
1426  QVariant maximumValue( int index );
1427 
1428  /* Set the blending mode used for rendering each feature
1429  * @note added in 2.0
1430  */
1431  void setFeatureBlendMode( const QPainter::CompositionMode &blendMode );
1432  /* Returns the current blending mode for features
1433  * @note added in 2.0
1434  */
1435  QPainter::CompositionMode featureBlendMode() const;
1436 
1437  /* Set the transparency for the vector layer
1438  * @note added in 2.0
1439  */
1440  void setLayerTransparency( int layerTransparency );
1441  /* Returns the current transparency for the vector layer
1442  * @note added in 2.0
1443  */
1444  int layerTransparency() const;
1445 
1446  QString metadata();
1447 
1449  inline QgsGeometryCache* cache() { return mCache; }
1450 
1454  void setSimplifyMethod( const QgsVectorSimplifyMethod& simplifyMethod ) { mSimplifyMethod = simplifyMethod; }
1458  inline const QgsVectorSimplifyMethod& simplifyMethod() const { return mSimplifyMethod; }
1459 
1464  bool simplifyDrawingCanbeApplied( const QgsRenderContext& renderContext, QgsVectorSimplifyMethod::SimplifyHint simplifyHint ) const;
1465 
1466  public slots:
1474  void select( const QgsFeatureId &featureId );
1475 
1483  void select( const QgsFeatureIds& featureIds );
1484 
1492  void deselect( const QgsFeatureId featureId );
1493 
1501  void deselect( const QgsFeatureIds& featureIds );
1502 
1508  void removeSelection();
1509 
1510  void triggerRepaint();
1511 
1515  virtual void updateExtents();
1516 
1519  void checkJoinLayerRemove( QString theLayerId );
1520 
1521  protected slots:
1522  void invalidateSymbolCountedFlag();
1523 
1524  signals:
1525 
1533  void selectionChanged( const QgsFeatureIds selected, const QgsFeatureIds deselected, const bool clearAndSelect );
1534 
1536  void selectionChanged();
1537 
1539  void layerModified();
1540 
1542  void beforeModifiedCheck() const;
1543 
1545  void editingStarted();
1546 
1548  void editingStopped();
1549 
1551  void beforeCommitChanges();
1552 
1554  void beforeRollBack();
1555 
1564  void attributeAdded( int idx );
1573  void attributeDeleted( int idx );
1574  void featureAdded( QgsFeatureId fid ); // added in 1.7
1575  void featureDeleted( QgsFeatureId fid );
1582  void updatedFields();
1583  void layerDeleted();
1584 
1585  void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant & );
1586  void geometryChanged( QgsFeatureId fid, QgsGeometry &geom ); // added in 1.9
1587 
1590  void committedAttributesDeleted( const QString& layerId, const QgsAttributeList& deletedAttributes );
1591  void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
1592  void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );
1593  void committedFeaturesRemoved( const QString& layerId, const QgsFeatureIds& deletedFeatureIds );
1594  void committedAttributeValuesChanges( const QString& layerId, const QgsChangedAttributesMap& changedAttributesValues );
1595  void committedGeometriesChanges( const QString& layerId, const QgsGeometryMap& changedGeometries );
1596 
1597  void saveLayerToProject();
1598 
1602  void labelingFontNotFound( QgsVectorLayer* layer, const QString& fontfamily );
1603 
1605  void featureBlendModeChanged( const QPainter::CompositionMode &blendMode );
1606 
1608  void layerTransparencyChanged( int layerTransparency );
1609 
1615  void editCommandStarted( const QString& text );
1616 
1622  void editCommandEnded();
1623 
1629  void editCommandDestroyed();
1630 
1631  private slots:
1632  void onRelationsLoaded();
1633 
1634  protected:
1636  void setExtent( const QgsRectangle &rect );
1637 
1638  private: // Private methods
1639 
1641  QgsVectorLayer( const QgsVectorLayer & rhs );
1642 
1644  QgsVectorLayer & operator=( QgsVectorLayer const & rhs );
1645 
1650  bool setDataProvider( QString const & provider );
1651 
1653  QgsFeatureId findFreeId();
1654 
1663  void snapToGeometry( const QgsPoint& startPoint,
1664  QgsFeatureId featureId,
1665  QgsGeometry* geom,
1666  double sqrSnappingTolerance,
1667  QMultiMap<double, QgsSnappingResult>& snappingResults,
1668  QgsSnapper::SnappingType snap_to ) const;
1669 
1671  //void addJoinedAttributes( QgsFeature& f, bool all = false );
1672 
1674  void readSldLabeling( const QDomNode& node );
1675 
1676  private: // Private attributes
1677 
1680 
1682  QString mDisplayField;
1683 
1686 
1688  QString mProviderKey;
1689 
1692 
1695 
1701 
1704 
1706  QMap< QString, QString > mAttributeAliasMap;
1707 
1709  QList< QgsAttributeEditorElement* > mAttributeEditorElements;
1710 
1712  QSet<QString> mExcludeAttributesWMS;
1714  QSet<QString> mExcludeAttributesWFS;
1715 
1717  QList< TabData > mTabs;
1718 
1721 
1724 
1727 
1730 
1732  bool mLabelOn;
1733 
1736 
1738  QPainter::CompositionMode mFeatureBlendMode;
1739 
1742 
1745 
1748 
1751 
1752  QStringList mCommitErrors;
1753 
1754  QMap< QString, bool> mFieldEditables;
1755  QMap< QString, bool> mLabelOnTop;
1756 
1757  QMap<QString, QString> mEditorWidgetV2Types;
1758  QMap<QString, QgsEditorWidgetConfig > mEditorWidgetV2Configs;
1759 
1762 
1763  QString mEditForm, mEditFormInit;
1764 
1768 
1769  //annotation form for this layer
1771 
1774 
1778 
1779  //stores information about joined layers
1781 
1784 
1785  //diagram rendering object. 0 if diagram drawing is disabled
1787 
1788  //stores infos about diagram placement (placement type, priority, position distance)
1790 
1793 
1794  // Features in renderer classes counted
1796 
1797  // Feature counts for each renderer symbol
1798  QMap<QgsSymbolV2*, long> mSymbolFeatureCountMap;
1799 
1801 };
1802 
1803 #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:163
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
QgsExpressionFieldBuffer * mExpressionFieldBuffer
stores information about expression fields on this layer
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:33
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
Buffers information about expression fields for a vector layer.
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