KD Reports API Documentation 2.2
Loading...
Searching...
No Matches
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
18QT_BEGIN_NAMESPACE
20class QTextDocument;
21class QTextTableCell;
23QT_END_NAMESPACE
24
25namespace KDReports {
26class AutoTableElementPrivate;
27
36class KDREPORTS_EXPORT AutoTableElement : public AbstractTableElement
37{
38public:
44 explicit AutoTableElement(QAbstractItemModel *tableModel);
45
50 explicit AutoTableElement(const QString &modelKey);
51
55 ~AutoTableElement() override;
56
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
175private:
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 on Wed Apr 24 2024 04:08:14 for KD Reports API Documentation by doxygen 1.9.8