QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
Public Member Functions | Friends | List of all members
QgsLayoutTableColumn Class Reference

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

#include <qgslayouttablecolumn.h>

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...
 
Q_DECL_DEPRECATED 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 operator== (const QgsLayoutTableColumn &other)
 
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...
 
Q_DECL_DEPRECATED 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...
 
Q_DECL_DEPRECATED 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 a QgsLayoutTableColumn 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 126 of file qgslayouttablecolumn.h.

◆ clone()

Q_DECL_DEPRECATED QgsLayoutTableColumn* QgsLayoutTableColumn::clone ( )
inline

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

Returns
a new QgsLayoutTableColumn with same properties as this column.
Deprecated:
since QGIS 3.14 use a copy instead

Definition at line 190 of file qgslayouttablecolumn.h.

◆ 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 94 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 79 of file qgslayouttablecolumn.h.

◆ operator==()

bool QgsLayoutTableColumn::operator== ( const QgsLayoutTableColumn other)
inline

Definition at line 192 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 134 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 102 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 86 of file qgslayouttablecolumn.h.

◆ setSortByRank()

Q_DECL_DEPRECATED 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()
Deprecated:
since QGIS 3.14 the order is now hold in a dedicated model

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 152 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 118 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 72 of file qgslayouttablecolumn.h.

◆ sortByRank()

Q_DECL_DEPRECATED 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()
Deprecated:
since QGIS 3.14 the order is now hold in a dedicated model

Definition at line 168 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 143 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 110 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 66 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 214 of file qgslayouttablecolumn.h.


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