KD Reports API Documentation 2.2
|
#include <KDReportsTableElement.h>
Public Member Functions | |
TableElement () | |
TableElement (const TableElement &other) | |
~TableElement () override | |
void | build (ReportBuilder &) const override |
Cell & | cell (int row, int column) |
Element * | clone () const override |
int | headerColumnCount () const |
int | headerRowCount () const |
TableElement & | operator= (const TableElement &other) |
void | setHeaderColumnCount (int count) |
void | setHeaderRowCount (int count) |
The KDReports::TableElement class represents a table in the report. Use cell() to provide the contents for each cell of the table.
Use AutoTableElement instead if you have the data in a QAbstractItemModel.
Definition at line 26 of file KDReportsTableElement.h.
KDReports::TableElement::TableElement | ( | ) |
Creates an empty table. Text and other content can be added to the table cells using the cell() method. This must be done before the table is added to the report.
Definition at line 52 of file KDReportsTableElement.cpp.
|
override |
Destructor. Deletes internal data.
Definition at line 72 of file KDReportsTableElement.cpp.
KDReports::TableElement::TableElement | ( | const TableElement & | other | ) |
Copies a table element. Settings and cell elements are copied over.
Definition at line 57 of file KDReportsTableElement.cpp.
|
overridevirtual |
Implements KDReports::Element.
Definition at line 108 of file KDReportsTableElement.cpp.
References QTextBlockFormat::alignment(), KDReports::Element::background(), QTextCursor::blockFormat(), KDReports::Cell::build(), QTextTable::cellAt(), QTextCursor::charFormat(), KDReports::Cell::columnSpan(), KDReports::ReportBuilder::copyStateFrom(), KDReports::ReportBuilder::currentDocumentData(), KDReports::ReportBuilder::cursor(), QTextCursor::End, QTextTableCell::firstCursorPosition(), QTextCharFormat::font(), KDReports::HeaderColumnsProperty, QTextCursor::insertTable(), QTextTableCell::isValid(), QTextTable::mergeCells(), QTextCursor::movePosition(), Qt::NoBrush, KDReports::TextDocumentData::registerTable(), KDReports::ReportBuilder::report(), KDReports::Cell::rowSpan(), QTextTableFormat::setAlignment(), QTextFormat::setBackground(), QTextCursor::setCharFormat(), KDReports::ReportBuilder::setDefaultFont(), QTextTableCell::setFormat(), QTextTableFormat::setHeaderRowCount(), QTextFormat::setProperty(), and QBrush::style().
KDReports::Cell & KDReports::TableElement::cell | ( | int | row, |
int | column | ||
) |
Returns the reference to a cell in the table.
row | number, starting from 0 |
column | number, starting from 0 |
Definition at line 102 of file KDReportsTableElement.cpp.
|
overridevirtual |
Implements KDReports::Element.
Definition at line 76 of file KDReportsTableElement.cpp.
int KDReports::TableElement::headerColumnCount | ( | ) | const |
Definition at line 97 of file KDReportsTableElement.cpp.
int KDReports::TableElement::headerRowCount | ( | ) | const |
KDReports::TableElement & KDReports::TableElement::operator= | ( | const TableElement & | other | ) |
Copies the settings and cell elements from another table element.
Definition at line 63 of file KDReportsTableElement.cpp.
void KDReports::TableElement::setHeaderColumnCount | ( | int | count | ) |
Declares the first count
columns of the table as table header. The table header columns get repeated when a table is broken into multiple pages horizontally (see Report::scaleTo). The default number of header rows is 0.
Definition at line 92 of file KDReportsTableElement.cpp.
void KDReports::TableElement::setHeaderRowCount | ( | int | count | ) |
Declares the first count
rows of the table as table header. The table header rows get repeated when a table is broken across a page boundary. The default number of header rows is 0.
Definition at line 82 of file KDReportsTableElement.cpp.