KD Reports API Documentation
2.0
|
#include <KDReportsAbstractTableElement.h>
Classes | |
struct | ColumnConstraint |
Public Member Functions | |
qreal | border () const |
QBrush | borderBrush () const |
QFont | defaultFont (bool *isSet) const |
qreal | padding () const |
void | setBorder (qreal border) |
void | setBorderBrush (const QBrush &brush) |
void | setColumnConstraints (const QVector< ColumnConstraint > &constraints) |
void | setDefaultFont (const QFont &font) |
void | setPadding (qreal padding) |
void | setWidth (qreal width, Unit unit=Millimeters) |
Unit | unit () const |
qreal | width () const |
Public Member Functions inherited from KDReports::Element | |
virtual | ~Element () |
QBrush | background () const |
virtual void | build (ReportBuilder &) const =0 |
virtual Element * | clone () const =0 |
void | setBackground (const QBrush &brush) |
Protected Member Functions | |
AbstractTableElement () | |
AbstractTableElement (const AbstractTableElement &other) | |
~AbstractTableElement () override | |
void | fillTableFormat (QTextTableFormat &tableFormat, QTextCursor &textDocCursor) const |
AbstractTableElement & | operator= (const AbstractTableElement &other) |
Protected Member Functions inherited from KDReports::Element | |
Element () | |
Element (const Element &other) | |
Element & | operator= (const Element &other) |
Base class for TableElement and AutoTableElement.
Definition at line 38 of file KDReportsAbstractTableElement.h.
|
protected |
Protected constructor, for derived classes only.
Definition at line 45 of file KDReportsAbstractTableElement.cpp.
|
protected |
Copies a table element. The model and settings (and cell elements, when using addElement) are copied over.
Definition at line 51 of file KDReportsAbstractTableElement.cpp.
|
overrideprotected |
Destructor. Deletes internal data.
Definition at line 71 of file KDReportsAbstractTableElement.cpp.
qreal KDReports::AbstractTableElement::border | ( | ) | const |
Returns the width of the table border
Definition at line 81 of file KDReportsAbstractTableElement.cpp.
Referenced by KDReports::MainTable::setAutoTableElement(), and KDReports::TableBreakingSettingsDialog::TableBreakingSettingsDialog().
QBrush KDReports::AbstractTableElement::borderBrush | ( | ) | const |
Returns the color (brush) of the table border
Definition at line 91 of file KDReportsAbstractTableElement.cpp.
Referenced by KDReports::MainTable::setAutoTableElement().
QFont KDReports::AbstractTableElement::defaultFont | ( | bool * | isSet | ) | const |
isSet | set to true if a default font was set, false otherwise |
Definition at line 128 of file KDReportsAbstractTableElement.cpp.
|
protected |
Definition at line 134 of file KDReportsAbstractTableElement.cpp.
References KDReports::Millimeters, and KDReports::mmToPixels().
|
protected |
Copies the table and settings from another table element.
Definition at line 57 of file KDReportsAbstractTableElement.cpp.
References KDReports::Element::operator=().
Referenced by KDReports::AutoTableElement::operator=(), and KDReports::TableElement::operator=().
qreal KDReports::AbstractTableElement::padding | ( | ) | const |
Returns the width of the cell's internal padding in millimeters.
Definition at line 101 of file KDReportsAbstractTableElement.cpp.
Referenced by KDReports::MainTable::setAutoTableElement().
void KDReports::AbstractTableElement::setBorder | ( | qreal | border | ) |
Specifies the width of the border in pixels. The default border has a width of 1. Set it to 0 for a table without borders.
Definition at line 76 of file KDReportsAbstractTableElement.cpp.
void KDReports::AbstractTableElement::setBorderBrush | ( | const QBrush & | brush | ) |
Specifies the color (more generally, the brush) of the border.
Definition at line 86 of file KDReportsAbstractTableElement.cpp.
void KDReports::AbstractTableElement::setColumnConstraints | ( | const QVector< ColumnConstraint > & | constraints | ) |
Sets constraints on the column widths (fixed or proportional)
constraints | vector of constraints |
Definition at line 66 of file KDReportsAbstractTableElement.cpp.
void KDReports::AbstractTableElement::setDefaultFont | ( | const QFont & | font | ) |
Sets the default font used for text in this table. In WordProcessing mode, per-cell fonts can override this.
Definition at line 122 of file KDReportsAbstractTableElement.cpp.
void KDReports::AbstractTableElement::setPadding | ( | qreal | padding | ) |
Specifies the size of the padding in millimeters. Padding is the distance between the contents of the cell and the cell border, all around the contents (above, below, on the left and on the right). The default padding has a size of 0.5 mm.
Definition at line 96 of file KDReportsAbstractTableElement.cpp.
void KDReports::AbstractTableElement::setWidth | ( | qreal | width, |
Unit | unit = Millimeters |
||
) |
Sets the width of the table, in millimeters or as a percentage of the page width.
For instance, for a table that should stretch to the full width of the page, call setWidth(100, KDReports::Percent).
This is only available in WordProcessing mode.
Definition at line 106 of file KDReportsAbstractTableElement.cpp.
KDReports::Unit KDReports::AbstractTableElement::unit | ( | ) | const |
Definition at line 117 of file KDReportsAbstractTableElement.cpp.
qreal KDReports::AbstractTableElement::width | ( | ) | const |
Definition at line 112 of file KDReportsAbstractTableElement.cpp.