KD Reports  1.8
Public Member Functions | List of all members
KDReports::TextElement Class Reference

#include <KDReportsTextElement.h>

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

Public Member Functions

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

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).

Constructor & Destructor Documentation

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

Creates a text element.

virtual KDReports::TextElement::~TextElement ( )
virtual

Destroys this text element.

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

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

Member Function Documentation

QFont KDReports::TextElement::font ( ) const
Returns
all font attribute
Since
1.4
QString KDReports::TextElement::id ( ) const
Returns
the ID associated with this text element.
Since
1.2
TextElement& KDReports::TextElement::operator<< ( const QString &  )

Adds more text to the text in this element.

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

Copies the text and settings from another text element.

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

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.

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

Set the ID associated with this text element.

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

Sets the full text in this element.

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

Set the text color.

Since
1.1
QString KDReports::TextElement::text ( ) const
Returns
the text associated with this text element.
Since
1.4
QColor KDReports::TextElement::textColor ( ) const
Returns
the text color.
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/