KD Reports API Documentation  2.2
KDReportsAutoTableElement.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 KDREPORTSAUTOTABLEELEMENT_H
12 #define KDREPORTSAUTOTABLEELEMENT_H
13 
15 #include <QtCore/QSize>
16 #include <functional>
17 
18 QT_BEGIN_NAMESPACE
19 class QAbstractItemModel;
20 class QTextDocument;
21 class QTextTableCell;
22 class QTextTableCellFormat;
23 QT_END_NAMESPACE
24 
25 namespace KDReports {
26 class AutoTableElementPrivate;
27 
37 {
38 public:
44  explicit AutoTableElement(QAbstractItemModel *tableModel);
45 
50  explicit AutoTableElement(const QString &modelKey);
51 
55  ~AutoTableElement() override;
56 
61  AutoTableElement(const AutoTableElement &other);
65  AutoTableElement &operator=(const AutoTableElement &other);
66 
71  QAbstractItemModel *tableModel() const;
72 
77  void setTableModel(QAbstractItemModel *tableModel);
78 
83  void setModelKey(const QString &modelKey);
84 
90  void setVerticalHeaderVisible(bool visible);
91 
96  void setHorizontalHeaderVisible(bool visible);
97 
102  bool isVerticalHeaderVisible() const;
103 
108  bool isHorizontalHeaderVisible() const;
109 
116  void setHeaderBackground(const QBrush &brush);
117 
122  QBrush headerBackground() const;
123 
124  using CellFormatFunc = std::function<void(int /*section number*/, QTextTableCellFormat &)>;
132  void setHorizontalHeaderFormatFunction(const CellFormatFunc &func);
133 
141  void setVerticalHeaderFormatFunction(const CellFormatFunc &func);
142 
150  void setIconSize(QSize iconSize);
151 
156  QSize iconSize() const;
157 
162  void build(ReportBuilder &) const override;
167  Element *clone() const override;
168 
169  enum Role
170  {
171  DecorationAlignmentRole = 0x2D535FB1,
172  NonBreakableLinesRole = 0x2D535FB2
173  };
174 
175 private:
176  std::unique_ptr<AutoTableElementPrivate> d;
177 };
178 
179 }
180 
181 #endif /* KDREPORTSAUTOTABLEELEMENT_H */
#define KDREPORTS_EXPORT
std::function< void(int, QTextTableCellFormat &)> CellFormatFunc

© 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