QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | List of all members
QgsComposerTableColumn Class Reference

Stores properties of a column in a QgsComposerTable. More...

#include <qgscomposertablecolumn.h>

Inheritance diagram for QgsComposerTableColumn:
Inheritance graph
[legend]

Public Member Functions

 QgsComposerTableColumn ()
 
virtual ~QgsComposerTableColumn ()
 
virtual bool writeXML (QDomElement &columnElem, QDomDocument &doc) const
 Writes the column's properties to xml for storage. More...
 
virtual bool readXML (const QDomElement &columnElem)
 Reads the column's properties from xml. More...
 
QString heading () const
 Returns the heading for a column, which is the value displayed in the columns header cell. More...
 
void setHeading (QString heading)
 Sets the heading for a column, which is the value displayed in the columns header cell. More...
 
Qt::AlignmentFlag hAlignment () const
 Returns the horizontal alignment for a column, which controls the alignment used for drawing column values within cells. More...
 
void setHAlignment (Qt::AlignmentFlag alignment)
 Sets the horizontal alignment for a column, which controls the alignment used for drawing column values within cells. More...
 
QString attribute () const
 Returns the attribute name or expression used for the column's values. More...
 
void setAttribute (QString attribute)
 Sets the attribute name or expression used for the column's values. More...
 
Qt::SortOrder sortOrder () const
 Returns the sort order for the column. More...
 
void setSortOrder (Qt::SortOrder sortOrder)
 Sets the sort order for the column. More...
 
int sortByRank () const
 Returns the sort rank for the column. More...
 
void setSortByRank (int sortByRank)
 Sets the sort rank for the column. More...
 
QgsComposerTableColumnclone ()
 Creates a duplicate column which is a deep copy of this column. More...
 

Detailed Description

Stores properties of a column in a QgsComposerTable.

Some properties of a QgsComposerTableColumn are applicable only in certain contexts. For instance, the attribute and setAttribute methods only have an effect for QgsComposerAttributeTables, and have no effect for QgsComposerTextTables.

Constructor & Destructor Documentation

QgsComposerTableColumn::QgsComposerTableColumn ( )
QgsComposerTableColumn::~QgsComposerTableColumn ( )
virtual

Member Function Documentation

QString QgsComposerTableColumn::attribute ( ) const
inline

Returns the attribute name or expression used for the column's values.

This property is only used when the column is part of a QgsComposerAttributeTable.

Returns
attribute name or expression text for column
Note
added in 2.3
only applicable when used in a QgsComposerAttributeTable
See also
setAttribute
QgsComposerTableColumn * QgsComposerTableColumn::clone ( )

Creates a duplicate column which is a deep copy of this column.

Returns
a new QgsComposerTableColumn with same properties as this column.
Note
added in 2.3
Qt::AlignmentFlag QgsComposerTableColumn::hAlignment ( ) const
inline

Returns the horizontal alignment for a column, which controls the alignment used for drawing column values within cells.

Returns
horizontal alignment.
Note
added in 2.3
See also
setHAlignment
QString QgsComposerTableColumn::heading ( ) const
inline

Returns the heading for a column, which is the value displayed in the columns header cell.

Returns
Heading for column.
Note
added in 2.3
See also
setHeading
bool QgsComposerTableColumn::readXML ( const QDomElement &  columnElem)
virtual

Reads the column's properties from xml.

Parameters
columnElema QDomElement holding the column's desired properties.
Note
added in 2.3
See also
writeXML
void QgsComposerTableColumn::setAttribute ( QString  attribute)
inline

Sets the attribute name or expression used for the column's values.

This property is only used when the column is part of a QgsComposerAttributeTable.

Parameters
attributeattribute name or expression text for column
Note
added in 2.3
only applicable when used in a QgsComposerAttributeTable
See also
attribute
void QgsComposerTableColumn::setHAlignment ( Qt::AlignmentFlag  alignment)
inline

Sets the horizontal alignment for a column, which controls the alignment used for drawing column values within cells.

Parameters
alignmenthorizontal alignment for cell.
Note
added in 2.3
See also
hAlignment
void QgsComposerTableColumn::setHeading ( QString  heading)
inline

Sets the heading for a column, which is the value displayed in the columns header cell.

Parameters
headingHeading for column.
Note
added in 2.3
See also
heading
void QgsComposerTableColumn::setSortByRank ( int  sortByRank)
inline

Sets the sort rank for the column.

If the sort rank is > 0 then the column will be sorted in the table. The sort rank specifies the priority given to the column when the table is sorted by multiple columns, with lower sort ranks having higher priority. This property is only used when the column is part of a QgsComposerAttributeTable.

Parameters
sortByRanksort rank for column. If sort rank is <= 0 then the column is not being sorted.
Note
added in 2.3
only applicable when used in a QgsComposerAttributeTable
See also
sortByRank
setSortOrder
void QgsComposerTableColumn::setSortOrder ( Qt::SortOrder  sortOrder)
inline

Sets the sort order for the column.

This property is only used when the column is part of a QgsComposerAttributeTable and when sortByRank is > 0.

Parameters
sortOrdersort order for column
Note
added in 2.3
only applicable when used in a QgsComposerAttributeTable
See also
sortOrder
setSortByRank
int QgsComposerTableColumn::sortByRank ( ) const
inline

Returns the sort rank for the column.

If the sort rank is > 0 then the column will be sorted in the table. The sort rank specifies the priority given to the column when the table is sorted by multiple columns, with lower sort ranks having higher priority. This property is only used when the column is part of a QgsComposerAttributeTable.

Returns
sort rank for column. If sort rank is <= 0 then the column is not being sorted.
Note
added in 2.3
only applicable when used in a QgsComposerAttributeTable
See also
setSortByRank
sortOrder
Qt::SortOrder QgsComposerTableColumn::sortOrder ( ) const
inline

Returns the sort order for the column.

This property is only used when the column is part of a QgsComposerAttributeTable and when sortByRank is > 0.

Returns
sort order for column
Note
added in 2.3
only applicable when used in a QgsComposerAttributeTable
See also
setSortOrder
sortByRank
bool QgsComposerTableColumn::writeXML ( QDomElement &  columnElem,
QDomDocument &  doc 
) const
virtual

Writes the column's properties to xml for storage.

Parameters
columnEleman existing QDomElement in which to store the column's properties.
docQDomDocument for the destination xml.
Note
added in 2.3
See also
readXML

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