KD Reports API Documentation 2.2
Loading...
Searching...
No Matches
KDReportsTableLayout_p.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 KDREPORTSTABLELAYOUT_H
12#define KDREPORTSTABLELAYOUT_H
13
15#include <QFont>
16#include <QVector>
17
18QT_BEGIN_NAMESPACE
20QT_END_NAMESPACE
21
22namespace KDReports {
23
25{
26public:
28
29 void setInitialFontScalingFactor(qreal fontScalingFactor);
30
31 // Determine "ideal" column widths, based on contents
32 void updateColumnWidths();
33 // Return row height (determined during call to columnWidths), padding included
34 qreal rowHeight() const
35 {
36 return m_rowHeight;
37 }
38 // Return the width of the vertical header, 0 if not shown
39 qreal vHeaderWidth() const
40 {
41 return m_vHeaderWidth;
42 }
43 // Return the height of the horizontal header, 0 if not shown
44 qreal hHeaderHeight() const
45 {
46 return m_hHeaderHeight;
47 }
48
49 // void updateColumnWidthsByFactor( qreal factor );
50
52 {
53 return m_cellFontScaler.font();
54 }
56 {
57 return m_horizontalHeaderFontScaler.font();
58 }
60 {
61 return m_verticalHeaderFontScaler.font();
62 }
63
64 // QFontMetricsF scaledFontMetrics() const { return m_cellFontScaler.fontMetrics(); }
65 qreal scalingFactor() const
66 {
67 return m_cellFontScaler.scalingFactor();
68 }
70 void ensureScalingFactorForHeight(qreal maxRowHeight);
71 qreal scaledCellPadding() const
72 {
74 }
75
76 QSize decorationSize(const QVariant &cellDecoration) const;
77
79
83
86
87 // All measurements below are in pixels
91
93
95
96private:
97 qreal addIconWidth(qreal textWidth, const QVariant &cellDecoration) const;
98 void updateRowHeight();
99
100 qreal m_rowHeight;
101 qreal m_vHeaderWidth;
102 qreal m_hHeaderHeight;
103
104 FontScaler m_cellFontScaler;
105 FontScaler m_horizontalHeaderFontScaler;
106 FontScaler m_verticalHeaderFontScaler;
107};
108
109}
110
111#endif /* KDREPORTSTABLELAYOUT_H */
QAbstractItemModel * m_model
QSize decorationSize(const QVariant &cellDecoration) const
void ensureScalingFactorForHeight(qreal maxRowHeight)
void setInitialFontScalingFactor(qreal fontScalingFactor)
QVector< QString > m_widestTextPerColumn
void ensureScalingFactorForWidth(qreal scalingFactor)

© 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:15 for KD Reports API Documentation by doxygen 1.9.8