18 #ifndef QGSLAYOUTTABLECOLUMN_H
19 #define QGSLAYOUTTABLECOLUMN_H
21 #include <QDomDocument>
22 #include <QDomElement>
25 #include "qgis_core.h"
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; }
111 Qt::AlignmentFlag vAlignment()
const {
return mVAlignment; }
119 void setVAlignment( Qt::AlignmentFlag alignment ) { mVAlignment = alignment; }
127 QString attribute()
const {
return mAttribute; }
135 void setAttribute(
const QString &attribute ) { mAttribute = attribute; }
144 Qt::SortOrder sortOrder()
const {
return mSortOrder; }
153 void setSortOrder( Qt::SortOrder order ) { mSortOrder = order; }
169 Q_DECL_DEPRECATED
int sortByRank() const
SIP_DEPRECATED {
return mSortByRank; }
184 Q_DECL_DEPRECATED
void setSortByRank(
int rank )
SIP_DEPRECATED { mSortByRank = rank; }
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;
231 #endif //QGSLAYOUTTABLECOLUMN_H