QGIS API Documentation  3.11.0-Master (68611307d7)
Public Member Functions | Friends | List of all members
QgsLayoutTableColumn Class Reference

Stores properties of a column for a QgsLayoutTable. More...

#include <qgslayouttablecolumn.h>

Inheritance diagram for QgsLayoutTableColumn:
Inheritance graph
[legend]

Public Member Functions

 QgsLayoutTableColumn (const QString &heading=QString())
 Constructor for QgsLayoutTableColumn. More...
 
QString attribute () const
 Returns the attribute name or expression used for the column's values. More...
 
QgsLayoutTableColumnclone ()
 Creates a duplicate column which is a deep copy of this column. More...
 
Qt::AlignmentFlag hAlignment () const
 Returns the horizontal alignment for a column, which controls the alignment used for drawing column values within cells. More...
 
QString heading () const
 Returns the heading for a column, which is the value displayed in the column's header cell. More...
 
bool readXml (const QDomElement &columnElem)
 Reads the column's properties from xml. More...
 
void setAttribute (const QString &attribute)
 Sets the attribute name or expression used for the column's values. 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...
 
void setHeading (const QString &heading)
 Sets the heading for a column, which is the value displayed in the column's header cell. More...
 
void setSortByRank (int rank)
 Sets the sort rank for the column. More...
 
void setSortOrder (Qt::SortOrder order)
 Sets the sort order for the column. More...
 
void setVAlignment (Qt::AlignmentFlag alignment)
 Sets the vertical alignment for a column, which controls the alignment used for drawing column values within cells. More...
 
void setWidth (const double width)
 Sets the width for a column in mm. More...
 
int sortByRank () const
 Returns the sort rank for the column. More...
 
Qt::SortOrder sortOrder () const
 Returns the sort order for the column. More...
 
Qt::AlignmentFlag vAlignment () const
 Returns the vertical alignment for a column, which controls the alignment used for drawing column values within cells. More...
 
double width () const
 Returns the width for the column in mm, or 0 if column width is automatically calculated. More...
 
bool writeXml (QDomElement &columnElem, QDomDocument &doc) const
 Writes the column's properties to xml for storage. More...
 

Friends

class QgsCompositionConverter
 

Detailed Description

Stores properties of a column for a QgsLayoutTable.

Some properties of aQgsLayoutTableColumn are applicable only in certain contexts. For instance, the attribute and setAttribute methods only have an effect for QgsLayoutItemAttributeTables, and have no effect for QgsLayoutItemTextTables.

Since
QGIS 3.0

Definition at line 36 of file qgslayouttablecolumn.h.

Constructor & Destructor Documentation

◆ QgsLayoutTableColumn()

QgsLayoutTableColumn::QgsLayoutTableColumn ( const QString &  heading = QString())

Constructor for QgsLayoutTableColumn.

Parameters
headingcolumn heading

Definition at line 22 of file qgslayouttablecolumn.cpp.

Member Function Documentation

◆ attribute()

QString QgsLayoutTableColumn::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 QgsLayoutItemAttributeTable.

Note
only applicable when used in a QgsLayoutItemAttributeTable
See also
setAttribute()

Definition at line 128 of file qgslayouttablecolumn.h.

◆ clone()

QgsLayoutTableColumn * QgsLayoutTableColumn::clone ( )

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

Returns
a new QgsLayoutTableColumn with same properties as this column.

Definition at line 79 of file qgslayouttablecolumn.cpp.

◆ hAlignment()

Qt::AlignmentFlag QgsLayoutTableColumn::hAlignment ( ) const
inline

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

See also
setHAlignment()
vAlignment()

Definition at line 96 of file qgslayouttablecolumn.h.

◆ heading()

QString QgsLayoutTableColumn::heading ( ) const
inline

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

See also
setHeading()

Definition at line 81 of file qgslayouttablecolumn.h.

◆ readXml()

bool QgsLayoutTableColumn::readXml ( const QDomElement &  columnElem)

Reads the column's properties from xml.

Parameters
columnElema QDomElement holding the column's desired properties.
See also
writeXml()

Definition at line 50 of file qgslayouttablecolumn.cpp.

◆ setAttribute()

void QgsLayoutTableColumn::setAttribute ( const 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 QgsLayoutItemAttributeTable.

Note
only applicable when used in a QgsLayoutItemAttributeTable
See also
attribute()

Definition at line 136 of file qgslayouttablecolumn.h.

◆ setHAlignment()

void QgsLayoutTableColumn::setHAlignment ( Qt::AlignmentFlag  alignment)
inline

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

See also
hAlignment()
setVAlignment()

Definition at line 104 of file qgslayouttablecolumn.h.

◆ setHeading()

void QgsLayoutTableColumn::setHeading ( const QString &  heading)
inline

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

See also
heading()

Definition at line 88 of file qgslayouttablecolumn.h.

◆ setSortByRank()

void QgsLayoutTableColumn::setSortByRank ( int  rank)
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 QgsLayoutItemAttributeTable. If the sort rank is <= 0 then the column is not being sorted.

Note
only applicable when used in a QgsLayoutItemAttributeTable
See also
sortByRank()
setSortOrder()

Definition at line 183 of file qgslayouttablecolumn.h.

◆ setSortOrder()

void QgsLayoutTableColumn::setSortOrder ( Qt::SortOrder  order)
inline

Sets the sort order for the column.

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

Note
only applicable when used in a QgsLayoutItemAttributeTable
See also
sortOrder()
setSortByRank()

Definition at line 154 of file qgslayouttablecolumn.h.

◆ setVAlignment()

void QgsLayoutTableColumn::setVAlignment ( Qt::AlignmentFlag  alignment)
inline

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

See also
vAlignment()
setHAlignment()

Definition at line 120 of file qgslayouttablecolumn.h.

◆ setWidth()

void QgsLayoutTableColumn::setWidth ( const double  width)
inline

Sets the width for a column in mm.

Set the width to 0 if the column width is to be automatically calculated.

See also
width()

Definition at line 74 of file qgslayouttablecolumn.h.

◆ sortByRank()

int QgsLayoutTableColumn::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 QgsLayoutItemAttributeTable.

If sort rank is <= 0 then the column is not being sorted.

Note
only applicable when used in a QgsLayoutItemAttributeTable
See also
setSortByRank()
sortOrder()

Definition at line 169 of file qgslayouttablecolumn.h.

◆ sortOrder()

Qt::SortOrder QgsLayoutTableColumn::sortOrder ( ) const
inline

Returns the sort order for the column.

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

Note
only applicable when used in a QgsLayoutItemAttributeTable
See also
setSortOrder()
sortByRank()

Definition at line 145 of file qgslayouttablecolumn.h.

◆ vAlignment()

Qt::AlignmentFlag QgsLayoutTableColumn::vAlignment ( ) const
inline

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

See also
setVAlignment()
hAlignment()

Definition at line 112 of file qgslayouttablecolumn.h.

◆ width()

double QgsLayoutTableColumn::width ( ) const
inline

Returns the width for the column in mm, or 0 if column width is automatically calculated.

See also
setWidth()

Definition at line 68 of file qgslayouttablecolumn.h.

◆ writeXml()

bool QgsLayoutTableColumn::writeXml ( QDomElement &  columnElem,
QDomDocument &  doc 
) const

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.
See also
readXml()

Definition at line 26 of file qgslayouttablecolumn.cpp.

Friends And Related Function Documentation

◆ QgsCompositionConverter

friend class QgsCompositionConverter
friend

Definition at line 202 of file qgslayouttablecolumn.h.


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