[QGIS Commit] r14978 - in trunk/qgis: python/core src/core
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Mon Dec 27 16:27:01 EST 2010
Author: wonder
Date: 2010-12-27 13:27:01 -0800 (Mon, 27 Dec 2010)
New Revision: 14978
Modified:
trunk/qgis/python/core/qgsfeature.sip
trunk/qgis/python/core/qgsvectorlayer.sip
trunk/qgis/src/core/qgsvectorlayer.h
Log:
PyQGIS fixes: added few typedefs (IIRC they were not supported by some old SIP versions) and added missing signals in QgsVectorLayer
Modified: trunk/qgis/python/core/qgsfeature.sip
===================================================================
--- trunk/qgis/python/core/qgsfeature.sip 2010-12-27 17:12:10 UTC (rev 14977)
+++ trunk/qgis/python/core/qgsfeature.sip 2010-12-27 21:27:01 UTC (rev 14978)
@@ -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
Modified: trunk/qgis/python/core/qgsvectorlayer.sip
===================================================================
--- trunk/qgis/python/core/qgsvectorlayer.sip 2010-12-27 17:12:10 UTC (rev 14977)
+++ trunk/qgis/python/core/qgsvectorlayer.sip 2010-12-27 21:27:01 UTC (rev 14978)
@@ -1,3 +1,9 @@
+
+typedef QList<int> QgsAttributeList;
+typedef QSet<int> QgsFeatureIds;
+typedef QSet<int> QgsAttributeIds;
+
+
class QgsVectorLayer : QgsMapLayer
{
%TypeHeaderCode
@@ -574,6 +580,16 @@
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 */
Modified: trunk/qgis/src/core/qgsvectorlayer.h
===================================================================
--- trunk/qgis/src/core/qgsvectorlayer.h 2010-12-27 17:12:10 UTC (rev 14977)
+++ trunk/qgis/src/core/qgsvectorlayer.h 2010-12-27 21:27:01 UTC (rev 14978)
@@ -629,7 +629,8 @@
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 );
More information about the QGIS-commit
mailing list