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

Allows for filtering QgsComposerAttributeTable columns by columns which are sorted or unsorted. More...

#include <qgscomposerattributetablemodelv2.h>

Public Types

enum  ColumnFilterType { ShowSortedColumns, ShowUnsortedColumns }

Public Member Functions

 QgsComposerTableSortColumnsProxyModelV2 (QgsComposerAttributeTableV2 *composerTable, ColumnFilterType filterType, QObject *parent=0)
 Constructor for QgsComposerTableSortColumnsProxyModel.
virtual ~QgsComposerTableSortColumnsProxyModelV2 ()
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)
QgsComposerTableColumncolumnFromRow (int row)
 Returns the QgsComposerTableColumn corresponding to a row in the proxy model.
QgsComposerTableColumncolumnFromIndex (const QModelIndex &index) const
 Returns the QgsComposerTableColumn corresponding to an index in the proxy model.
QgsComposerTableColumncolumnFromSourceIndex (const QModelIndex &sourceIndex) const
 Returns the QgsComposerTableColumn corresponding to an index from the source QgsComposerAttributeTableColumnModel model.
void resetFilter ()
 Invalidates the current filter used by the proxy model.

Protected Member Functions

bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const

Detailed Description

Allows for filtering QgsComposerAttributeTable columns by columns which are sorted or unsorted.

Member Enumeration Documentation

Controls whether the proxy model shows sorted or unsorted columns

Enumerator:
ShowSortedColumns 

show only sorted columns

ShowUnsortedColumns 

show only unsorted columns

Constructor & Destructor Documentation

QgsComposerTableSortColumnsProxyModelV2::QgsComposerTableSortColumnsProxyModelV2 ( QgsComposerAttributeTableV2 composerTable,
ColumnFilterType  filterType,
QObject *  parent = 0 
)

Constructor for QgsComposerTableSortColumnsProxyModel.

Parameters
composerTableQgsComposerAttributeTable the model is attached to
filterTypefilter for columns, controls whether sorted or unsorted columns are shown
parentoptional parent
QgsComposerTableSortColumnsProxyModelV2::~QgsComposerTableSortColumnsProxyModelV2 ( )
virtual

Member Function Documentation

int QgsComposerTableSortColumnsProxyModelV2::columnCount ( const QModelIndex &  parent = QModelIndex()) const
QgsComposerTableColumn * QgsComposerTableSortColumnsProxyModelV2::columnFromIndex ( const QModelIndex &  index) const

Returns the QgsComposerTableColumn corresponding to an index in the proxy model.

Returns
QgsComposerTableColumn for specified index
Parameters
indexa QModelIndex
Note
added in 2.3
See Also
columnFromRow
columnFromSourceIndex
QgsComposerTableColumn * QgsComposerTableSortColumnsProxyModelV2::columnFromRow ( int  row)

Returns the QgsComposerTableColumn corresponding to a row in the proxy model.

Returns
QgsComposerTableColumn for specified row
Parameters
rowa row number
Note
added in 2.3
See Also
columnFromIndex
QgsComposerTableColumn * QgsComposerTableSortColumnsProxyModelV2::columnFromSourceIndex ( const QModelIndex &  sourceIndex) const

Returns the QgsComposerTableColumn corresponding to an index from the source QgsComposerAttributeTableColumnModel model.

Returns
QgsComposerTableColumn for specified index from QgsComposerAttributeTableColumnModel
Parameters
sourceIndexa QModelIndex
Note
added in 2.3
See Also
columnFromRow
columnFromIndex
QVariant QgsComposerTableSortColumnsProxyModelV2::data ( const QModelIndex &  index,
int  role 
) const
virtual
bool QgsComposerTableSortColumnsProxyModelV2::filterAcceptsRow ( int  source_row,
const QModelIndex &  source_parent 
) const
protected
Qt::ItemFlags QgsComposerTableSortColumnsProxyModelV2::flags ( const QModelIndex &  index) const
QVariant QgsComposerTableSortColumnsProxyModelV2::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
bool QgsComposerTableSortColumnsProxyModelV2::lessThan ( const QModelIndex &  left,
const QModelIndex &  right 
) const
void QgsComposerTableSortColumnsProxyModelV2::resetFilter ( )

Invalidates the current filter used by the proxy model.

Note
added in 2.3
bool QgsComposerTableSortColumnsProxyModelV2::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
virtual

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