A model for displaying columns shown in a QgsComposerAttributeTableV2.
More...
#include <qgscomposerattributetablemodelv2.h>
Public Member Functions |
| | QgsComposerAttributeTableColumnModelV2 (QgsComposerAttributeTableV2 *composerTable, QObject *parent=0) |
| | Constructor for QgsComposerAttributeTableColumnModel.
|
| virtual | ~QgsComposerAttributeTableColumnModelV2 () |
| virtual int | rowCount (const QModelIndex &parent=QModelIndex()) 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 |
| virtual bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
| Qt::ItemFlags | flags (const QModelIndex &index) const |
| bool | removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
| bool | insertRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
| QModelIndex | index (int row, int column, const QModelIndex &parent) const |
| QModelIndex | parent (const QModelIndex &child) const |
| bool | moveRow (int row, ShiftDirection direction) |
| | Moves the specified row up or down in the model.
|
| void | resetToLayer () |
| | Resets the attribute table's columns to match the source layer's fields.
|
| QgsComposerTableColumn * | columnFromIndex (const QModelIndex &index) const |
| | Returns the QgsComposerTableColumn corresponding to an index in the model.
|
| QModelIndex | indexFromColumn (QgsComposerTableColumn *column) |
| | Returns a QModelIndex corresponding to a QgsComposerTableColumn in the model.
|
| void | setColumnAsSorted (QgsComposerTableColumn *column, Qt::SortOrder order) |
| | Sets a specified column as a sorted column in the QgsComposerAttributeTable.
|
| void | setColumnAsUnsorted (QgsComposerTableColumn *column) |
| | Sets a specified column as an unsorted column in the QgsComposerAttributeTable.
|
| bool | moveColumnInSortRank (QgsComposerTableColumn *column, ShiftDirection direction) |
| | Moves a column up or down in the sort rank for the QgsComposerAttributeTable.
|
Detailed Description
A model for displaying columns shown in a QgsComposerAttributeTableV2.
Member Enumeration Documentation
Controls whether a row/column is shifted up or down
- Enumerator:
| ShiftUp |
shift the row/column up
|
| ShiftDown |
shift the row/column down
|
Constructor & Destructor Documentation
| QgsComposerAttributeTableColumnModelV2::QgsComposerAttributeTableColumnModelV2 |
( |
QgsComposerAttributeTableV2 * |
composerTable, |
|
|
QObject * |
parent = 0 |
|
) |
| |
| QgsComposerAttributeTableColumnModelV2::~QgsComposerAttributeTableColumnModelV2 |
( |
| ) |
|
|
virtual |
Member Function Documentation
| int QgsComposerAttributeTableColumnModelV2::columnCount |
( |
const QModelIndex & |
parent = QModelIndex() | ) |
const |
| QgsComposerTableColumn * QgsComposerAttributeTableColumnModelV2::columnFromIndex |
( |
const QModelIndex & |
index | ) |
const |
| QVariant QgsComposerAttributeTableColumnModelV2::data |
( |
const QModelIndex & |
index, |
|
|
int |
role |
|
) |
| const |
|
virtual |
| Qt::ItemFlags QgsComposerAttributeTableColumnModelV2::flags |
( |
const QModelIndex & |
index | ) |
const |
| QVariant QgsComposerAttributeTableColumnModelV2::headerData |
( |
int |
section, |
|
|
Qt::Orientation |
orientation, |
|
|
int |
role = Qt::DisplayRole |
|
) |
| const |
| QModelIndex QgsComposerAttributeTableColumnModelV2::index |
( |
int |
row, |
|
|
int |
column, |
|
|
const QModelIndex & |
parent |
|
) |
| const |
| bool QgsComposerAttributeTableColumnModelV2::insertRows |
( |
int |
row, |
|
|
int |
count, |
|
|
const QModelIndex & |
parent = QModelIndex() |
|
) |
| |
| bool QgsComposerAttributeTableColumnModelV2::moveRow |
( |
int |
row, |
|
|
ShiftDirection |
direction |
|
) |
| |
Moves the specified row up or down in the model.
Used for rearranging the attribute tables columns.
- Returns
- true if the move is allowed
- Parameters
-
| row | row in model representing attribute table column to move |
| direction | direction to move the attribute table column |
- Note
- added in 2.3
| QModelIndex QgsComposerAttributeTableColumnModelV2::parent |
( |
const QModelIndex & |
child | ) |
const |
| bool QgsComposerAttributeTableColumnModelV2::removeRows |
( |
int |
row, |
|
|
int |
count, |
|
|
const QModelIndex & |
parent = QModelIndex() |
|
) |
| |
| void QgsComposerAttributeTableColumnModelV2::resetToLayer |
( |
| ) |
|
Resets the attribute table's columns to match the source layer's fields.
Remove all existing attribute table columns and column customisations.
- Note
- added in 2.3
| int QgsComposerAttributeTableColumnModelV2::rowCount |
( |
const QModelIndex & |
parent = QModelIndex() | ) |
const |
|
virtual |
| void QgsComposerAttributeTableColumnModelV2::setColumnAsSorted |
( |
QgsComposerTableColumn * |
column, |
|
|
Qt::SortOrder |
order |
|
) |
| |
Sets a specified column as a sorted column in the QgsComposerAttributeTable.
The column will be added to the end of the sort rank list, ie it will take the next largest available sort rank.
- Parameters
-
- Note
- added in 2.3
- See Also
- removeColumnFromSort
-
moveColumnInSortRank
| bool QgsComposerAttributeTableColumnModelV2::setData |
( |
const QModelIndex & |
index, |
|
|
const QVariant & |
value, |
|
|
int |
role = Qt::EditRole |
|
) |
| |
|
virtual |
The documentation for this class was generated from the following files: