QGIS API Documentation  2.10.1-Pisa
 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>

Inheritance diagram for QgsComposerAttributeTableColumnModelV2:
Inheritance graph
[legend]

Public Types

enum  ShiftDirection { ShiftUp, ShiftDown }
 

Public Member Functions

 QgsComposerAttributeTableColumnModelV2 (QgsComposerAttributeTableV2 *composerTable, QObject *parent=0)
 Constructor for QgsComposerAttributeTableColumnModel. More...
 
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. More...
 
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. More...
 
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. More...
 
bool moveRow (int row, ShiftDirection direction)
 Moves the specified row up or down in the model. More...
 
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. More...
 
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. More...
 
void setColumnAsUnsorted (QgsComposerTableColumn *column)
 Sets a specified column as an unsorted column in the QgsComposerAttributeTable. More...
 
virtual bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
- Public Member Functions inherited from QAbstractTableModel
 QAbstractTableModel (QObject *parent)
 
 ~QAbstractTableModel ()
 
virtual bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
 
- Public Member Functions inherited from QAbstractItemModel
 QAbstractItemModel (QObject *parent)
 
virtual  ~QAbstractItemModel ()
 
virtual QModelIndex buddy (const QModelIndex &index) const
 
virtual bool canFetchMore (const QModelIndex &parent) const
 
virtual int columnCount (const QModelIndex &parent) const =0
 
void columnsAboutToBeInserted (const QModelIndex &parent, int start, int end)
 
void columnsAboutToBeMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn)
 
void columnsAboutToBeRemoved (const QModelIndex &parent, int start, int end)
 
void columnsInserted (const QModelIndex &parent, int start, int end)
 
void columnsMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn)
 
void columnsRemoved (const QModelIndex &parent, int start, int end)
 
virtual QVariant data (const QModelIndex &index, int role) const =0
 
void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)
 
virtual void fetchMore (const QModelIndex &parent)
 
virtual bool hasChildren (const QModelIndex &parent) const
 
bool hasIndex (int row, int column, const QModelIndex &parent) const
 
void headerDataChanged (Qt::Orientation orientation, int first, int last)
 
virtual QModelIndex index (int row, int column, const QModelIndex &parent) const =0
 
bool insertColumn (int column, const QModelIndex &parent)
 
virtual bool insertColumns (int column, int count, const QModelIndex &parent)
 
bool insertRow (int row, const QModelIndex &parent)
 
virtual QMap< int, QVariantitemData (const QModelIndex &index) const
 
void layoutAboutToBeChanged ()
 
void layoutChanged ()
 
virtual QModelIndexList match (const QModelIndex &start, int role, const QVariant &value, int hits, QFlags< Qt::MatchFlag > flags) const
 
virtual QMimeDatamimeData (const QModelIndexList &indexes) const
 
virtual QStringList mimeTypes () const
 
void modelAboutToBeReset ()
 
void modelReset ()
 
virtual QModelIndex parent (const QModelIndex &index) const =0
 
bool removeColumn (int column, const QModelIndex &parent)
 
virtual bool removeColumns (int column, int count, const QModelIndex &parent)
 
bool removeRow (int row, const QModelIndex &parent)
 
virtual void revert ()
 
const QHash< int, QByteArray > & roleNames () const
 
virtual int rowCount (const QModelIndex &parent) const =0
 
void rowsAboutToBeInserted (const QModelIndex &parent, int start, int end)
 
void rowsAboutToBeMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
 
void rowsAboutToBeRemoved (const QModelIndex &parent, int start, int end)
 
void rowsInserted (const QModelIndex &parent, int start, int end)
 
void rowsMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
 
void rowsRemoved (const QModelIndex &parent, int start, int end)
 
virtual bool setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role)
 
virtual bool setItemData (const QModelIndex &index, const QMap< int, QVariant > &roles)
 
void setSupportedDragActions (QFlags< Qt::DropAction > actions)
 
QModelIndex sibling (int row, int column, const QModelIndex &index) const
 
virtual void sort (int column, Qt::SortOrder order)
 
virtual QSize span (const QModelIndex &index) const
 
virtual bool submit ()
 
Qt::DropActions supportedDragActions () const
 
virtual Qt::DropActions supportedDropActions () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThreadthread () const
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Protected Member Functions inherited from QAbstractItemModel
void beginInsertColumns (const QModelIndex &parent, int first, int last)
 
void beginInsertRows (const QModelIndex &parent, int first, int last)
 
bool beginMoveColumns (const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationChild)
 
bool beginMoveRows (const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationChild)
 
void beginRemoveColumns (const QModelIndex &parent, int first, int last)
 
void beginRemoveRows (const QModelIndex &parent, int first, int last)
 
void beginResetModel ()
 
void changePersistentIndex (const QModelIndex &from, const QModelIndex &to)
 
void changePersistentIndexList (const QModelIndexList &from, const QModelIndexList &to)
 
QModelIndex createIndex (int row, int column, void *ptr) const
 
QModelIndex createIndex (int row, int column, int id) const
 
QModelIndex createIndex (int row, int column, quint32 id) const
 
void endInsertColumns ()
 
void endInsertRows ()
 
void endMoveColumns ()
 
void endMoveRows ()
 
void endRemoveColumns ()
 
void endRemoveRows ()
 
void endResetModel ()
 
QModelIndexList persistentIndexList () const
 
void reset ()
 
void resetInternalData ()
 
void setRoleNames (const QHash< int, QByteArray > &roleNames)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

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
overridevirtual

Reimplemented from QAbstractItemModel.

Definition at line 229 of file qgscomposerattributetablemodelv2.cpp.

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

Reimplemented from QAbstractItemModel.

Definition at line 140 of file qgscomposerattributetablemodelv2.cpp.

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

Reimplemented from QAbstractTableModel.

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() 
)
overridevirtual

Reimplemented from QAbstractItemModel.

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() 
)
overridevirtual

Reimplemented from QAbstractItemModel.

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

Reimplemented from QAbstractItemModel.

Definition at line 180 of file qgscomposerattributetablemodelv2.cpp.


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