15 #ifndef QGSATTRIBUTEEDITORMODEL_H
16 #define QGSATTRIBUTEEDITORMODEL_H
20 #include <QSortFilterProxyModel>
22 #include <QItemSelectionModel>
57 bool isEdited =
false;
62 FeatureInfoRole = 0x1000,
72 #pragma clang diagnostic push
73 #pragma clang diagnostic ignored "-Woverloaded-virtual"
77 #pragma clang diagnostic pop
85 QVariant data(
const QModelIndex &index,
int role )
const override;
86 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
94 void setInjectNull(
bool injectNull );
111 bool setDisplayExpression(
const QString &expression );
117 QString parserErrorString();
119 QString displayExpression()
const;
120 bool featureByIndex(
const QModelIndex &index,
QgsFeature &feat );
126 QgsFeatureId idxToFid(
const QModelIndex &index )
const;
134 QModelIndex mapToSource(
const QModelIndex &proxyIndex )
const override;
135 QModelIndex mapFromSource(
const QModelIndex &sourceIndex )
const override;
137 virtual QModelIndex mapToMaster(
const QModelIndex &proxyIndex )
const;
138 virtual QModelIndex mapFromMaster(
const QModelIndex &sourceIndex )
const;
140 virtual QItemSelection mapSelectionFromMaster(
const QItemSelection &selection )
const;
141 virtual QItemSelection mapSelectionToMaster(
const QItemSelection &selection )
const;
143 QModelIndex parent(
const QModelIndex &child )
const override;
144 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
145 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
155 bool sortByDisplayExpression()
const;
165 void setSortByDisplayExpression(
bool sortByDisplayExpression, Qt::SortOrder order = Qt::AscendingOrder );
174 Q_DECL_DEPRECATED
void onBeginRemoveRows(
const QModelIndex &parent,
int first,
int last );
181 Q_DECL_DEPRECATED
void onEndRemoveRows(
const QModelIndex &parent,
int first,
int last );
188 Q_DECL_DEPRECATED
void onBeginInsertRows(
const QModelIndex &parent,
int first,
int last );
195 Q_DECL_DEPRECATED
void onEndInsertRows(
const QModelIndex &parent,
int first,
int last );
199 void conditionalStylesChanged();
204 QString mParserErrorString;
205 bool mInjectNull =
false;
207 mutable QMap< QgsFeatureId, QList<QgsConditionalStyle> > mRowStylesMap;
208 bool mSortByDisplayExpression =
false;
209 QPointer< QgsVectorLayer > mSourceLayer;
214 #endif // QGSATTRIBUTEEDITORMODEL_H