15 #ifndef QGSATTRIBUTEEDITORMODEL_H 16 #define QGSATTRIBUTEEDITORMODEL_H 18 #include "qgsexpression.h" 21 #include <QAbstractProxyModel> 23 #include <QItemSelectionModel> 54 bool isEdited =
false;
59 FeatureInfoRole = Qt::UserRole,
70 QVariant data(
const QModelIndex &index,
int role )
const override;
71 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
78 void setInjectNull(
bool injectNull );
95 bool setDisplayExpression(
const QString &expression );
101 QString parserErrorString();
103 QString displayExpression()
const;
104 bool featureByIndex(
const QModelIndex &index,
QgsFeature &feat );
105 QgsFeatureId idxToFid(
const QModelIndex &index )
const;
108 QModelIndex mapToSource(
const QModelIndex &proxyIndex )
const override;
109 QModelIndex mapFromSource(
const QModelIndex &sourceIndex )
const override;
111 virtual QModelIndex mapToMaster(
const QModelIndex &proxyIndex )
const;
112 virtual QModelIndex mapFromMaster(
const QModelIndex &sourceIndex )
const;
114 virtual QItemSelection mapSelectionFromMaster(
const QItemSelection &selection )
const;
115 virtual QItemSelection mapSelectionToMaster(
const QItemSelection &selection )
const;
117 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
118 QModelIndex parent(
const QModelIndex &child )
const override;
119 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
120 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
126 void onBeginRemoveRows(
const QModelIndex &parent,
int first,
int last );
127 void onEndRemoveRows(
const QModelIndex &parent,
int first,
int last );
128 void onBeginInsertRows(
const QModelIndex &parent,
int first,
int last );
129 void onEndInsertRows(
const QModelIndex &parent,
int first,
int last );
132 mutable QgsExpression mDisplayExpression;
134 QString mParserErrorString;
137 mutable QMap< QgsFeatureId, QList<QgsConditionalStyle> > mRowStylesMap;
142 #endif // QGSATTRIBUTEEDITORMODEL_H
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
A model backed by a QgsVectorLayerCache which is able to provide feature/attribute information to a Q...
Q_DECLARE_METATYPE(QModelIndex)
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
This class caches features of a given QgsVectorLayer.