From 20e274a41394dc74350f0ef4e91dadc7f1d10025 Mon Sep 17 00:00:00 2001 From: Nathan Woodrow Date: Sat, 3 Aug 2013 22:42:13 +1000 Subject: [PATCH] Add __iter__ for QgsFeature --- python/core/qgsfeature.sip | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/core/qgsfeature.sip b/python/core/qgsfeature.sip index 7cdaa295ff9..036e7c7cf9d 100644 --- a/python/core/qgsfeature.sip +++ b/python/core/qgsfeature.sip @@ -116,6 +116,12 @@ class QgsFeature public: + SIP_PYOBJECT __iter__(); +%MethodCode + PyObject *attrs = sipConvertFromType( &sipCpp->attributes(), sipType_QgsAttributes, Py_None ); + sipRes = PyObject_GetIter(attrs); +%End + SIP_PYOBJECT __getitem__(int key); %MethodCode const QgsAttributes& attrs = sipCpp->attributes();