KD Reports API Documentation  2.2
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
KDReports::AbstractTableElement Class Reference

#include <KDReportsAbstractTableElement.h>

Inheritance diagram for KDReports::AbstractTableElement:
KDReports::Element KDReports::AutoTableElement KDReports::TableElement

Classes

struct  ColumnConstraint
 

Public Types

enum  { Variable = Unit::Percent + 1 }
 

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 Elementclone () const =0
 
void setBackground (const QBrush &brush)
 

Protected Member Functions

 AbstractTableElement ()
 
 AbstractTableElement (const AbstractTableElement &other)
 
 ~AbstractTableElement () override
 
void fillTableFormat (QTextTableFormat &tableFormat, QTextCursor &textDocCursor) const
 
AbstractTableElementoperator= (const AbstractTableElement &other)
 
- Protected Member Functions inherited from KDReports::Element
 Element ()
 
 Element (const Element &other)
 
Elementoperator= (const Element &other)
 

Detailed Description

Base class for TableElement and AutoTableElement.

Definition at line 32 of file KDReportsAbstractTableElement.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Variable 

Definition at line 108 of file KDReportsAbstractTableElement.h.

Constructor & Destructor Documentation

◆ AbstractTableElement() [1/2]

KDReports::AbstractTableElement::AbstractTableElement ( )
protected

Protected constructor, for derived classes only.

Definition at line 32 of file KDReportsAbstractTableElement.cpp.

◆ AbstractTableElement() [2/2]

KDReports::AbstractTableElement::AbstractTableElement ( const AbstractTableElement other)
protected

Copies a table element. The model and settings (and cell elements, when using addElement) are copied over.

Definition at line 38 of file KDReportsAbstractTableElement.cpp.

◆ ~AbstractTableElement()

KDReports::AbstractTableElement::~AbstractTableElement ( )
overrideprotected

Destructor. Deletes internal data.

Definition at line 58 of file KDReportsAbstractTableElement.cpp.

Member Function Documentation

◆ border()

qreal KDReports::AbstractTableElement::border ( ) const

◆ borderBrush()

QBrush KDReports::AbstractTableElement::borderBrush ( ) const

Returns the color (brush) of the table border

Since
1.2

Definition at line 77 of file KDReportsAbstractTableElement.cpp.

Referenced by KDReports::MainTable::setAutoTableElement().

◆ defaultFont()

QFont KDReports::AbstractTableElement::defaultFont ( bool *  isSet) const
Returns
the default font set by setDefaultFont(), if any
Parameters
isSetset to true if a default font was set, false otherwise
Since
1.8

Definition at line 114 of file KDReportsAbstractTableElement.cpp.

◆ fillTableFormat()

void KDReports::AbstractTableElement::fillTableFormat ( QTextTableFormat &  tableFormat,
QTextCursor &  textDocCursor 
) const
protected

◆ operator=()

KDReports::AbstractTableElement & KDReports::AbstractTableElement::operator= ( const AbstractTableElement other)
protected

Copies the table and settings from another table element.

Definition at line 44 of file KDReportsAbstractTableElement.cpp.

References KDReports::Element::operator=().

Referenced by KDReports::AutoTableElement::operator=(), and KDReports::TableElement::operator=().

◆ padding()

qreal KDReports::AbstractTableElement::padding ( ) const

Returns the width of the cell's internal padding in millimeters.

Definition at line 87 of file KDReportsAbstractTableElement.cpp.

Referenced by KDReports::MainTable::setAutoTableElement().

◆ setBorder()

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 62 of file KDReportsAbstractTableElement.cpp.

◆ setBorderBrush()

void KDReports::AbstractTableElement::setBorderBrush ( const QBrush &  brush)

Specifies the color (more generally, the brush) of the border.

Since
1.2

Definition at line 72 of file KDReportsAbstractTableElement.cpp.

◆ setColumnConstraints()

void KDReports::AbstractTableElement::setColumnConstraints ( const QVector< ColumnConstraint > &  constraints)

Sets constraints on the column widths (for each column: fixed, proportional, or no constraint)

Parameters
constraintsvector of constraints
Since
1.9

Definition at line 53 of file KDReportsAbstractTableElement.cpp.

◆ setDefaultFont()

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.

Since
1.3

Definition at line 108 of file KDReportsAbstractTableElement.cpp.

◆ setPadding()

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 82 of file KDReportsAbstractTableElement.cpp.

◆ setWidth()

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 92 of file KDReportsAbstractTableElement.cpp.

◆ unit()

KDReports::Unit KDReports::AbstractTableElement::unit ( ) const
Returns
the width unit of the table.
Since
1.4

Definition at line 103 of file KDReportsAbstractTableElement.cpp.

◆ width()

qreal KDReports::AbstractTableElement::width ( ) const
Returns
the width of the table, in millimeters or as a percentage of the page width.
See also
unit
Since
1.4

Definition at line 98 of file KDReportsAbstractTableElement.cpp.


The documentation for this class was generated from the following files:

© 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