|
QGIS API Documentation
2.4.0-Chugiak
|
Allows for filtering QgsComposerAttributeTable columns by columns which are sorted or unsorted. More...
#include <qgscomposerattributetablemodel.h>


Public Types | |
| enum | ColumnFilterType { ShowSortedColumns, ShowUnsortedColumns } |
Public Member Functions | |
| QgsComposerTableSortColumnsProxyModel (QgsComposerAttributeTable *composerTable, ColumnFilterType filterType, QObject *parent=0) | |
| Constructor for QgsComposerTableSortColumnsProxyModel. More... | |
| virtual | ~QgsComposerTableSortColumnsProxyModel () |
| bool | lessThan (const QModelIndex &left, const QModelIndex &right) const |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const |
| virtual QVariant | data (const QModelIndex &index, int role) const |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
| Qt::ItemFlags | flags (const QModelIndex &index) const |
| virtual bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
| QgsComposerTableColumn * | columnFromRow (int row) |
| Returns the QgsComposerTableColumn corresponding to a row in the proxy model. More... | |
| QgsComposerTableColumn * | columnFromIndex (const QModelIndex &index) const |
| Returns the QgsComposerTableColumn corresponding to an index in the proxy model. More... | |
| QgsComposerTableColumn * | columnFromSourceIndex (const QModelIndex &sourceIndex) const |
| Returns the QgsComposerTableColumn corresponding to an index from the source QgsComposerAttributeTableColumnModel model. More... | |
| void | resetFilter () |
| Invalidates the current filter used by the proxy model. More... | |
Protected Member Functions | |
| bool | filterAcceptsRow (int source_row, const QModelIndex &source_parent) const |
Private Member Functions | |
| QList< QgsComposerTableColumn * > | columnsWithoutSortRank () const |
| Returns a list of QgsComposerTableColumns without a set sort rank. More... | |
Private Attributes | |
| QgsComposerAttributeTable * | mComposerTable |
| ColumnFilterType | mFilterType |
Allows for filtering QgsComposerAttributeTable columns by columns which are sorted or unsorted.
Definition at line 128 of file qgscomposerattributetablemodel.h.
Controls whether the proxy model shows sorted or unsorted columns
| Enumerator | |
|---|---|
| ShowSortedColumns |
show only sorted columns |
| ShowUnsortedColumns |
show only unsorted columns |
Definition at line 136 of file qgscomposerattributetablemodel.h.
| QgsComposerTableSortColumnsProxyModel::QgsComposerTableSortColumnsProxyModel | ( | QgsComposerAttributeTable * | composerTable, |
| ColumnFilterType | filterType, | ||
| QObject * | parent = 0 |
||
| ) |
Constructor for QgsComposerTableSortColumnsProxyModel.
| composerTable | QgsComposerAttributeTable the model is attached to |
| filterType | filter for columns, controls whether sorted or unsorted columns are shown |
| parent | optional parent |
Definition at line 404 of file qgscomposerattributetablemodel.cpp.
|
virtual |
Definition at line 412 of file qgscomposerattributetablemodel.cpp.
| int QgsComposerTableSortColumnsProxyModel::columnCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
Definition at line 470 of file qgscomposerattributetablemodel.cpp.
| QgsComposerTableColumn * QgsComposerTableSortColumnsProxyModel::columnFromIndex | ( | const QModelIndex & | index | ) | const |
Returns the QgsComposerTableColumn corresponding to an index in the proxy model.
| index | a QModelIndex |
Definition at line 440 of file qgscomposerattributetablemodel.cpp.
References columnFromSourceIndex().
Referenced by columnFromRow(), data(), and setData().
| QgsComposerTableColumn * QgsComposerTableSortColumnsProxyModel::columnFromRow | ( | int | row | ) |
Returns the QgsComposerTableColumn corresponding to a row in the proxy model.
| row | a row number |
Definition at line 589 of file qgscomposerattributetablemodel.cpp.
References columnFromIndex(), and index.
| QgsComposerTableColumn * QgsComposerTableSortColumnsProxyModel::columnFromSourceIndex | ( | const QModelIndex & | sourceIndex | ) | const |
Returns the QgsComposerTableColumn corresponding to an index from the source QgsComposerAttributeTableColumnModel model.
| sourceIndex | a QModelIndex |
Definition at line 447 of file qgscomposerattributetablemodel.cpp.
Referenced by columnFromIndex(), filterAcceptsRow(), and lessThan().
|
private |
Returns a list of QgsComposerTableColumns without a set sort rank.
|
virtual |
Definition at line 476 of file qgscomposerattributetablemodel.cpp.
References QgsComposerTableColumn::attribute(), columnFromIndex(), QgsComposerTableColumn::sortOrder(), and tr.
|
protected |
Definition at line 417 of file qgscomposerattributetablemodel.cpp.
References columnFromSourceIndex(), index, mFilterType, ShowSortedColumns, ShowUnsortedColumns, and QgsComposerTableColumn::sortByRank().
| Qt::ItemFlags QgsComposerTableSortColumnsProxyModel::flags | ( | const QModelIndex & | index | ) | const |
Definition at line 550 of file qgscomposerattributetablemodel.cpp.
| QVariant QgsComposerTableSortColumnsProxyModel::headerData | ( | int | section, |
| Qt::Orientation | orientation, | ||
| int | role = Qt::DisplayRole |
||
| ) | const |
Definition at line 516 of file qgscomposerattributetablemodel.cpp.
References mComposerTable, and tr.
| bool QgsComposerTableSortColumnsProxyModel::lessThan | ( | const QModelIndex & | left, |
| const QModelIndex & | right | ||
| ) | const |
Definition at line 455 of file qgscomposerattributetablemodel.cpp.
References columnFromSourceIndex(), and QgsComposerTableColumn::sortByRank().
| void QgsComposerTableSortColumnsProxyModel::resetFilter | ( | ) |
Invalidates the current filter used by the proxy model.
Definition at line 595 of file qgscomposerattributetablemodel.cpp.
|
virtual |
Definition at line 563 of file qgscomposerattributetablemodel.cpp.
References columnFromIndex(), mComposerTable, and QgsComposerTableColumn::setSortOrder().
|
private |
Definition at line 195 of file qgscomposerattributetablemodel.h.
Referenced by headerData(), and setData().
|
private |
Definition at line 196 of file qgscomposerattributetablemodel.h.
Referenced by filterAcceptsRow().
1.8.7