KD Reports API Documentation  2.2
Public Member Functions | List of all members
KDReports::TextElement Class Reference

#include <KDReportsTextElement.h>

Inheritance diagram for KDReports::TextElement:
KDReports::Element

Public Member Functions

 TextElement (const QString &string=QString())
 
 TextElement (const TextElement &other)
 
 ~TextElement () override
 
void build (ReportBuilder &builder) const override
 
Elementclone () const override
 
QFont font () const
 
QString id () const
 
TextElementoperator<< (const QString &)
 
TextElementoperator= (const TextElement &other)
 
void setBold (bool bold)
 Set font attribute: bold. More...
 
void setFont (const QFont &)
 
void setFontFamily (const QString &family)
 Set font attribute: family. More...
 
void setId (const QString &id)
 
void setItalic (bool italic)
 Set font attribute: italic. More...
 
void setPointSize (qreal size)
 Set font attribute: size in points. Can be integer or decimal. More...
 
void setStrikeOut (bool strikeout)
 Set font attribute: strike out. More...
 
void setText (const QString &text)
 
void setTextColor (const QColor &color)
 
void setUnderline (bool underline)
 Set font attribute: underline. More...
 
QString text () const
 
QColor textColor () const
 
- Public Member Functions inherited from KDReports::Element
virtual ~Element ()
 
QBrush background () const
 
void setBackground (const QBrush &brush)
 

Additional Inherited Members

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

Detailed Description

The KDReports::TextElement class represents text in the report. This is one way to insert rich text into the report (the other way is with HtmlElement).

Definition at line 30 of file KDReportsTextElement.h.

Constructor & Destructor Documentation

◆ TextElement() [1/2]

KDReports::TextElement::TextElement ( const QString &  string = QString())
explicit

Creates a text element.

Definition at line 37 of file KDReportsTextElement.cpp.

◆ ~TextElement()

KDReports::TextElement::~TextElement ( )
override

Destroys this text element.

Definition at line 59 of file KDReportsTextElement.cpp.

◆ TextElement() [2/2]

KDReports::TextElement::TextElement ( const TextElement other)

Copies a text element. The text and settings are copied over.

Definition at line 44 of file KDReportsTextElement.cpp.

Member Function Documentation

◆ build()

void KDReports::TextElement::build ( ReportBuilder builder) const
overridevirtual

◆ clone()

KDReports::Element * KDReports::TextElement::clone ( ) const
overridevirtual

Implements KDReports::Element.

Definition at line 167 of file KDReportsTextElement.cpp.

◆ font()

QFont KDReports::TextElement::font ( ) const
Returns
all font attribute
Since
1.4

Definition at line 187 of file KDReportsTextElement.cpp.

◆ id()

QString KDReports::TextElement::id ( ) const
Returns
the ID associated with this text element.
Since
1.2

Definition at line 177 of file KDReportsTextElement.cpp.

◆ operator<<()

KDReports::TextElement & KDReports::TextElement::operator<< ( const QString &  str)

Adds more text to the text in this element.

Definition at line 106 of file KDReportsTextElement.cpp.

◆ operator=()

KDReports::TextElement & KDReports::TextElement::operator= ( const TextElement other)

Copies the text and settings from another text element.

Definition at line 50 of file KDReportsTextElement.cpp.

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

◆ setBold()

void KDReports::TextElement::setBold ( bool  bold)

Set font attribute: bold.

Definition at line 122 of file KDReportsTextElement.cpp.

◆ setFont()

void KDReports::TextElement::setFont ( const QFont &  font)

Set multiple font attributes with a single call.

Note that (since KDReports 1.6), when Qt is 5.3 or more, the font attributes that are not explicitly specified in this font, will be resolved against the report's default font, rather than being resolved against the application's font.

Definition at line 151 of file KDReportsTextElement.cpp.

◆ setFontFamily()

void KDReports::TextElement::setFontFamily ( const QString &  family)

Set font attribute: family.

Definition at line 117 of file KDReportsTextElement.cpp.

◆ setId()

void KDReports::TextElement::setId ( const QString &  id)

Set the ID associated with this text element.

Since
1.2

Definition at line 172 of file KDReportsTextElement.cpp.

◆ setItalic()

void KDReports::TextElement::setItalic ( bool  italic)

Set font attribute: italic.

Definition at line 128 of file KDReportsTextElement.cpp.

◆ setPointSize()

void KDReports::TextElement::setPointSize ( qreal  size)

Set font attribute: size in points. Can be integer or decimal.

Definition at line 146 of file KDReportsTextElement.cpp.

◆ setStrikeOut()

void KDReports::TextElement::setStrikeOut ( bool  strikeout)

Set font attribute: strike out.

Definition at line 140 of file KDReportsTextElement.cpp.

◆ setText()

void KDReports::TextElement::setText ( const QString &  text)

Sets the full text in this element.

Definition at line 112 of file KDReportsTextElement.cpp.

◆ setTextColor()

void KDReports::TextElement::setTextColor ( const QColor &  color)

Set the text color.

Since
1.1

Definition at line 157 of file KDReportsTextElement.cpp.

◆ setUnderline()

void KDReports::TextElement::setUnderline ( bool  underline)

Set font attribute: underline.

Definition at line 134 of file KDReportsTextElement.cpp.

◆ text()

QString KDReports::TextElement::text ( ) const
Returns
the text associated with this text element.
Since
1.4

Definition at line 182 of file KDReportsTextElement.cpp.

◆ textColor()

QColor KDReports::TextElement::textColor ( ) const
Returns
the text color.
Since
1.4

Definition at line 162 of file KDReportsTextElement.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