Skip to content

Commit 00a43bc

Browse files
author
wonder
committedMar 24, 2007
QgsFeatureAttribute class has been removed and QVariant is used instead (supports arbitrary data types).
All providers and python bindings have been updated accordingly. Currently supported variant types by providers are String, Int and Double. Other API changes: - QgsField - type info as QString is now typeName() and setTypeName() - added variant type (QVariant::Type) info: type(), setType() - QgsFeature - removed fields() - use QgsVectorDataProvider::fields() - removed boundingBox() - use QgsGeometry::boundingBox() - QgsVectorLayer - removed fields(), fieldCount(), getDefaultValue() - use directly QgsVectorDataProvider - QgsVectorDataProvider - getDefaultValue() - field now addressed by id, returns variant - QgsLabel - setLabelField() - field now addressed by id git-svn-id: http://svn.osgeo.org/qgis/trunk@6833 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 39f11cf commit 00a43bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+727
-2146
lines changed
 

‎python/core/core.sip

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
%Include qgsdatasourceuri.sip
1717
%Include qgsdistancearea.sip
1818
%Include qgsfeature.sip
19-
%Include qgsfeatureattribute.sip
2019
%Include qgsfield.sip
2120
%Include qgsgeometry.sip
2221
%Include qgsgeometryvertexindex.sip

‎python/core/qgsfeature.sip

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class QgsFeature
2222
want a copy of the "current" feature, not the on-disk feature.
2323
*/
2424
QgsFeature( const QgsFeature & rhs,
25-
const QMap<int, QMap<int, QgsFeatureAttribute> >& changedAttributes,
25+
const QMap<int, QMap<int, QVariant> >& changedAttributes,
2626
const QMap<int, QgsGeometry> & changedGeometries );
2727

2828
/** copy ctor needed due to internal pointer */
@@ -58,26 +58,20 @@ class QgsFeature
5858
* Get the attributes for this feature.
5959
* @return A std::map containing the field name/value mapping
6060
*/
61-
const QMap<int, QgsFeatureAttribute> & attributeMap() const;
61+
const QMap<int, QVariant> & attributeMap() const;
6262

6363
/**
6464
* Add an attribute to the map
6565
*/
66-
void addAttribute(int field, QgsFeatureAttribute attr);
66+
void addAttribute(int field, QVariant attr);
6767

6868
/**Deletes an attribute and its value*/
6969
void deleteAttribute(int field);
7070

7171
/**Changes an existing attribute value
7272
@param field index of the field
7373
@param attr attribute name and value to be set */
74-
void changeAttribute(int field, QgsFeatureAttribute attr);
75-
76-
/**
77-
* Get the fields for this feature
78-
* @return A std::map containing field position (index) and field name
79-
*/
80-
QMap<int, QString> fields() const;
74+
void changeAttribute(int field, QVariant attr);
8175

8276
/**
8377
* Return the validity of this feature. This is normally set by
@@ -125,9 +119,6 @@ class QgsFeature
125119
*/
126120
void setGeometryAndOwnership(unsigned char * geom, size_t length);
127121

128-
/**Returns the bounding box of this feature*/
129-
QgsRect boundingBox() const;
130-
131122

132123
}; // class QgsFeature
133124

0 commit comments

Comments
 (0)
Please sign in to comment.