KD Reports API Documentation  2.2
KDReportsMainTable.cpp
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 #include "KDReportsMainTable.h"
14 #include <QDebug>
15 
16 class KDReports::MainTablePrivate
17 {
18 public:
19  MainTablePrivate()
20  : m_element(nullptr)
21  , m_layout(nullptr)
22  {
23  }
24  AutoTableElement *m_element;
25  SpreadsheetReportLayout *m_layout;
26 };
27 
28 KDReports::MainTable::MainTable()
29  : d(new MainTablePrivate)
30 {
31 }
32 
33 KDReports::MainTable::~MainTable()
34 {
35  delete d->m_element;
36 }
37 
39 {
40  delete d->m_element;
41  d->m_element = new AutoTableElement(element);
42 
43  d->m_layout->setModel(element.tableModel());
44  d->m_layout->setVerticalHeaderVisible(element.isVerticalHeaderVisible());
45  d->m_layout->setHorizontalHeaderVisible(element.isHorizontalHeaderVisible());
46  d->m_layout->setCellPadding(element.padding()); // in mm
47  d->m_layout->setIconSize(element.iconSize());
48  d->m_layout->setCellBorder(element.border(), element.borderBrush());
49  d->m_layout->setHeaderBackground(element.headerBackground());
50 }
51 
53 {
54  return d->m_element;
55 }
56 
58 {
59  d->m_layout->setTableBreakingPageOrder(pageOrder);
60 }
61 
63 {
64  return d->m_layout->tableBreakingPageOrder();
65 }
66 
67 void KDReports::MainTable::setLayout(SpreadsheetReportLayout *layout)
68 {
69  d->m_layout = layout;
70 }
71 
73 {
74  d->m_layout->setHorizontalHeaderFont(font);
75 }
76 
78 {
79  d->m_layout->setVerticalHeaderFont(font);
80 }
81 
82 QList<QRect> KDReports::MainTable::pageRects() const
83 {
84  d->m_layout->ensureLayouted();
85  return d->m_layout->m_pageRects;
86 }
87 
88 qreal KDReports::MainTable::lastAutoFontScalingFactor() const
89 {
90  return d->m_layout->m_tableLayout.scalingFactor();
91 }
QAbstractItemModel * tableModel() const
void setVerticalHeaderFont(const QFont &font)
void setAutoTableElement(const AutoTableElement &element)
Report::TableBreakingPageOrder tableBreakingPageOrder() const
void setHorizontalHeaderFont(const QFont &font)
void setTableBreakingPageOrder(Report::TableBreakingPageOrder pageOrder)
AutoTableElement * autoTableElement() const

© 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