QGIS API Documentation  3.0.2-Girona (307d082)
qgsattributetablefiltermodel.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  QgsAttributeTableFilterModel.cpp
3  --------------------------------------
4  Date : Feb 2009
5  Copyright : (C) 2009 Vita Cizek
6  Email : weetya (at) gmail.com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #include <QItemSelectionModel>
17 
18 #include "qgis.h"
20 #include "qgsattributetablemodel.h"
21 #include "qgsfeatureiterator.h"
22 #include "qgsvectorlayer.h"
23 #include "qgsfeature.h"
24 #include "qgsmapcanvas.h"
25 #include "qgslogger.h"
26 #include "qgsrenderer.h"
29 // Filter Model //
31 
33  : QSortFilterProxyModel( parent )
34  , mCanvas( canvas )
35  , mFilterMode( ShowAll )
36  , mSelectedOnTop( false )
37 {
38  setSourceModel( sourceModel );
39  setDynamicSortFilter( true );
40  setSortRole( QgsAttributeTableModel::SortRole );
41  connect( layer(), &QgsVectorLayer::selectionChanged, this, &QgsAttributeTableFilterModel::selectionChanged );
42 }
43 
44 bool QgsAttributeTableFilterModel::lessThan( const QModelIndex &left, const QModelIndex &right ) const
45 {
46  if ( mSelectedOnTop )
47  {
48  bool leftSelected = layer()->selectedFeatureIds().contains( masterModel()->rowToId( left.row() ) );
49  bool rightSelected = layer()->selectedFeatureIds().contains( masterModel()->rowToId( right.row() ) );
50 
51  if ( leftSelected && !rightSelected )
52  {
53  return sortOrder() == Qt::AscendingOrder;
54  }
55  else if ( rightSelected && !leftSelected )
56  {
57  return sortOrder() == Qt::DescendingOrder;
58  }
59  }
60 
61  if ( mTableModel->sortCacheExpression().isEmpty() )
62  {
63  //shortcut when no sort order set
64  return false;
65  }
66 
68  right.data( QgsAttributeTableModel::SortRole ) );
69 }
70 
71 void QgsAttributeTableFilterModel::sort( int column, Qt::SortOrder order )
72 {
73  if ( order != Qt::AscendingOrder && order != Qt::DescendingOrder )
74  order = Qt::AscendingOrder;
75 
76  int myColumn = mColumnMapping.at( column );
77  masterModel()->prefetchColumnData( myColumn );
78  QSortFilterProxyModel::sort( myColumn, order );
79  emit sortColumnChanged( column, order );
80 }
81 
82 QVariant QgsAttributeTableFilterModel::data( const QModelIndex &index, int role ) const
83 {
84  if ( mapColumnToSource( index.column() ) == -1 ) // actions
85  {
86  if ( role == TypeRole )
88  else if ( role == QgsAttributeTableModel::FeatureIdRole )
89  {
90  QModelIndex fieldIndex = QSortFilterProxyModel::mapToSource( QSortFilterProxyModel::index( index.row(), 0, index.parent() ) );
91  return sourceModel()->data( fieldIndex, QgsAttributeTableModel::FeatureIdRole );
92  }
93  }
94  else if ( role == TypeRole )
95  return ColumnTypeField;
96 
97  return QSortFilterProxyModel::data( index, role );
98 }
99 
100 QVariant QgsAttributeTableFilterModel::headerData( int section, Qt::Orientation orientation, int role ) const
101 {
102  if ( orientation == Qt::Horizontal )
103  {
104  if ( mColumnMapping.at( section ) == -1 && role == Qt::DisplayRole )
105  return tr( "Actions" );
106  else
107  return QSortFilterProxyModel::headerData( section, orientation, role );
108  }
109  else
110  {
111  if ( role == Qt::DisplayRole )
112  return section + 1;
113  else
114  {
115  int sourceSection = mapToSource( index( section, ( !mColumnMapping.isEmpty() && mColumnMapping.at( 0 ) == -1 ) ? 1 : 0 ) ).row();
116  return sourceModel()->headerData( sourceSection, orientation, role );
117  }
118  }
119 }
120 
122 {
123  return mColumnMapping.indexOf( -1 );
124 }
125 
126 int QgsAttributeTableFilterModel::columnCount( const QModelIndex &parent ) const
127 {
128  Q_UNUSED( parent );
129  return mColumnMapping.count();
130 }
131 
133 {
134  QgsAttributeTableConfig oldConfig = mConfig;
135  mConfig = config;
136  mConfig.update( layer()->fields() );
137 
138  if ( mConfig.hasSameColumns( oldConfig ) )
139  {
140  return;
141  }
142 
143  QVector<int> newColumnMapping;
144  Q_FOREACH ( const QgsAttributeTableConfig::ColumnConfig &columnConfig, mConfig.columns() )
145  {
146  // Hidden? Forget about this column
147  if ( columnConfig.hidden )
148  continue;
149 
150  // The new value for the mapping (field index or -1 for action column)
151  int newValue = ( columnConfig.type == QgsAttributeTableConfig::Action ) ? -1 : layer()->fields().lookupField( columnConfig.name );
152  newColumnMapping << newValue;
153  }
154 
155  if ( newColumnMapping != mColumnMapping )
156  {
157  bool requiresReset = false;
158  int firstRemovedColumn = -1;
159  int removedColumnCount = 0;
160 
161  // Check if there have a contiguous set of columns have been removed or if we require a full reset
162  for ( int i = 0; i < std::min( newColumnMapping.size(), mColumnMapping.size() - removedColumnCount ); ++i )
163  {
164  if ( newColumnMapping.at( i ) == mColumnMapping.at( i + removedColumnCount ) )
165  continue;
166 
167  if ( firstRemovedColumn == -1 )
168  {
169  firstRemovedColumn = i;
170 
171  while ( i < mColumnMapping.size() - removedColumnCount && mColumnMapping.at( i + removedColumnCount ) != newColumnMapping.at( i ) )
172  {
173  ++removedColumnCount;
174  }
175  }
176  else
177  {
178  requiresReset = true;
179  break;
180  }
181  }
182 
183  // No difference found so far
184  if ( firstRemovedColumn == -1 )
185  {
186  if ( newColumnMapping.size() > mColumnMapping.size() )
187  {
188  // More columns: appended to the end
189  beginInsertColumns( QModelIndex(), mColumnMapping.size(), newColumnMapping.size() - 1 );
190  mColumnMapping = newColumnMapping;
191  endInsertColumns();
192  }
193  else
194  {
195  // Less columns: removed from the end
196  beginRemoveColumns( QModelIndex(), newColumnMapping.size(), mColumnMapping.size() - 1 );
197  mColumnMapping = newColumnMapping;
198  endRemoveColumns();
199  }
200  }
201  else
202  {
203  if ( newColumnMapping.size() == mColumnMapping.size() - removedColumnCount )
204  {
205  //the amount of removed column in the model need to be equal removedColumnCount
206  beginRemoveColumns( QModelIndex(), firstRemovedColumn, firstRemovedColumn + removedColumnCount - 1 );
207  mColumnMapping = newColumnMapping;
208  endRemoveColumns();
209  }
210  else
211  {
212  requiresReset = true;
213  }
214  }
215 
216  if ( requiresReset )
217  {
218  beginResetModel();
219  mColumnMapping = newColumnMapping;
220  endResetModel();
221  }
222  }
223 
224  if ( !config.sortExpression().isEmpty() )
225  sort( config.sortExpression(), config.sortOrder() );
226 }
227 
228 void QgsAttributeTableFilterModel::sort( const QString &expression, Qt::SortOrder order )
229 {
230  if ( order != Qt::AscendingOrder && order != Qt::DescendingOrder )
231  order = Qt::AscendingOrder;
232 
233  QSortFilterProxyModel::sort( -1 );
234  masterModel()->prefetchSortData( expression );
235  QSortFilterProxyModel::sort( 0, order );
236 }
237 
239 {
240  return masterModel()->sortCacheExpression();
241 }
242 
244 {
245  if ( mSelectedOnTop != selectedOnTop )
246  {
247  mSelectedOnTop = selectedOnTop;
248  int column = sortColumn();
249  Qt::SortOrder order = sortOrder();
250 
251  // set default sort values if they are not correctly set
252  if ( column < 0 )
253  column = 0;
254 
255  if ( order != Qt::AscendingOrder && order != Qt::DescendingOrder )
256  order = Qt::AscendingOrder;
257 
258  sort( column, order );
259  invalidate();
260  }
261 }
262 
264 {
265  mTableModel = sourceModel;
266 
267  for ( int i = 0; i < mTableModel->columnCount() - mTableModel->extraColumns(); ++i )
268  {
269  mColumnMapping.append( i );
270  }
271 
272  QSortFilterProxyModel::setSourceModel( sourceModel );
273 
274  // Disconnect any code to update columns in the parent, we handle this manually
275  disconnect( mTableModel, SIGNAL( columnsAboutToBeInserted( QModelIndex, int, int ) ), this, SLOT( _q_sourceColumnsAboutToBeInserted( QModelIndex, int, int ) ) );
276  disconnect( mTableModel, SIGNAL( columnsInserted( QModelIndex, int, int ) ), this, SLOT( _q_sourceColumnsInserted( QModelIndex, int, int ) ) );
277  disconnect( mTableModel, SIGNAL( columnsAboutToBeRemoved( QModelIndex, int, int ) ), this, SLOT( _q_sourceColumnsAboutToBeRemoved( QModelIndex, int, int ) ) );
278  disconnect( mTableModel, SIGNAL( columnsRemoved( QModelIndex, int, int ) ), this, SLOT( _q_sourceColumnsRemoved( QModelIndex, int, int ) ) );
279  // The following connections are needed in order to keep the filter model in sync, see: regression #15974
280  connect( mTableModel, &QAbstractItemModel::columnsAboutToBeInserted, this, &QgsAttributeTableFilterModel::onColumnsChanged );
281  connect( mTableModel, &QAbstractItemModel::columnsAboutToBeRemoved, this, &QgsAttributeTableFilterModel::onColumnsChanged );
282 
283 }
284 
286 {
287  return mSelectedOnTop;
288 }
289 
291 {
292  mFilteredFeatures = ids;
294  invalidateFilter();
295 }
296 
298 {
299  QgsFeatureIds ids;
300  ids.reserve( rowCount() );
301  for ( int i = 0; i < rowCount(); ++i )
302  {
303  QModelIndex row = index( i, 0 );
304  ids << rowToId( row );
305  }
306  return ids;
307 }
308 
310 {
311  if ( filterMode != mFilterMode )
312  {
313  if ( filterMode == ShowVisible )
314  {
317  }
318  else
319  {
321  }
322 
323  mFilterMode = filterMode;
324  invalidateFilter();
325  }
326 }
327 
328 bool QgsAttributeTableFilterModel::filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const
329 {
330  Q_UNUSED( sourceParent );
331  switch ( mFilterMode )
332  {
333  case ShowAll:
334  return true;
335 
336  case ShowFilteredList:
337  return mFilteredFeatures.contains( masterModel()->rowToId( sourceRow ) );
338 
339  case ShowSelected:
340  return layer()->selectedFeatureIds().contains( masterModel()->rowToId( sourceRow ) );
341 
342  case ShowVisible:
343  return mFilteredFeatures.contains( masterModel()->rowToId( sourceRow ) );
344 
345  case ShowEdited:
346  {
347  QgsVectorLayerEditBuffer *editBuffer = layer()->editBuffer();
348  if ( editBuffer )
349  {
350  QgsFeatureId fid = masterModel()->rowToId( sourceRow );
351 
352  if ( editBuffer->isFeatureAdded( fid ) )
353  return true;
354 
355  if ( editBuffer->isFeatureAttributesChanged( fid ) )
356  return true;
357 
358  if ( editBuffer->isFeatureGeometryChanged( fid ) )
359  return true;
360 
361  return false;
362  }
363  return false;
364  }
365 
366  default:
367  Q_ASSERT( false ); // In debug mode complain
368  return true; // In release mode accept row
369  }
370  // returns are handled in their respective case statement above
371 }
372 
374 {
376  invalidateFilter();
377 }
378 
379 void QgsAttributeTableFilterModel::selectionChanged()
380 {
381  if ( ShowSelected == mFilterMode )
382  {
383  invalidateFilter();
384  }
385  else if ( mSelectedOnTop )
386  {
387  sort( sortColumn(), sortOrder() );
388  invalidate();
389  }
390 }
391 
392 void QgsAttributeTableFilterModel::onColumnsChanged()
393 {
394  setAttributeTableConfig( mConfig );
395 }
396 
397 int QgsAttributeTableFilterModel::mapColumnToSource( int column ) const
398 {
399  if ( mColumnMapping.isEmpty() )
400  return column;
401  if ( column < 0 || column >= mColumnMapping.size() )
402  return -1;
403  else
404  return mColumnMapping.at( column );
405 }
406 
408 {
409  if ( !layer() )
410  return;
411 
412  bool filter = false;
413  QgsRectangle rect = mCanvas->mapSettings().mapToLayerCoordinates( layer(), mCanvas->extent() );
414  QgsRenderContext renderContext;
416 
417  mFilteredFeatures.clear();
418  if ( !layer()->renderer() )
419  {
420  QgsDebugMsg( "Cannot get renderer" );
421  return;
422  }
423 
424  std::unique_ptr< QgsFeatureRenderer > renderer( layer()->renderer()->clone() );
425 
426  const QgsMapSettings &ms = mCanvas->mapSettings();
427  if ( !layer()->isInScaleRange( ms.scale() ) )
428  {
429  QgsDebugMsg( "Out of scale limits" );
430  }
431  else
432  {
433  if ( renderer->capabilities() & QgsFeatureRenderer::ScaleDependent )
434  {
435  // setup scale
436  // mapRenderer()->renderContext()->scale is not automatically updated when
437  // render extent changes (because it's scale is used to identify if changed
438  // since last render) -> use local context
439  renderContext.setExtent( ms.visibleExtent() );
440  renderContext.setMapToPixel( ms.mapToPixel() );
441  renderContext.setRendererScale( ms.scale() );
442  }
443 
444  filter = renderer->capabilities() & QgsFeatureRenderer::Filter;
445  }
446 
447  renderer->startRender( renderContext, layer()->fields() );
448 
449  QgsFeatureRequest r( masterModel()->request() );
450  if ( !r.filterRect().isNull() )
451  {
452  r.setFilterRect( r.filterRect().intersect( &rect ) );
453  }
454  else
455  {
456  r.setFilterRect( rect );
457  }
459 
460  QgsFeature f;
461 
462  while ( features.nextFeature( f ) )
463  {
464  renderContext.expressionContext().setFeature( f );
465  if ( !filter || renderer->willRenderFeature( f, renderContext ) )
466  {
467  mFilteredFeatures << f.id();
468  }
469 #if 0
470  if ( t.elapsed() > 5000 )
471  {
472  bool cancel = false;
473  emit progress( i, cancel );
474  if ( cancel )
475  break;
476 
477  t.restart();
478  }
479 #endif
480  }
481 
482  features.close();
483 
484  if ( renderer->capabilities() & QgsFeatureRenderer::ScaleDependent )
485  {
486  renderer->stopRender( renderContext );
487  }
488 }
489 
491 {
492  return masterModel()->rowToId( mapToSource( row ).row() );
493 }
494 
496 {
497  return mapFromMaster( masterModel()->idToIndex( fid ) );
498 }
499 
501 {
502  QModelIndexList indexes;
503  Q_FOREACH ( const QModelIndex &idx, masterModel()->idToIndexList( fid ) )
504  {
505  indexes.append( mapFromMaster( idx ) );
506  }
507 
508  return indexes;
509 }
510 
511 QModelIndex QgsAttributeTableFilterModel::mapToSource( const QModelIndex &proxyIndex ) const
512 {
513  if ( !proxyIndex.isValid() )
514  return QModelIndex();
515 
516  int sourceColumn = mapColumnToSource( proxyIndex.column() );
517 
518  // For the action column there is no matching column in the source model, just return the first one
519  // so we are still able to query for the feature id, the feature...
520  if ( sourceColumn == -1 )
521  sourceColumn = 0;
522 
523  return QSortFilterProxyModel::mapToSource( index( proxyIndex.row(), sourceColumn, proxyIndex.parent() ) );
524 }
525 
526 QModelIndex QgsAttributeTableFilterModel::mapFromSource( const QModelIndex &sourceIndex ) const
527 {
528  QModelIndex proxyIndex = QSortFilterProxyModel::mapFromSource( sourceIndex );
529 
530  if ( proxyIndex.column() < 0 )
531  return QModelIndex();
532 
533  int col = mapColumnToSource( proxyIndex.column() );
534  if ( col == -1 )
535  col = 0;
536 
537  return index( proxyIndex.row(), col, proxyIndex.parent() );
538 }
539 
540 Qt::ItemFlags QgsAttributeTableFilterModel::flags( const QModelIndex &index ) const
541 {
542  // Handle the action column flags here, the master model doesn't know it
543  if ( mapColumnToSource( index.column() ) == -1 )
544  return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
545 
546  QModelIndex source_index = mapToSource( index );
547  return masterModel()->flags( source_index );
548 }
549 
int lookupField(const QString &fieldName) const
Look up field&#39;s index from the field name.
Definition: qgsfields.cpp:299
void generateListOfVisibleFeatures()
Updates the list of currently visible features on the map canvas.
QgsFeatureId id
Definition: qgsfeature.h:71
QgsFeatureId rowToId(const QModelIndex &row)
Returns the feature id for a given model index.
QgsVectorLayer * layer() const
Returns the layer this filter acts on.
Wrapper for iterator of features from vector data provider or vector layer.
QVariant data(const QModelIndex &index, int role) const override
QgsAttributeTableConfig::Type type
The type of this column.
int extraColumns() const
Empty extra columns to announce from this model.
A rectangle specified with double values.
Definition: qgsrectangle.h:39
Depends on scale if feature will be rendered (rule based )
Definition: qgsrenderer.h:242
void update(const QgsFields &fields)
Update the configuration with the given fields.
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override
Returns true if the source row will be accepted.
bool selectedOnTop()
Returns if selected features are currently shown on top.
void setAttributeTableConfig(const QgsAttributeTableConfig &config)
Set the attribute table configuration to control which fields are shown, in which order they are show...
QgsAttributeTableModel * masterModel() const
Returns the table model this filter is using.
void setSelectedOnTop(bool selectedOnTop)
Changes the sort order of the features.
void setFilterMode(FilterMode filterMode)
Set the filter mode the filter will use.
QModelIndex mapFromMaster(const QModelIndex &sourceIndex) const
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
void setFeature(const QgsFeature &feature)
Convenience function for setting a feature for the context.
#define QgsDebugMsg(str)
Definition: qgslogger.h:38
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeature.h:544
Features may be filtered, i.e. some features may not be rendered (categorized, rule based ...
Definition: qgsrenderer.h:241
void setRendererScale(double scale)
Sets the renderer map scale.
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override
Used by the sorting algorithm.
QModelIndex mapToSource(const QModelIndex &proxyIndex) const override
QgsRectangle intersect(const QgsRectangle *rect) const
Return the intersection with the given rectangle.
This column represents an action widget.
bool isFeatureAdded(QgsFeatureId id) const
Returns true if the specified feature ID has been added but not committed.
QModelIndex mapFromSource(const QModelIndex &sourceIndex) const override
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:62
A model backed by a QgsVectorLayerCache which is able to provide feature/attribute information to a Q...
Show only visible features (depends on the map canvas)
const QgsRectangle & filterRect() const
Returns the rectangle from which features will be taken.
void setExtent(const QgsRectangle &extent)
QgsRectangle visibleExtent() const
Return the actual extent derived from requested extent that takes takes output image size into accoun...
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:74
bool qgsVariantLessThan(const QVariant &lhs, const QVariant &rhs)
Compares two QVariant values and returns whether the first is less than the second.
Definition: qgis.cpp:146
QgsAttributeTableFilterModel(QgsMapCanvas *canvas, QgsAttributeTableModel *sourceModel, QObject *parent=nullptr)
Make sure, the master model is already loaded, so the selection will get synchronized.
virtual void setFilteredFeatures(const QgsFeatureIds &ids)
Specify a list of features, which the filter will accept.
The QgsMapSettings class contains configuration for rendering of the map.
Get the feature id of the feature in this row.
int actionColumnIndex() const
Get the index of the first column that contains an action widget.
QgsVectorLayerEditBuffer * editBuffer()
Buffer with uncommitted editing operations. Only valid after editing has been turned on...
FilterMode filterMode()
The current filterModel.
const QgsFeatureIds & selectedFeatureIds() const
Return reference to identifiers of selected features.
QgsFields fields() const override
Returns the list of fields of this layer.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns.
FilterMode
The filter mode defines how the rows should be filtered.
double scale() const
Returns the calculated map scale.
void selectionChanged(const QgsFeatureIds &selected, const QgsFeatureIds &deselected, const bool clearAndSelect)
This signal is emitted when selection was changed.
QgsRectangle extent() const
Returns the current zoom extent of the map canvas.
bool hidden
Flag that controls if the column is hidden.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
QgsVectorLayerCache * layerCache() const
Returns the layer cache this model uses as backend.
QgsFeatureRequest & setFilterRect(const QgsRectangle &rectangle)
Sets the rectangle from which features will be taken.
Show only features which have unsaved changes.
static QList< QgsExpressionContextScope * > globalProjectLayerScopes(const QgsMapLayer *layer)
Creates a list of three scopes: global, layer&#39;s project and layer.
bool isFeatureAttributesChanged(QgsFeatureId id) const
Returns true if the specified feature ID has had an attribute changed but not committed.
const QgsMapToPixel & mapToPixel() const
QString name
The name of the attribute if this column represents a field.
void setSourceModel(QgsAttributeTableModel *sourceModel)
Set the attribute table model that backs this model.
void extentsChanged()
Is called upon every change of the visible extents on the map canvas.
QString sortExpression() const
The expression which is used to sort the attribute table.
QgsExpressionContext & expressionContext()
Gets the expression context.
Show only features whose ids are on the filter list. {.
QVector< QgsAttributeTableConfig::ColumnConfig > columns() const
Get the list with all columns and their configuration.
const QgsMapSettings & mapSettings() const
Get access to properties used for map rendering.
Contains information about the context of a rendering operation.
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder) override
Sort by the given column using the given order.
int columnCount(const QModelIndex &parent) const override
void setMapToPixel(const QgsMapToPixel &mtp)
bool isNull() const
Test if the rectangle is null (all coordinates zero or after call to setMinimal()).
Defines the configuration of a column in the attribute table.
QgsFeatureId rowToId(int row) const
Maps row to feature id.
qint64 QgsFeatureId
Definition: qgsfeature.h:37
QString sortCacheExpression() const
The expression which was used to fill the sorting cache.
QgsFeatureIds filteredFeatures()
Get a list of currently filtered feature ids.
void appendScopes(const QList< QgsExpressionContextScope *> &scopes)
Appends a list of scopes to the end of the context.
bool nextFeature(QgsFeature &f)
This is a container for configuration of the attribute table.
Qt::SortOrder sortOrder() const
Get the sort order.
QgsPointXY mapToLayerCoordinates(const QgsMapLayer *layer, QgsPointXY point) const
transform point coordinates from output CRS to layer&#39;s CRS
QString sortExpression() const
Get the expression used for sorting.
void sortColumnChanged(int column, Qt::SortOrder order)
Is emitted whenever the sort column is changed.
QgsFeatureIterator getFeatures(const QgsFeatureRequest &featureRequest=QgsFeatureRequest())
Query this VectorLayerCache for features.
QModelIndexList fidToIndexList(QgsFeatureId fid)
void extentsChanged()
Emitted when the extents of the map change.
bool hasSameColumns(const QgsAttributeTableConfig &other) const
Compare this configuration&#39;s columns name, type, and order to other.
void prefetchColumnData(int column)
Caches the entire data for one column.
void prefetchSortData(const QString &expression)
Prefetches the entire data for one expression.
Qt::ItemFlags flags(const QModelIndex &index) const override
Returns item flags for the index.
QModelIndex fidToIndex(QgsFeatureId fid) override
Qt::ItemFlags flags(const QModelIndex &index) const override
bool isFeatureGeometryChanged(QgsFeatureId id) const
Returns true if the specified feature ID has had its geometry changed but not committed.