QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Friends | List of all members
QgsAttributeTableFilterModel Class Reference

#include <qgsattributetablefiltermodel.h>

Inheritance diagram for QgsAttributeTableFilterModel:
Inheritance graph
[legend]

Public Types

enum  ColumnType { ColumnTypeField, ColumnTypeActionButton }
 The type of a column. More...
 
enum  FilterMode {
  ShowAll, ShowSelected, ShowVisible, ShowFilteredList,
  ShowEdited
}
 The filter mode defines how the rows should be filtered. More...
 
enum  Role { TypeRole = QgsAttributeTableModel::UserRole }
 The additional roles defined by this filter model. More...
 

Public Slots

void extentsChanged ()
 Is called upon every change of the visible extents on the map canvas. More...
 

Signals

void sortColumnChanged (int column, Qt::SortOrder order)
 Is emitted whenever the sort column is changed. More...
 

Public Member Functions

 QgsAttributeTableFilterModel (QgsMapCanvas *canvas, QgsAttributeTableModel *sourceModel, QObject *parent=nullptr)
 Make sure, the master model is already loaded, so the selection will get synchronized. More...
 
int actionColumnIndex () const
 Get the index of the first column that contains an action widget. More...
 
int columnCount (const QModelIndex &parent) const override
 
virtual QVariant data (const QModelIndex &index, int role) const override
 
QModelIndex fidToIndex (QgsFeatureId fid) override
 
QModelIndexList fidToIndexList (QgsFeatureId fid)
 
QgsFeatureIds filteredFeatures ()
 Get a list of currently filtered feature ids. More...
 
FilterMode filterMode ()
 The current filterModel. More...
 
virtual Qt::ItemFlags flags (const QModelIndex &index) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 
QgsVectorLayerlayer () const
 Returns the layer this filter acts on. More...
 
QgsVectorLayerCachelayerCache () const
 Returns the layerCache this filter acts on. More...
 
QgsMapCanvasmapCanvas () const
 Returns the map canvas. More...
 
QModelIndex mapFromMaster (const QModelIndex &sourceIndex) const
 
virtual QModelIndex mapFromSource (const QModelIndex &sourceIndex) const override
 
QModelIndex mapToMaster (const QModelIndex &proxyIndex) const
 
virtual QModelIndex mapToSource (const QModelIndex &proxyIndex) const override
 
QgsAttributeTableModelmasterModel () const
 Returns the table model this filter is using. More...
 
QgsFeatureId rowToId (const QModelIndex &row)
 Returns the feature id for a given model index. More...
 
bool selectedOnTop ()
 Returns if selected features are currently shown on top. More...
 
void setAttributeTableConfig (const QgsAttributeTableConfig &config)
 Set the attribute table configuration to control which fields are shown, in which order they are shown as well as if and where an action column is shown. More...
 
virtual void setFilteredFeatures (const QgsFeatureIds &ids)
 Specify a list of features, which the filter will accept. More...
 
void setFilterMode (FilterMode filterMode)
 Set the filter mode the filter will use. More...
 
void setSelectedOnTop (bool selectedOnTop)
 Changes the sort order of the features. More...
 
void setSourceModel (QgsAttributeTableModel *sourceModel)
 Set the attribute table model that backs this model. More...
 
virtual void sort (int column, Qt::SortOrder order=Qt::AscendingOrder) override
 Sort by the given column using the given order. More...
 
void sort (QString expression, Qt::SortOrder order=Qt::AscendingOrder)
 Sort by the given expression using the given order. More...
 
QString sortExpression () const
 The expression which is used to sort the attribute table. More...
 
- Public Member Functions inherited from QSortFilterProxyModel
 QSortFilterProxyModel (QObject *parent)
 
 ~QSortFilterProxyModel ()
 
virtual QModelIndex buddy (const QModelIndex &index) const
 
virtual bool canFetchMore (const QModelIndex &parent) const
 
void clear ()
 
virtual bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
 
bool dynamicSortFilter () const
 
virtual void fetchMore (const QModelIndex &parent)
 
Qt::CaseSensitivity filterCaseSensitivity () const
 
int filterKeyColumn () const
 
QRegExp filterRegExp () const
 
int filterRole () const
 
virtual bool hasChildren (const QModelIndex &parent) const
 
virtual QModelIndex index (int row, int column, const QModelIndex &parent) const
 
virtual bool insertColumns (int column, int count, const QModelIndex &parent)
 
virtual bool insertRows (int row, int count, const QModelIndex &parent)
 
