Skip to content

Commit

Permalink
PyQGIS fixes: added few typedefs (IIRC they were not supported by som…
Browse files Browse the repository at this point in the history
…e old SIP versions) and added missing signals in QgsVectorLayer

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14978 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Dec 27, 2010
1 parent 3d7ecc7 commit eebdb43
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
15 changes: 15 additions & 0 deletions python/core/qgsfeature.sip
@@ -1,5 +1,20 @@


// key = field index, value = field value
typedef QMap<int, QVariant> QgsAttributeMap;

// key = feature id, value = changed attributes
typedef QMap<int, QMap<int, QVariant> > QgsChangedAttributesMap;

// key = feature id, value = changed geometry
typedef QMap<int, QgsGeometry> QgsGeometryMap;

// key = field index, value = field name
typedef QMap<int, QString> QgsFieldNameMap;

typedef QList<QgsFeature> QgsFeatureList;


class QgsFeature
{
%TypeHeaderCode
Expand Down
16 changes: 16 additions & 0 deletions python/core/qgsvectorlayer.sip
@@ -1,3 +1,9 @@

typedef QList<int> QgsAttributeList;
typedef QSet<int> QgsFeatureIds;
typedef QSet<int> QgsAttributeIds;


class QgsVectorLayer : QgsMapLayer
{
%TypeHeaderCode
Expand Down Expand Up @@ -574,6 +580,16 @@ signals:

void attributeValueChanged(int fid, int idx, const QVariant &);

/** Signals emitted after committing changes
\note added in v1.6 */
void committedAttributesDeleted( const QString& layerId, const QgsAttributeIds& deletedAttributeIds );
void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );
void committedFeaturesRemoved( const QString& layerId, const QgsFeatureIds& deletedFeatureIds );
void committedAttributeValuesChanges( const QString& layerId, const QgsChangedAttributesMap& changedAttributesValues );
void committedGeometriesChanges( const QString& layerId, const QgsGeometryMap& changedGeometries );


private: // Private methods

/** vector layers are not copyable */
Expand Down
3 changes: 2 additions & 1 deletion src/core/qgsvectorlayer.h
Expand Up @@ -629,7 +629,8 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer

void attributeValueChanged( int fid, int idx, const QVariant & );

/** Signals emitted after committing changes */
/** Signals emitted after committing changes
\note added in v1.6 */
void committedAttributesDeleted( const QString& layerId, const QgsAttributeIds& deletedAttributeIds );
void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );
Expand Down

0 comments on commit eebdb43

Please sign in to comment.