45 QVariant::Type type = QVariant::Invalid,
46 QString typeName = QString(),
49 QString comment = QString() );
58 const QString & name()
const;
61 QVariant::Type type()
const;
69 const QString & typeName()
const;
83 int precision()
const;
88 const QString & comment()
const;
94 void setName(
const QString & nam );
99 void setType( QVariant::Type type );
105 void setTypeName(
const QString & typ );
111 void setLength(
int len );
117 void setPrecision(
int prec );
123 void setComment(
const QString & comment );
126 QString displayString(
const QVariant& v )
const;
176 Field(): origin( OriginUnknown ), originIndex( -1 ) {}
187 bool append(
const QgsField& field,
FieldOrigin origin = OriginProvider,
int originIndex = -1 );
189 void remove(
int fieldIdx );
194 inline bool isEmpty()
const {
return mFields.isEmpty(); }
196 inline int count()
const {
return mFields.count(); }
198 inline int size()
const {
return mFields.count(); }
205 const QgsField&
at(
int i )
const {
return mFields[i].field; }
207 const QgsField&
field(
int fieldIdx )
const {
return mFields[fieldIdx].field; }
209 const QgsField&
field(
const QString& name )
const {
return mFields[ indexFromName( name )].field; }
217 int indexFromName(
const QString& name )
const {
return mNameToIndex.value( name, -1 ); }
220 QList<QgsField> toList()
const;