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
51 QModelIndex indexFromName(
const QString &fieldName );
54 void setAllowExpression(
bool allowExpression );
57 bool isField(
const QString& expression );
62 void setExpression(
const QString &expression );
65 void removeExpression();
75 virtual void updateModel();
92 QModelIndex
index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
93 QModelIndex parent(
const QModelIndex &child )
const override;
94 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
95 int columnCount(
const QModelIndex &parent )
const override;
96 QVariant data(
const QModelIndex &
index,
int role )
const override;
99 #endif // QGSFIELDMODEL_H