#include <qgsattributetablefiltermodel.h>
Public Slots |
void | extentsChanged () |
| Is called upon every change of the visible extents on the map canvas.
|
Protected Member Functions |
bool | filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const |
| Returns true if the source row will be accepted.
|
void | generateListOfVisibleFeatures () |
| Updates the list of currently visible features on the map canvas.
|
bool | lessThan (const QModelIndex &left, const QModelIndex &right) const |
| Used by the sorting algorithm.
|
virtual void | sort (int column, Qt::SortOrder order=Qt::AscendingOrder) |
| Sort by the given column using the given order.
|
Member Enumeration Documentation
- Enumerator:
ShowAll |
|
ShowSelected |
|
ShowVisible |
|
ShowFilteredList |
|
ShowEdited |
|
Constructor & Destructor Documentation
Make sure, the master model is already loaded, so the selection will get synchronized.
- Parameters
-
parent | parent object (owner) |
sourceModel | The QgsAttributeTableModel to use as source (mostly referred to as master model) |
canvas | The mapCanvas. Used to identify the currently visible features. |
Member Function Documentation
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.
QModelIndex QgsAttributeTableFilterModel::fidToIndex |
( |
QgsFeatureId |
fid | ) |
|
|
virtual |
QModelIndexList QgsAttributeTableFilterModel::fidToIndexList |
( |
QgsFeatureId |
fid | ) |
|
bool QgsAttributeTableFilterModel::filterAcceptsRow |
( |
int |
sourceRow, |
|
|
const QModelIndex & |
sourceParent |
|
) |
| const |
|
protected |
Returns true if the source row will be accepted.
- Parameters
-
sourceRow | row from the source model |
sourceParent | parent index in the source model |
FilterMode QgsAttributeTableFilterModel::filterMode |
( |
| ) |
|
|
inline |
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.
Returns the layer this filter acts on.
- Returns
- Abovementioned layer
Returns the layerCache this filter acts on.
- Returns
- The layer cache
bool QgsAttributeTableFilterModel::lessThan |
( |
const QModelIndex & |
left, |
|
|
const QModelIndex & |
right |
|
) |
| const |
|
protected |
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.
QModelIndex QgsAttributeTableFilterModel::mapFromMaster |
( |
const QModelIndex & |
sourceIndex | ) |
const |
|
virtual |
QModelIndex QgsAttributeTableFilterModel::mapToMaster |
( |
const QModelIndex & |
proxyIndex | ) |
const |
|
virtual |
Returns the table model this filter is using.
- Returns
- the table model in quesion
QgsFeatureId QgsAttributeTableFilterModel::rowToId |
( |
const QModelIndex & |
row | ) |
|
Returns the feature id for a given model index.
- Parameters
-
row | A model index of the row in question |
- Returns
- The feature id of the feature visible in the provided row
bool QgsAttributeTableFilterModel::selectedOnTop |
( |
| ) |
|
Returns if selected features are currently shown on top.
- Returns
- True if selected are shown on top
void QgsAttributeTableFilterModel::setFilteredFeatures |
( |
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
-
ids | The list of feature ids which will be accepted by the filter |
void QgsAttributeTableFilterModel::setFilterMode |
( |
FilterMode |
filterMode | ) |
|
Set the filter mode the filter will use.
- Parameters
-
filterMode | Sets the current mode of the filter |
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
-
selectedOnTop | Specify, if selected features should be sorted on top |
void QgsAttributeTableFilterModel::sort |
( |
int |
column, |
|
|
Qt::SortOrder |
order = Qt::AscendingOrder |
|
) |
| |
|
protectedvirtual |
Sort by the given column using the given order.
Prefetches all the data from the layer to speed up sorting.
- Parameters
-
column | The column which should be sorted |
order | The order ( Qt::AscendingOrder or Qt::DescendingOrder ) |
The documentation for this class was generated from the following files: