22 #include <QSharedDataPointer>
27 class QgsFieldPrivate;
28 class QgsFieldsPrivate;
54 QVariant::Type type = QVariant::Invalid,
78 QVariant::Type type()
const;
86 const QString& typeName()
const;
98 int precision()
const;
103 const QString& comment()
const;
109 void setName(
const QString& name );
114 void setType( QVariant::Type type );
120 void setTypeName(
const QString& typeName );
126 void setLength(
int len );
132 void setPrecision(
int precision );
137 void setComment(
const QString& comment );
149 bool convertCompatible(
QVariant& v )
const;
188 Field(): origin( OriginUnknown ), originIndex( -1 ) {}
218 bool append(
const QgsField& field,
FieldOrigin origin = OriginProvider,
int originIndex = -1 );
220 bool appendExpressionField(
const QgsField& field,
int originIndex );
222 void remove(
int fieldIdx );
227 bool isEmpty()
const;
235 bool exists(
int i )
const;
238 const QgsField& operator[](
int i )
const;
244 const QgsField& field(
int fieldIdx )
const;
251 int fieldOriginIndex(
int fieldIdx )
const;
254 int indexFromName(
const QString& name )
const;
259 int fieldNameIndex(
const QString& fieldName )
const;
Class for parsing and evaluation of expressions (formerly called "search strings").
Q_DECLARE_METATYPE(QgsField)
field comes from a joined layer (originIndex / 1000 = index of the join, originIndex % 1000 = index w...
field has been temporarily added in editing mode (originIndex = index in the list of added attributes...
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Container of fields for a vector layer.
field comes from the underlying data provider of the vector layer (originIndex = index in provider's ...
it has not been specified where the field comes from
bool operator==(const Field &other) const
Field(const QgsField &f, FieldOrigin o, int oi)
CORE_EXPORT QDataStream & operator<<(QDataStream &out, const QgsField &field)
Writes the field to stream out.
Encapsulate a field in an attribute table or data source.
bool operator!=(const Field &other) const
QList< int > QgsAttributeList
int originIndex
index specific to the origin
bool operator!=(const QgsFields &other) const
FieldOrigin origin
origin of the field
CORE_EXPORT QDataStream & operator>>(QDataStream &in, QgsField &field)
Reads a field from stream in into field.