void invalidate ()
 
bool isSortLocaleAware () const
 
virtual QItemSelection mapSelectionFromSource (const QItemSelection &sourceSelection) const
 
virtual QItemSelection mapSelectionToSource (const QItemSelection &proxySelection) const
 
virtual QModelIndexList match (const QModelIndex &start, int role, const QVariant &value, int hits, QFlags< Qt::MatchFlag > flags) const
 
virtual QMimeDatamimeData (const QModelIndexList &indexes) const
 
virtual QStringList mimeTypes () const
 
virtual QModelIndex parent (const QModelIndex &child) const
 
virtual bool removeColumns (int column, int count, const QModelIndex &parent)
 
virtual bool removeRows (int row, int count, const QModelIndex &parent)
 
virtual int rowCount (const QModelIndex &parent) const
 
virtual bool setData (const QModelIndex &index, const QVariant &value, int role)
 
void setDynamicSortFilter (bool enable)
 
void setFilterCaseSensitivity (Qt::CaseSensitivity cs)
 
void setFilterFixedString (const QString &pattern)
 
void setFilterKeyColumn (int column)
 
void setFilterRegExp (const QRegExp &regExp)
 
void setFilterRegExp (const QString &pattern)
 
void setFilterRole (int role)
 
void setFilterWildcard (const QString &pattern)
 
virtual bool setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role)
 
void setSortCaseSensitivity (Qt::CaseSensitivity cs)
 
void setSortLocaleAware (bool on)
 
void setSortRole (int role)
 
virtual void setSourceModel (QAbstractItemModel *sourceModel)
 
Qt::CaseSensitivity sortCaseSensitivity () const
 
int sortColumn () const
 
Qt::SortOrder sortOrder () const
 
int sortRole () const
 
virtual QSize span (const QModelIndex &index) const
 
virtual Qt::DropActions supportedDropActions () const
 
- Public Member Functions inherited from QAbstractProxyModel
 QAbstractProxyModel (QObject *parent)
 
 ~QAbstractProxyModel ()
 
virtual QMap< int, QVariantitemData (const QModelIndex &proxyIndex) const
 
virtual QModelIndex mapFromSource (const QModelIndex &sourceIndex) const=0
 
virtual QModelIndex mapToSource (const QModelIndex &proxyIndex) const=0
 
virtual void revert ()
 
virtual bool setItemData (const QModelIndex &index, const QMap< int, QVariant > &roles)
 
QAbstractItemModelsourceModel () const
 
virtual bool submit ()
 
- Public Member Functions inherited from QAbstractItemModel
 QAbstractItemModel (QObject *parent)
 
virtual ~QAbstractItemModel ()
 
virtual int columnCount (const QModelIndex &parent) const=0
 
void columnsAboutToBeInserted (const QModelIndex &parent, int start, int end)
 
void columnsAboutToBeMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn)
 
void columnsAboutToBeRemoved (const QModelIndex &parent, int start, int end)
 
void columnsInserted (const QModelIndex &parent, int start, int end)
 
void columnsMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn)
 
void columnsRemoved (const QModelIndex &parent, int start, int end)
 
virtual QVariant data (const QModelIndex &index, int role) const=0
 
void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)
 
bool hasIndex (int row, int column, const QModelIndex &parent) const
 
void headerDataChanged (Qt::Orientation orientation, int first, int last)
 
virtual QModelIndex index (int row, int column, const QModelIndex &parent) const=0
 
bool insertColumn (int column, const QModelIndex &parent)
 
bool insertRow (int row, const QModelIndex &parent)
 
void layoutAboutToBeChanged ()
 
void layoutChanged ()
 
void modelAboutToBeReset ()
 
void modelReset ()
 
virtual QModelIndex parent (const QModelIndex &index) const=0
 
bool removeColumn (int column, const QModelIndex &parent)
 
bool removeRow (int row, const QModelIndex &parent)
 
const QHash< int, QByteArray > & roleNames () const
 
virtual int rowCount (const QModelIndex &parent) const=0
 
void rowsAboutToBeInserted (const QModelIndex &parent, int start, int end)
 
void rowsAboutToBeMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
 
void rowsAboutToBeRemoved (const QModelIndex &parent, int start, int end)
 
void rowsInserted (const QModelIndex &parent, int start, int end)
 
void rowsMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
 
void rowsRemoved (const QModelIndex &parent, int start, int end)
 
void setSupportedDragActions (QFlags< Qt::DropAction > actions)
 
