18#ifndef QGSLAYOUTTABLECOLUMN_H
19#define QGSLAYOUTTABLECOLUMN_H
21#include <QDomDocument>
53 bool writeXml( QDomElement &columnElem, QDomDocument &doc )
const;
60 bool readXml(
const QDomElement &columnElem );
67 double width()
const {
return mWidth; }
73 void setWidth(
const double width ) { mWidth = width; }
80 QString
heading()
const {
return mHeading; }
87 void setHeading(
const QString &heading ) { mHeading = heading; }
95 Qt::AlignmentFlag
hAlignment()
const {
return mHAlignment; }
103 void setHAlignment( Qt::AlignmentFlag alignment ) { mHAlignment = alignment; }
119 void setVAlignment( Qt::AlignmentFlag alignment ) { mVAlignment = alignment; }
135 void setAttribute(
const QString &attribute ) { mAttribute = attribute; }
195 return mHeading == other.mHeading
196 && mAttribute == other.mAttribute
197 && mSortByRank == other.mSortByRank
198 && mSortOrder == other.mSortOrder
199 && mWidth == other.mWidth
200 && mHAlignment == other.mHAlignment
201 && mVAlignment == other.mVAlignment;
206 SIP_PYOBJECT __repr__();
209 if ( sipCpp->heading() != sipCpp->attribute() && !sipCpp->heading().isEmpty() )
210 str = QStringLiteral(
"<QgsLayoutTableColumn: %1 (\"%2\")>" ).arg( sipCpp->attribute(), sipCpp->heading() );
212 str = QStringLiteral(
"<QgsLayoutTableColumn: %1>" ).arg( sipCpp->attribute() );
213 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
222 Qt::SortOrder mSortOrder = Qt::AscendingOrder;
224 QColor mBackgroundColor = Qt::transparent;
225 Qt::AlignmentFlag mHAlignment = Qt::AlignLeft;
226 Qt::AlignmentFlag mVAlignment = Qt::AlignVCenter;
QgsCompositionConverter class converts a QGIS 2.x composition to a QGIS 3.x layout.
Stores properties of a column for a QgsLayoutTable.
Q_DECL_DEPRECATED QgsLayoutTableColumn * clone()
Creates a duplicate column which is a deep copy of this column.
QString attribute() const
Returns the attribute name or expression used for the column's values.
void setVAlignment(Qt::AlignmentFlag alignment)
Sets the vertical alignment for a column, which controls the alignment used for drawing column values...
double width() const
Returns the width for the column in mm, or 0 if column width is automatically calculated.
Qt::AlignmentFlag vAlignment() const
Returns the vertical alignment for a column, which controls the alignment used for drawing column val...
QString heading() const
Returns the heading for a column, which is the value displayed in the column's header cell.
bool operator==(const QgsLayoutTableColumn &other) const
Q_DECL_DEPRECATED void setSortByRank(int rank)
Sets the sort rank for the column.
void setSortOrder(Qt::SortOrder order)
Sets the sort order for the column.
void setAttribute(const QString &attribute)
Sets the attribute name or expression used for the column's values.
Q_DECL_DEPRECATED int sortByRank() const
Returns the sort rank for the column.
Qt::SortOrder sortOrder() const
Returns the sort order for the column.
void setHAlignment(Qt::AlignmentFlag alignment)
Sets the horizontal alignment for a column, which controls the alignment used for drawing column valu...
void setHeading(const QString &heading)
Sets the heading for a column, which is the value displayed in the column's header cell.
Qt::AlignmentFlag hAlignment() const
Returns the horizontal alignment for a column, which controls the alignment used for drawing column v...
void setWidth(const double width)
Sets the width for a column in mm.