KD Reports  1.9
Classes | Public Member Functions | Protected Member Functions | List of all members
KDReports::AbstractTableElement Class Reference

#include <KDReportsAbstractTableElement.h>

Inheritance diagram for KDReports::AbstractTableElement:
Inheritance graph
[legend]
Collaboration diagram for KDReports::AbstractTableElement:
Collaboration graph
[legend]

Classes

struct  ColumnConstraint
 

Public Member Functions

void setBorder (qreal border)
 
qreal border () const
 
void setBorderBrush (const QBrush &brush)
 
QBrush borderBrush () const
 
void setPadding (qreal padding)
 
qreal padding () const
 
void setWidth (qreal width, Unit unit=Millimeters)
 
qreal width () const
 
Unit unit () const
 
void setDefaultFont (const QFont &font)
 
QFont defaultFont (bool *isSet) const
 
 AbstractTableElement (const AbstractTableElement &other)
 
AbstractTableElementoperator= (const AbstractTableElement &other)
 
void setColumnConstraints (const QVector< ColumnConstraint > &constraints)
 
- Public Member Functions inherited from KDReports::Element
virtual ~Element ()
 
void setBackground (const QBrush &brush)
 
QBrush background () const
 

Protected Member Functions

 AbstractTableElement ()
 
 ~AbstractTableElement () override
 
- Protected Member Functions inherited from KDReports::Element
 Element ()
 
 Element (const Element &other)
 
Elementoperator= (const Element &other)
 

Detailed Description

Base class for TableElement and AutoTableElement.

Constructor & Destructor Documentation

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

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

KDReports::AbstractTableElement::AbstractTableElement ( )
protected

Protected constructor, for derived classes only.

KDReports::AbstractTableElement::~AbstractTableElement ( )
overrideprotected

Destructor. Deletes internal data.

Member Function Documentation

qreal KDReports::AbstractTableElement::border ( ) const

Returns the width of the table border

QBrush KDReports::AbstractTableElement::borderBrush ( ) const

Returns the color (brush) of the table border

Since
1.2
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
AbstractTableElement& KDReports::AbstractTableElement::operator= ( const AbstractTableElement other)

Copies the table and settings from another table element.

qreal KDReports::AbstractTableElement::padding ( ) const

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

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.

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

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

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

Sets constraints on the column widths (fixed or proportional)

Parameters
constraintsvector of constraints
Since
1.9
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
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.

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.

Unit KDReports::AbstractTableElement::unit ( ) const
Returns
the width unit of the table.
Since
1.4
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

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

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/