|
QGIS API Documentation
2.12.0-Lyon
|
Container of fields for a vector layer. More...
#include <qgsfield.h>
Classes | |
| struct | Field |
Public Types | |
| typedef struct QgsFields::Field | Field |
| enum | FieldOrigin { OriginUnknown, OriginProvider, OriginJoin, OriginEdit, OriginExpression } |
Public Member Functions | |
| QgsFields () | |
| Constructor for an empty field container. More... | |
| QgsFields (const QgsFields &other) | |
| Copy constructor. More... | |
| virtual | ~QgsFields () |
| QgsAttributeList | allAttributesList () const |
| Utility function to get list of attribute indexes. More... | |
| bool | append (const QgsField &field, FieldOrigin origin=OriginProvider, int originIndex=-1) |
| Append a field. The field must have unique name, otherwise it is rejected (returns false) More... | |
| bool | appendExpressionField (const QgsField &field, int originIndex) |
| Append an expression field. The field must have unique name, otherwise it is rejected (returns false) More... | |
| const QgsField & | at (int i) const |
| Get field at particular index (must be in range 0..N-1) More... | |
| void | clear () |
| Remove all fields. More... | |
| int | count () const |
| Return number of items. More... | |
| bool | exists (int i) const |
| Return if a field index is valid. More... | |
| void | extend (const QgsFields &other) |
| Extend with fields from another QgsFields container. More... | |
| const QgsField & | field (int fieldIdx) const |
| Get field at particular index (must be in range 0..N-1) More... | |
| const QgsField & | field (const QString &name) const |
| Get field at particular index (must be in range 0..N-1) More... | |
| int | fieldNameIndex (const QString &fieldName) const |
| Look up field's index from name also looks up case-insensitive if there is no match otherwise. More... | |
| FieldOrigin | fieldOrigin (int fieldIdx) const |
| Get field's origin (value from an enumeration) More... | |
| int | fieldOriginIndex (int fieldIdx) const |
| Get field's origin index (its meaning is specific to each type of origin) More... | |
| int | indexFromName (const QString &name) const |
| Look up field's index from name. Returns -1 on error. More... | |
| bool | isEmpty () const |
| Check whether the container is empty. More... | |
| bool | operator!= (const QgsFields &other) const |
| QgsFields & | operator= (const QgsFields &other) |
| Assignment operator. More... | |
| bool | operator== (const QgsFields &other) const |
| const QgsField & | operator[] (int i) const |
| Get field at particular index (must be in range 0..N-1) More... | |
| QgsField & | operator[] (int i) |
| Get field at particular index (must be in range 0..N-1) More... | |
| void | remove (int fieldIdx) |
| Remove a field with the given index. More... | |
| int | size () const |
| Return number of items. More... | |
| QList< QgsField > | toList () const |
| Utility function to return a list of QgsField instances. More... | |
Container of fields for a vector layer.
In addition to storing a list of QgsField instances, it also:
Definition at line 177 of file qgsfield.h.
| typedef struct QgsFields::Field QgsFields::Field |
Definition at line 181 of file qgsfield.h.
| QgsFields::QgsFields | ( | ) |
Constructor for an empty field container.
Definition at line 234 of file qgsfield.cpp.
| QgsFields::QgsFields | ( | const QgsFields & | other | ) |
Copy constructor.
Definition at line 239 of file qgsfield.cpp.
|
virtual |
Definition at line 250 of file qgsfield.cpp.
| QgsAttributeList QgsFields::allAttributesList | ( | ) | const |
Utility function to get list of attribute indexes.
Definition at line 399 of file qgsfield.cpp.
| bool QgsFields::append | ( | const QgsField & | field, |
| FieldOrigin | origin = OriginProvider, |
||
| int | originIndex = -1 |
||
| ) |
Append a field. The field must have unique name, otherwise it is rejected (returns false)
Definition at line 261 of file qgsfield.cpp.
| bool QgsFields::appendExpressionField | ( | const QgsField & | field, |
| int | originIndex | ||
| ) |
Append an expression field. The field must have unique name, otherwise it is rejected (returns false)
Definition at line 274 of file qgsfield.cpp.
| const QgsField & QgsFields::at | ( | int | i | ) | const |
Get field at particular index (must be in range 0..N-1)
Definition at line 331 of file qgsfield.cpp.
| void QgsFields::clear | ( | ) |
Remove all fields.
Definition at line 255 of file qgsfield.cpp.
| int QgsFields::count | ( | ) | const |
Return number of items.
Definition at line 311 of file qgsfield.cpp.
| bool QgsFields::exists | ( | int | i | ) | const |
Return if a field index is valid.
| i | Index of the field which needs to be checked |
Definition at line 321 of file qgsfield.cpp.
| void QgsFields::extend | ( | const QgsFields & | other | ) |
Extend with fields from another QgsFields container.
Definition at line 298 of file qgsfield.cpp.
| const QgsField & QgsFields::field | ( | int | fieldIdx | ) | const |
Get field at particular index (must be in range 0..N-1)
Definition at line 336 of file qgsfield.cpp.
Get field at particular index (must be in range 0..N-1)
Definition at line 341 of file qgsfield.cpp.
| int QgsFields::fieldNameIndex | ( | const QString & | fieldName | ) | const |
Look up field's index from name also looks up case-insensitive if there is no match otherwise.
Definition at line 382 of file qgsfield.cpp.
| QgsFields::FieldOrigin QgsFields::fieldOrigin | ( | int | fieldIdx | ) | const |
Get field's origin (value from an enumeration)
Definition at line 351 of file qgsfield.cpp.
| int QgsFields::fieldOriginIndex | ( | int | fieldIdx | ) | const |
Get field's origin index (its meaning is specific to each type of origin)
Definition at line 359 of file qgsfield.cpp.
| int QgsFields::indexFromName | ( | const QString & | name | ) | const |
Look up field's index from name. Returns -1 on error.
Definition at line 364 of file qgsfield.cpp.
| bool QgsFields::isEmpty | ( | ) | const |
Check whether the container is empty.
Definition at line 306 of file qgsfield.cpp.
|
inline |
Definition at line 275 of file qgsfield.h.
Assignment operator.
Definition at line 244 of file qgsfield.cpp.
| bool QgsFields::operator== | ( | const QgsFields & | other | ) | const |
Definition at line 377 of file qgsfield.cpp.
| const QgsField & QgsFields::operator[] | ( | int | i | ) | const |
Get field at particular index (must be in range 0..N-1)
Definition at line 346 of file qgsfield.cpp.
| QgsField & QgsFields::operator[] | ( | int | i | ) |
Get field at particular index (must be in range 0..N-1)
Definition at line 326 of file qgsfield.cpp.
| void QgsFields::remove | ( | int | fieldIdx | ) |
Remove a field with the given index.
Definition at line 285 of file qgsfield.cpp.
| int QgsFields::size | ( | ) | const |
Return number of items.
Definition at line 316 of file qgsfield.cpp.
Utility function to return a list of QgsField instances.
Definition at line 369 of file qgsfield.cpp.
1.8.9.1