KD Reports API Documentation  2.2
KDReportsAbstractTableElement.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** This file is part of the KD Reports library.
4 **
5 ** SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: MIT
8 **
9 ****************************************************************************/
10 
11 #ifndef KDREPORTSABSTRACTTABLEELEMENT_H
12 #define KDREPORTSABSTRACTTABLEELEMENT_H
13 
14 #include "KDReportsElement.h"
15 #include "KDReportsUnit.h"
16 
17 QT_BEGIN_NAMESPACE
18 template<typename T>
19 class QList;
20 class QFont;
21 class QTextTableFormat;
22 class QTextCursor;
23 QT_END_NAMESPACE
24 
25 namespace KDReports {
26 class AbstractTableElementPrivate;
27 
33 {
34 public:
40  void setBorder(qreal border);
41 
45  qreal border() const;
46 
51  void setBorderBrush(const QBrush &brush);
52 
57  QBrush borderBrush() const;
58 
65  void setPadding(qreal padding);
66 
70  qreal padding() const;
71 
79  void setWidth(qreal width, Unit unit = Millimeters);
80 
86  qreal width() const;
87 
92  Unit unit() const;
93 
99  void setDefaultFont(const QFont &font);
100 
106  QFont defaultFont(bool *isSet) const;
107 
108  enum // separate because we don't want "Variable" in other uses of Unit
109  {
110  Variable = Unit::Percent + 1
111  };
112 
114  {
116  : width(0)
117  , unit(static_cast<Unit>(Variable))
118  {
119  }
120  ColumnConstraint(qreal w, Unit u)
121  : width(w)
122  , unit(u)
123  {
124  }
125  qreal width;
127  };
128 
134  void setColumnConstraints(const QVector<ColumnConstraint> &constraints);
135 
136 protected:
141 
150  AbstractTableElement &operator=(const AbstractTableElement &other);
151 
155  ~AbstractTableElement() override;
156 
160  void fillTableFormat(QTextTableFormat &tableFormat, QTextCursor &textDocCursor) const;
161 
162 private:
163  std::unique_ptr<AbstractTableElementPrivate> d;
164 };
165 
166 }
167 
168 #endif /* KDREPORTSABSTRACTTABLEELEMENT_H */
#define KDREPORTS_EXPORT
@ Percent
Percentage of the text width, i.e. the page width minus margins.
Definition: KDReportsUnit.h:22
@ Millimeters
Millimeters (the default)
Definition: KDReportsUnit.h:21

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-reports/
Generated by doxygen 1.9.1