mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
QgsVectorLayer: - move attribute part of editing to vector layer class and unify with geometry handling: * remove commitAttributeChanges(), addedFeatures(), deletedFeatureIds(), changedAttributes() and replace with changeAttributeValue(), deleteFeature(), addAttribute() and deleteAttribute() * add pendingFields(), pendingAttributeList(), pendingFeatureCount() * emit signals on start editing and commit, change of attribute values, adding/deleting of attributes and layer or feature removal (currently used in the attribute table) - new commitErrors() method to query errors from commitChanges() - replaced featuresInRectangle with select/getNextFeature combo - edit types added to support more input widgets and input constraints QgsFeature: - remove update aware ctor - unify geometry handling in ctors QgsVectorDataProvider: - add QVariant::Type to supportNativeTypes() QgisApp: - add instance() method to query QgisApp object - replace code at various place to use it instead of passing the pointer arround or searching it in the widget tree. - move toggleEditing() code from the legend here QgsAttributeTable/QgsAttributeTableDisplay: - move attribute table creation legend here - make attribute table dockable (from Tim) - most editing logic moved to QgsVectorLayer - adding/deleting attributes moved to QgsVectorLayerProperties QgsIdentifyResults: - add support for attribute editing when it edit mode QgsVectorLayerProperties: add a new tab to show attribute list: * start/stop editing * add/delete attributes * assign edit type to attributes (unique values, value map, ranges) QgsAttributeDialog: add support for attribute edit types: * selection from unique value render classes (combobox) * selection from unique values of existing features (combobox or line edits with completion) * spinboxes for ranges QgsPostgresProvider: - use read-only connection for cursors and read-write connection for updates - updated native types QgsOgrProvider: - remove unused references to GEOS geometry factory - updated native types git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9092 c8812cc2-4d05-0410-92ff-de0c093fc19c
121 lines
2.9 KiB
Plaintext
121 lines
2.9 KiB
Plaintext
|
|
|
|
class QgsFeature
|
|
{
|
|
%TypeHeaderCode
|
|
#include <qgsfeature.h>
|
|
%End
|
|
|
|
public:
|
|
|
|
typedef unsigned int size_t;
|
|
|
|
//! Constructor
|
|
QgsFeature(int id = 0, QString typeName = "" );
|
|
|
|
/** copy ctor needed due to internal pointer */
|
|
QgsFeature(const QgsFeature & rhs );
|
|
|
|
//! Destructor
|
|
~QgsFeature();
|
|
|
|
|
|
/**
|
|
* Get the feature id for this feature
|
|
* @return Feature id
|
|
*/
|
|
int featureId() const;
|
|
|
|
/**
|
|
* Set the feature id for this feature
|
|
* @param id Feature id
|
|
*/
|
|
void setFeatureId(int id);
|
|
|
|
|
|
/** returns the feature's type name
|
|
*/
|
|
QString typeName() const;
|
|
|
|
|
|
/** sets the feature's type name
|
|
*/
|
|
void setTypeName(QString typeName);
|
|
|
|
/**
|
|
* Get the attributes for this feature.
|
|
* @return A std::map containing the field name/value mapping
|
|
*/
|
|
const QMap<int, QVariant> & attributeMap() const;
|
|
|
|
|
|
/**Sets all the attributes in one go*/
|
|
void setAttributeMap(const QMap<int, QVariant> & attributeMap);
|
|
|
|
/**
|
|
* Add an attribute to the map
|
|
*/
|
|
void addAttribute(int field, QVariant attr);
|
|
|
|
/**Deletes an attribute and its value*/
|
|
void deleteAttribute(int field);
|
|
|
|
/**Changes an existing attribute value
|
|
@param field index of the field
|
|
@param attr attribute name and value to be set */
|
|
void changeAttribute(int field, QVariant attr);
|
|
|
|
/**
|
|
* Return the validity of this feature. This is normally set by
|
|
* the provider to indicate some problem that makes the feature
|
|
* invalid or to indicate a null feature.
|
|
*/
|
|
bool isValid() const;
|
|
|
|
/**
|
|
* Set the validity of the feature.
|
|
*/
|
|
void setValid(bool validity);
|
|
|
|
/**
|
|
* Return the dirty state of this feature.
|
|
* Dirty is set if (e.g.) the feature's geometry has been modified in-memory.
|
|
*/
|
|
bool isDirty() const;
|
|
|
|
/**
|
|
* Reset the dirtiness of the feature. (i.e. make clean)
|
|
* You would normally do this after it's saved to permanent storage (e.g. disk, an ACID-compliant database)
|
|
*/
|
|
void resetDirty();
|
|
|
|
/**
|
|
* Get the geometry object associated with this feature
|
|
*/
|
|
QgsGeometry * geometry();
|
|
|
|
/**
|
|
* Get the geometry object associated with this feature
|
|
* The caller assumes responsibility for the QgsGeometry*'s destruction.
|
|
*/
|
|
QgsGeometry * geometryAndOwnership() /Factory/;
|
|
|
|
/** Set this feature's geometry from another QgsGeometry object (deep copy)
|
|
*/
|
|
void setGeometry(const QgsGeometry& geom);
|
|
|
|
/** Set this feature's geometry (takes geometry ownership)
|
|
*/
|
|
void setGeometry(QgsGeometry* geom);
|
|
|
|
/**
|
|
* Set this feature's geometry from WKB
|
|
*
|
|
* This feature assumes responsibility for destroying geom.
|
|
*/
|
|
void setGeometryAndOwnership(unsigned char * geom /Transfer/, size_t length);
|
|
|
|
|
|
}; // class QgsFeature
|
|
|