QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
QgsComposerAttributeTableColumnModelV2 Class Reference

A model for displaying columns shown in a QgsComposerAttributeTableV2. More...

#include <qgscomposerattributetablemodelv2.h>

Public Types

enum  ShiftDirection { ShiftUp, ShiftDown }

Public Member Functions

 QgsComposerAttributeTableColumnModelV2 (QgsComposerAttributeTableV2 *composerTable, QObject *parent=0)
 Constructor for QgsComposerAttributeTableColumnModel.
virtual ~QgsComposerAttributeTableColumnModelV2 ()
int columnCount (const QModelIndex &parent=QModelIndex()) const override
QgsComposerTableColumncolumnFromIndex (const QModelIndex &index) const
 Returns the QgsComposerTableColumn corresponding to an index in the model.
virtual QVariant data (const QModelIndex &index, int role) const override
Qt::ItemFlags flags (const QModelIndex &index) const override
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
QModelIndex index (int row, int column, const QModelIndex &parent) const override
QModelIndex indexFromColumn (QgsComposerTableColumn *column)
 Returns a QModelIndex corresponding to a QgsComposerTableColumn in the model.
bool insertRows (int row, int count, const QModelIndex &parent=QModelIndex()) override
bool moveColumnInSortRank (QgsComposerTableColumn *column, ShiftDirection direction)
 Moves a column up or down in the sort rank for the QgsComposerAttributeTable.
bool moveRow (int row, ShiftDirection direction)
 Moves the specified row up or down in the model.
QModelIndex parent (const QModelIndex &child) const override
bool removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) override
void resetToLayer ()
 Resets the attribute table's columns to match the source layer's fields.
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const override
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.
virtual bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override

Detailed Description

A model for displaying columns shown in a QgsComposerAttributeTableV2.

Definition at line 30 of file qgscomposerattributetablemodelv2.h.

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

Definition at line 38 of file qgscomposerattributetablemodelv2.h.

Constructor & Destructor Documentation

QgsComposerAttributeTableColumnModelV2::QgsComposerAttributeTableColumnModelV2 ( QgsComposerAttributeTableV2 composerTable,
QObject *  parent = 0 
)

Constructor for QgsComposerAttributeTableColumnModel.

Parameters
composerTableQgsComposerAttributeTable the model is attached to
parentoptional parent

Definition at line 26 of file qgscomposerattributetablemodelv2.cpp.

QgsComposerAttributeTableColumnModelV2::~QgsComposerAttributeTableColumnModelV2 ( )
virtual

Definition at line 32 of file qgscomposerattributetablemodelv2.cpp.

Member Function Documentation

int QgsComposerAttributeTableColumnModelV2::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 63 of file qgscomposerattributetablemodelv2.cpp.

QgsComposerTableColumn * QgsComposerAttributeTableColumnModelV2::columnFromIndex ( const QModelIndex &  index) const

Returns the QgsComposerTableColumn corresponding to an index in the model.

Returns
QgsComposerTableColumn for specified index
Parameters
indexa QModelIndex
Note
added in 2.3
See Also
indexFromColumn

Definition at line 305 of file qgscomposerattributetablemodelv2.cpp.

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

Definition at line 69 of file qgscomposerattributetablemodelv2.cpp.

Qt::ItemFlags QgsComposerAttributeTableColumnModelV2::flags ( const QModelIndex &  index) const
override

Definition at line 229 of file qgscomposerattributetablemodelv2.cpp.

QVariant QgsComposerAttributeTableColumnModelV2::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
override

Definition at line 140 of file qgscomposerattributetablemodelv2.cpp.

QModelIndex QgsComposerAttributeTableColumnModelV2::index ( int  row,
int  column,
const QModelIndex &  parent 
) const
override

Definition at line 37 of file qgscomposerattributetablemodelv2.cpp.

QModelIndex QgsComposerAttributeTableColumnModelV2::indexFromColumn ( QgsComposerTableColumn column)

Returns a QModelIndex corresponding to a QgsComposerTableColumn in the model.

Returns
QModelIndex for specified QgsComposerTableColumn
Parameters
columna QgsComposerTableColumn
Note
added in 2.3
See Also
columnFromIndex

Definition at line 311 of file qgscomposerattributetablemodelv2.cpp.

bool QgsComposerAttributeTableColumnModelV2::insertRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
override

Definition at line 259 of file qgscomposerattributetablemodelv2.cpp.

bool QgsComposerAttributeTableColumnModelV2::moveColumnInSortRank ( QgsComposerTableColumn column,
ShiftDirection  direction 
)

Moves a column up or down in the sort rank for the QgsComposerAttributeTable.

Parameters
columna QgsComposerTableColumn
directiondirection to move the column in the sort rank list
Note
added in 2.3
See Also
setColumnAsSorted

Definition at line 368 of file qgscomposerattributetablemodelv2.cpp.

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
rowrow in model representing attribute table column to move
directiondirection to move the attribute table column
Note
added in 2.3

Definition at line 273 of file qgscomposerattributetablemodelv2.cpp.

QModelIndex QgsComposerAttributeTableColumnModelV2::parent ( const QModelIndex &  child) const
override

Definition at line 49 of file qgscomposerattributetablemodelv2.cpp.

bool QgsComposerAttributeTableColumnModelV2::removeRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)
override

Definition at line 243 of file qgscomposerattributetablemodelv2.cpp.

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

Definition at line 298 of file qgscomposerattributetablemodelv2.cpp.

int QgsComposerAttributeTableColumnModelV2::rowCount ( const QModelIndex &  parent = QModelIndex()) const
overridevirtual

Definition at line 55 of file qgscomposerattributetablemodelv2.cpp.

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
columna QgsComposerTableColumn
ordersort order for column
Note
added in 2.3
See Also
removeColumnFromSort
moveColumnInSortRank

Definition at line 329 of file qgscomposerattributetablemodelv2.cpp.

void QgsComposerAttributeTableColumnModelV2::setColumnAsUnsorted ( QgsComposerTableColumn column)

Sets a specified column as an unsorted column in the QgsComposerAttributeTable.

The column will be removed from the sort rank list.

Parameters
columna QgsComposerTableColumn
Note
added in 2.3
See Also
setColumnAsSorted

Definition at line 351 of file qgscomposerattributetablemodelv2.cpp.

bool QgsComposerAttributeTableColumnModelV2::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
overridevirtual

Definition at line 180 of file qgscomposerattributetablemodelv2.cpp.


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