QModelIndex sibling (int row, int column, const QModelIndex &index) const
 
Qt::DropActions supportedDragActions () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual ~QObject ()
 
bool blockSignals (bool block)
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThreadthread () const
 
- Public Member Functions inherited from QgsFeatureModel
virtual ~QgsFeatureModel ()
 

Protected Member Functions

bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override
 Returns true if the source row will be accepted. More...
 
void generateListOfVisibleFeatures ()
 Updates the list of currently visible features on the map canvas. More...
 
bool lessThan (const QModelIndex &left, const QModelIndex &right) const override
 Used by the sorting algorithm. More...
 
- Protected Member Functions inherited from QSortFilterProxyModel
virtual bool filterAcceptsColumn (int source_column, const QModelIndex &source_parent) const
 
void filterChanged ()
 
void invalidateFilter ()
 
- Protected Member Functions inherited from QAbstractItemModel
void beginInsertColumns (const QModelIndex &parent, int first, int last)
 
void beginInsertRows (const QModelIndex &parent, int first, int last)
 
bool beginMoveColumns (const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationChild)
 
bool beginMoveRows (const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationChild)
 
void beginRemoveColumns (const QModelIndex &parent, int first, int last)
 
void beginRemoveRows (const QModelIndex &parent, int first, int last)
 
void beginResetModel ()
 
void changePersistentIndex (const QModelIndex &from, const QModelIndex &to)
 
void changePersistentIndexList (const QModelIndexList &from, const QModelIndexList &to)
 
QModelIndex createIndex (int row, int column, void *ptr) const
 
QModelIndex createIndex (int row, int column, int id) const
 
QModelIndex createIndex (int row, int column, quint32 id) const
 
void endInsertColumns ()
 
void endInsertRows ()
 
void endMoveColumns ()
 
void endMoveRows ()
 
void endRemoveColumns ()
 
void endRemoveRows ()
 
void endResetModel ()
 
QModelIndexList persistentIndexList () const
 
void reset ()
 
void resetInternalData ()
 
void setRoleNames (const QHash< int, QByteArray > &roleNames)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Friends

class TestQgsAttributeTable
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QSortFilterProxyModel
 dynamicSortFilter
 
 filterCaseSensitivity
 
 filterKeyColumn
 
 filterRegExp
 
 filterRole
 
 isSortLocaleAware
 
 sortCaseSensitivity
 
 sortRole
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Definition at line 34 of file qgsattributetablefiltermodel.h.

Member Enumeration Documentation

◆ ColumnType

The type of a column.

Enumerator
ColumnTypeField 

This column shows a field.

ColumnTypeActionButton 

This column shows action buttons.

Definition at line 54 of file qgsattributetablefiltermodel.h.

◆ FilterMode

The filter mode defines how the rows should be filtered.

Enumerator
ShowAll 

Show all features.

ShowSelected 

Show only selected features.

ShowVisible 

Show only visible features (depends on the map canvas)

ShowFilteredList 

Show only features whose ids are on the filter list. {.

See also
setFilteredFeatures}
ShowEdited 

Show only features which have unsaved changes.

Definition at line 42 of file qgsattributetablefiltermodel.h.

◆ Role

The additional roles defined by this filter model.

The values of these roles start just after the roles defined by QgsAttributeTableModel so they do not conflict.

Enumerator
TypeRole 

The type of a given column.

Definition at line 65 of file qgsattributetablefiltermodel.h.

Constructor & Destructor Documentation

◆ QgsAttributeTableFilterModel()

QgsAttributeTableFilterModel::QgsAttributeTableFilterModel ( QgsMapCanvas canvas,
QgsAttributeTableModel sourceModel,
QObject parent = nullptr 
)

Make sure, the master model is already loaded, so the selection will get synchronized.

Parameters
parentparent object (owner)
sourceModelThe QgsAttributeTableModel to use as source (mostly referred to as master model)
canvasThe mapCanvas. Used to identify the currently visible features.

Definition at line 31 of file qgsattributetablefiltermodel.cpp.

Member Function Documentation

◆ actionColumnIndex()

int QgsAttributeTableFilterModel::actionColumnIndex ( ) const

Get the index of the first column that contains an action widget.

Returns -1 if none is defined.

Definition at line 120 of file qgsattributetablefiltermodel.cpp.

◆ columnCount()

int QgsAttributeTableFilterModel::columnCount ( const QModelIndex parent) const
overridevirtual

Reimplemented from QSortFilterProxyModel.

Definition at line 125 of file qgsattributetablefiltermodel.cpp.

◆ data()

QVariant QgsAttributeTableFilterModel::data ( const QModelIndex index,
int  role 
) const
overridevirtual

Reimplemented from QSortFilterProxyModel.

Definition at line 81 of file qgsattributetablefiltermodel.cpp.

◆ extentsChanged

void QgsAttributeTableFilterModel::extentsChanged ( )
slot

Is called upon every change of the visible extents on the map canvas.

When a change is signalled, the filter is updated and invalidated if needed.

Definition at line 358 of file qgsattributetablefiltermodel.cpp.

◆ fidToIndex()

QModelIndex QgsAttributeTableFilterModel::fidToIndex ( QgsFeatureId  fid)
overridevirtual

Implements QgsFeatureModel.

Definition at line 482 of file qgsattributetablefiltermodel.cpp.

◆ fidToIndexList()

QModelIndexList QgsAttributeTableFilterModel::fidToIndexList ( QgsFeatureId  fid)

Definition at line 487 of file qgsattributetablefiltermodel.cpp.

◆ filterAcceptsRow()

bool QgsAttributeTableFilterModel::filterAcceptsRow ( int  sourceRow,
const QModelIndex sourceParent 
) const
overrideprotectedvirtual

Returns true if the source row will be accepted.

Parameters
sourceRowrow from the source model
sourceParentparent index in the source model

Reimplemented from QSortFilterProxyModel.

Definition at line 320 of file qgsattributetablefiltermodel.cpp.

◆ filteredFeatures()

QgsFeatureIds QgsAttributeTableFilterModel::filteredFeatures ( )

Get a list of currently filtered feature ids.

Returns
A list of feature ids

Definition at line 290 of file qgsattributetablefiltermodel.cpp.

◆ filterMode()

FilterMode QgsAttributeTableFilterModel::filterMode ( )
inline

The current filterModel.

Definition at line 129 of file qgsattributetablefiltermodel.h.

◆ flags()

Qt::ItemFlags QgsAttributeTableFilterModel::flags ( const QModelIndex index) const
overridevirtual

Reimplemented from QSortFilterProxyModel.

Definition at line 527 of file qgsattributetablefiltermodel.cpp.

◆ generateListOfVisibleFeatures()

void QgsAttributeTableFilterModel::generateListOfVisibleFeatures ( )
protected

Updates the list of currently visible features on the map canvas.

Is called automatically when the filter mode is adjusted or the extents changed.

Definition at line 392 of file qgsattributetablefiltermodel.cpp.

◆ headerData()

QVariant QgsAttributeTableFilterModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const
overridevirtual

Reimplemented from QSortFilterProxyModel.

Definition at line 99 of file qgsattributetablefiltermodel.cpp.

◆ layer()

QgsVectorLayer* QgsAttributeTableFilterModel::layer ( ) const
inline

Returns the layer this filter acts on.

Returns
Abovementioned layer

Definition at line 136 of file qgsattributetablefiltermodel.h.

◆ layerCache()

QgsVectorLayerCache* QgsAttributeTableFilterModel::layerCache ( ) const
inline

Returns the layerCache this filter acts on.

Returns
The layer cache

Definition at line 143 of file qgsattributetablefiltermodel.h.

◆ lessThan()

bool QgsAttributeTableFilterModel::lessThan ( const QModelIndex left,
const QModelIndex right 
) const
overrideprotectedvirtual

Used by the sorting algorithm.

Compares the two model indices. Will also consider the selection state of the feature in case selected features are to be shown on top.

Reimplemented from QSortFilterProxyModel.

Definition at line 43 of file qgsattributetablefiltermodel.cpp.

◆ mapCanvas()

QgsMapCanvas* QgsAttributeTableFilterModel::mapCanvas ( ) const
inline

Returns the map canvas.

Definition at line 199 of file qgsattributetablefiltermodel.h.

◆ mapFromMaster()

QModelIndex QgsAttributeTableFilterModel::mapFromMaster ( const QModelIndex sourceIndex) const
inline

Definition at line 167 of file qgsattributetablefiltermodel.h.

◆ mapFromSource()

QModelIndex QgsAttributeTableFilterModel::mapFromSource ( const QModelIndex sourceIndex) const
overridevirtual

Reimplemented from QSortFilterProxyModel.

Definition at line 513 of file qgsattributetablefiltermodel.cpp.

◆ mapToMaster()

QModelIndex QgsAttributeTableFilterModel::mapToMaster ( const QModelIndex proxyIndex) const
inline

