Skip to content

Commit eebdb43

Browse files
author
wonder
committed
PyQGIS fixes: added few typedefs (IIRC they were not supported by some 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
1 parent 3d7ecc7 commit eebdb43

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

python/core/qgsfeature.sip

+15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11

22

3+
// key = field index, value = field value
4+
typedef QMap<int, QVariant> QgsAttributeMap;
5+
6+
// key = feature id, value = changed attributes
7+
typedef QMap<int, QMap<int, QVariant> > QgsChangedAttributesMap;
8+
9+
// key = feature id, value = changed geometry
10+
typedef QMap<int, QgsGeometry> QgsGeometryMap;
11+
12+
// key = field index, value = field name
13+
typedef QMap<int, QString> QgsFieldNameMap;
14+
15+
typedef QList<QgsFeature> QgsFeatureList;
16+
17+
318
class QgsFeature
419
{
520
%TypeHeaderCode

python/core/qgsvectorlayer.sip

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2+
typedef QList<int> QgsAttributeList;
3+
typedef QSet<int> QgsFeatureIds;
4+
typedef QSet<int> QgsAttributeIds;
5+
6+
17
class QgsVectorLayer : QgsMapLayer
28
{
39
%TypeHeaderCode
@@ -574,6 +580,16 @@ signals:
574580

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

583+
/** Signals emitted after committing changes
584+
\note added in v1.6 */
585+
void committedAttributesDeleted( const QString& layerId, const QgsAttributeIds& deletedAttributeIds );
586+
void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
587+
void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );
588+
void committedFeaturesRemoved( const QString& layerId, const QgsFeatureIds& deletedFeatureIds );
589+
void committedAttributeValuesChanges( const QString& layerId, const QgsChangedAttributesMap& changedAttributesValues );
590+
void committedGeometriesChanges( const QString& layerId, const QgsGeometryMap& changedGeometries );
591+
592+
577593
private: // Private methods
578594

579595
/** vector layers are not copyable */

src/core/qgsvectorlayer.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,8 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
629629

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

632-
/** Signals emitted after committing changes */
632+
/** Signals emitted after committing changes
633+
\note added in v1.6 */
633634
void committedAttributesDeleted( const QString& layerId, const QgsAttributeIds& deletedAttributeIds );
634635
void committedAttributesAdded( const QString& layerId, const QList<QgsField>& addedAttributes );
635636
void committedFeaturesAdded( const QString& layerId, const QgsFeatureList& addedFeatures );

0 commit comments

Comments
 (0)