16 #ifndef QGSFIELDMODEL_H 17 #define QGSFIELDMODEL_H 19 #include <QAbstractItemModel> 20 #include <QItemSelectionModel> 37 FieldNameRole = Qt::UserRole + 1,
38 FieldIndexRole = Qt::UserRole + 2,
39 ExpressionRole = Qt::UserRole + 3,
40 IsExpressionRole = Qt::UserRole + 4,
41 ExpressionValidityRole = Qt::UserRole + 5,
42 FieldTypeRole = Qt::UserRole + 6,
43 FieldOriginRole = Qt::UserRole + 7,
55 void setAllowExpression(
bool allowExpression );
58 bool isField(
const QString& expression );
63 void setExpression(
const QString &expression );
66 void removeExpression();
83 virtual void updateModel();
99 #endif // QGSFIELDMODEL_H
virtual int rowCount(const QModelIndex &parent) const=0
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const=0
Container of fields for a vector layer.
The QgsFieldModel class is a model to display the list of fields of a layer in widgets.
QgsVectorLayer * layer()
returns the currently used layer
virtual QVariant data(const QModelIndex &index, int role) const=0
virtual int columnCount(const QModelIndex &parent) const=0
QList< QString > mExpression
Represents a vector layer which manages a vector based data sets.