Definition at line 165 of file qgsattributetablefiltermodel.h.

◆ mapToSource()

QModelIndex QgsAttributeTableFilterModel::mapToSource ( const QModelIndex proxyIndex) const
overridevirtual

Reimplemented from QSortFilterProxyModel.

Definition at line 498 of file qgsattributetablefiltermodel.cpp.

◆ masterModel()

QgsAttributeTableModel* QgsAttributeTableFilterModel::masterModel ( ) const
inline

Returns the table model this filter is using.

Returns
the table model in quesion

Definition at line 150 of file qgsattributetablefiltermodel.h.

◆ rowToId()

QgsFeatureId QgsAttributeTableFilterModel::rowToId ( const QModelIndex row)

Returns the feature id for a given model index.

Parameters
rowA model index of the row in question
Returns
The feature id of the feature visible in the provided row

Definition at line 477 of file qgsattributetablefiltermodel.cpp.

◆ selectedOnTop()

bool QgsAttributeTableFilterModel::selectedOnTop ( )

Returns if selected features are currently shown on top.

Returns
True if selected are shown on top

Definition at line 278 of file qgsattributetablefiltermodel.cpp.

◆ setAttributeTableConfig()

void QgsAttributeTableFilterModel::setAttributeTableConfig ( const QgsAttributeTableConfig config)

Set the attribute table configuration to control which fields are shown, in which order they are shown as well as if and where an action column is shown.

Definition at line 131 of file qgsattributetablefiltermodel.cpp.

◆ setFilteredFeatures()

void QgsAttributeTableFilterModel::setFilteredFeatures ( const QgsFeatureIds ids)
virtual

Specify a list of features, which the filter will accept.

The filter mode will automatically be adjusted to show only these features (ShowFilteredList).

Parameters
idsThe list of feature ids which will be accepted by the filter

Definition at line 283 of file qgsattributetablefiltermodel.cpp.

◆ setFilterMode()

void QgsAttributeTableFilterModel::setFilterMode ( FilterMode  filterMode)

Set the filter mode the filter will use.

Parameters
filterModeSets the current mode of the filter

Definition at line 301 of file qgsattributetablefiltermodel.cpp.

◆ setSelectedOnTop()

void QgsAttributeTableFilterModel::setSelectedOnTop ( bool  selectedOnTop)

Changes the sort order of the features.

If set to true, selected features will be sorted on top, regardless of the current sort column

Parameters
selectedOnTopSpecify, if selected features should be sorted on top

Definition at line 237 of file qgsattributetablefiltermodel.cpp.

◆ setSourceModel()

void QgsAttributeTableFilterModel::setSourceModel ( QgsAttributeTableModel sourceModel)

Set the attribute table model that backs this model.

Parameters
sourceModelThe model
Note
added in 2.0

Definition at line 257 of file qgsattributetablefiltermodel.cpp.

◆ sort() [1/2]

void QgsAttributeTableFilterModel::sort ( int  column,
Qt::SortOrder  order = Qt::AscendingOrder 
)
overridevirtual

Sort by the given column using the given order.

Prefetches all the data from the layer to speed up sorting.

Parameters
columnThe column which should be sorted
orderThe order ( Qt::AscendingOrder or Qt::DescendingOrder )

Reimplemented from QSortFilterProxyModel.

Definition at line 70 of file qgsattributetablefiltermodel.cpp.

◆ sort() [2/2]

void QgsAttributeTableFilterModel::sort ( QString  expression,
Qt::SortOrder  order = Qt::AscendingOrder 
)

Sort by the given expression using the given order.

Prefetches all the data from the layer to speed up sorting.

Parameters
expressionThe expression which should be used for sorting
orderThe order ( Qt::AscendingOrder or Qt::DescendingOrder )

Definition at line 222 of file qgsattributetablefiltermodel.cpp.

◆ sortColumnChanged

void QgsAttributeTableFilterModel::sortColumnChanged ( int  column,
Qt::SortOrder  order 
)
signal

Is emitted whenever the sort column is changed.

Parameters
columnThe sort column
orderThe sort order

◆ sortExpression()

QString QgsAttributeTableFilterModel::sortExpression ( ) const

The expression which is used to sort the attribute table.

Definition at line 232 of file qgsattributetablefiltermodel.cpp.

Friends And Related Function Documentation

◆ TestQgsAttributeTable

friend class TestQgsAttributeTable
friend

Definition at line 271 of file qgsattributetablefiltermodel.h.


The documentation for this class was generated from the following files: