KD Reports API Documentation
2.2
|
#include <KDReportsTextElement.h>
Public Member Functions | |
TextElement (const QString &string=QString()) | |
TextElement (const TextElement &other) | |
~TextElement () override | |
void | build (ReportBuilder &builder) const override |
Element * | clone () const override |
QFont | font () const |
QString | id () const |
TextElement & | operator<< (const QString &) |
TextElement & | operator= (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) | |
Element & | operator= (const Element &other) |
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.
|
explicit |
Creates a text element.
Definition at line 37 of file KDReportsTextElement.cpp.
|
override |
Destroys this text element.
Definition at line 59 of file KDReportsTextElement.cpp.
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.
|
overridevirtual |
Implements KDReports::Element.
Definition at line 63 of file KDReportsTextElement.cpp.
References KDReports::cleanupVariableProperties(), KDReports::ReportBuilder::currentDocumentData(), KDReports::ReportBuilder::cursor(), and KDReports::TextDocumentData::setTextValueMarker().
Referenced by KDReports::ReportBuilder::addVariable().
|
overridevirtual |
Implements KDReports::Element.
Definition at line 167 of file KDReportsTextElement.cpp.
QFont KDReports::TextElement::font | ( | ) | const |
QString KDReports::TextElement::id | ( | ) | const |
Definition at line 177 of file KDReportsTextElement.cpp.
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.
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=().
void KDReports::TextElement::setBold | ( | bool | bold | ) |
Set font attribute: bold.
Definition at line 122 of file KDReportsTextElement.cpp.
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.
void KDReports::TextElement::setFontFamily | ( | const QString & | family | ) |
Set font attribute: family.
Definition at line 117 of file KDReportsTextElement.cpp.
void KDReports::TextElement::setId | ( | const QString & | id | ) |
Set the ID associated with this text element.
Definition at line 172 of file KDReportsTextElement.cpp.
void KDReports::TextElement::setItalic | ( | bool | italic | ) |
Set font attribute: italic.
Definition at line 128 of file KDReportsTextElement.cpp.
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.
void KDReports::TextElement::setStrikeOut | ( | bool | strikeout | ) |
Set font attribute: strike out.
Definition at line 140 of file KDReportsTextElement.cpp.
void KDReports::TextElement::setText | ( | const QString & | text | ) |
Sets the full text in this element.
Definition at line 112 of file KDReportsTextElement.cpp.
void KDReports::TextElement::setTextColor | ( | const QColor & | color | ) |
void KDReports::TextElement::setUnderline | ( | bool | underline | ) |
Set font attribute: underline.
Definition at line 134 of file KDReportsTextElement.cpp.
QString KDReports::TextElement::text | ( | ) | const |
Definition at line 182 of file KDReportsTextElement.cpp.
QColor KDReports::TextElement::textColor | ( | ) | const |