![]() |
KD Chart API Documentation
3.1
|
A set of text attributes. More...
#include <KDChartTextAttributes.h>
Public Member Functions | |
TextAttributes () | |
TextAttributes (const TextAttributes &) | |
~TextAttributes () | |
bool | autoRotate () const |
bool | autoShrink () const |
const QFont | calculatedFont (const QObject *autoReferenceArea, KDChartEnums::MeasureOrientation autoReferenceOrientation) const |
Returns the font in the size that is used at drawing time. More... | |
qreal | calculatedFontSize (const QObject *autoReferenceArea, KDChartEnums::MeasureOrientation autoReferenceOrientation) const |
Returns the font size that is used at drawing time. More... | |
qreal | calculatedFontSize (const QSizeF &referenceSize, KDChartEnums::MeasureOrientation autoReferenceOrientation) const |
Returns the font size that is used at drawing time. More... | |
QFont | font () const |
Measure | fontSize () const |
bool | hasAbsoluteFontSize () const |
bool | hasRotation () const |
bool | isVisible () const |
Measure | minimalFontSize () const |
bool | operator!= (const TextAttributes &other) const |
TextAttributes & | operator= (const TextAttributes &) |
bool | operator== (const TextAttributes &) const |
QPen | pen () const |
void | resetRotation () |
int | rotation () const |
void | setAutoRotate (bool autoRotate) |
void | setAutoShrink (bool autoShrink) |
void | setFont (const QFont &font) |
void | setFontSize (const Measure &measure) |
void | setMinimalFontSize (const Measure &measure) |
void | setPen (const QPen &pen) |
void | setRotation (int rotation) |
void | setTextDocument (QTextDocument *layout) |
void | setVisible (bool visible) |
QTextDocument * | textDocument () const |
A set of text attributes.
TextAttributes encapsulates settings that have to do with text. This includes font, fontsize, color, whether the text is rotated, etc
Definition at line 34 of file KDChartTextAttributes.h.
TextAttributes::TextAttributes | ( | ) |
Definition at line 56 of file KDChartTextAttributes.cpp.
TextAttributes::TextAttributes | ( | const TextAttributes & | r | ) |
Definition at line 61 of file KDChartTextAttributes.cpp.
TextAttributes::~TextAttributes | ( | ) |
Definition at line 76 of file KDChartTextAttributes.cpp.
bool TextAttributes::autoRotate | ( | ) | const |
Definition at line 192 of file KDChartTextAttributes.cpp.
References d.
Referenced by operator<<(), operator==(), KDChart::CartesianAxis::paintCtx(), and setAutoRotate().
bool TextAttributes::autoShrink | ( | ) | const |
Definition at line 202 of file KDChartTextAttributes.cpp.
References d.
Referenced by operator<<(), operator==(), and setAutoShrink().
const QFont TextAttributes::calculatedFont | ( | const QObject * | autoReferenceArea, |
KDChartEnums::MeasureOrientation | autoReferenceOrientation | ||
) | const |
Returns the font in the size that is used at drawing time.
This method is called at drawing time. It returns the font as it is used for rendering text, taking into account any measures that were set via setFontSize and/or setMinimalFontSize.
Definition at line 160 of file KDChartTextAttributes.cpp.
References calculatedFontSize(), and d.
Referenced by KDChart::LeveyJenningsDiagram::iconRect().
qreal TextAttributes::calculatedFontSize | ( | const QObject * | autoReferenceArea, |
KDChartEnums::MeasureOrientation | autoReferenceOrientation | ||
) | const |
Returns the font size that is used at drawing time.
This method is called at drawing time. It returns the font size as it is used for rendering text, taking into account any measures that were set via setFontSize and/or setMinimalFontSize.
Definition at line 152 of file KDChartTextAttributes.cpp.
References KDChart::Measure::calculatedValue(), fontSize(), and minimalFontSize().
qreal TextAttributes::calculatedFontSize | ( | const QSizeF & | referenceSize, |
KDChartEnums::MeasureOrientation | autoReferenceOrientation | ||
) | const |
Returns the font size that is used at drawing time.
This method is called at drawing time. It returns the font size as it is used for rendering text, taking into account any measures that were set via setFontSize and/or setMinimalFontSize.
Definition at line 140 of file KDChartTextAttributes.cpp.
References KDChart::Measure::calculatedValue(), fontSize(), and minimalFontSize().
Referenced by calculatedFont().
QFont TextAttributes::font | ( | ) | const |
Definition at line 109 of file KDChartTextAttributes.cpp.
References d.
Referenced by KDChart::RadarGrid::drawGrid(), operator<<(), operator==(), KDChart::RadarDiagram::paint(), setFont(), and KDChart::TextLayoutItem::setTextAttributes().
Measure TextAttributes::fontSize | ( | ) | const |
Definition at line 119 of file KDChartTextAttributes.cpp.
References d.
Referenced by KDChart::Chart::addHeaderFooter(), calculatedFontSize(), operator<<(), operator==(), and KDChart::CartesianAxis::titleTextAttributes().
bool TextAttributes::hasAbsoluteFontSize | ( | ) | const |
Definition at line 134 of file KDChartTextAttributes.cpp.
References d, and KDChartEnums::MeasureCalculationModeAbsolute.
bool TextAttributes::hasRotation | ( | ) | const |
Definition at line 224 of file KDChartTextAttributes.cpp.
References d.
bool TextAttributes::isVisible | ( | ) | const |
Definition at line 97 of file KDChartTextAttributes.cpp.
References d.
Referenced by KDChart::RadarGrid::drawGrid(), operator<<(), operator==(), KDChart::RadarDiagram::paint(), KDChart::LeveyJenningsAxis::paintAsAbscissa(), KDChart::LeveyJenningsAxis::paintAsOrdinate(), and KDChart::CartesianAxis::paintCtx().
Measure TextAttributes::minimalFontSize | ( | ) | const |
Definition at line 129 of file KDChartTextAttributes.cpp.
References d.
Referenced by calculatedFontSize(), operator<<(), and operator==().
|
inline |
Definition at line 41 of file KDChartTextAttributes.h.
References KDChart::operator==().
TextAttributes & TextAttributes::operator= | ( | const TextAttributes & | r | ) |
Definition at line 66 of file KDChartTextAttributes.cpp.
References d.
bool TextAttributes::operator== | ( | const TextAttributes & | r | ) | const |
Definition at line 82 of file KDChartTextAttributes.cpp.
References autoRotate(), autoShrink(), font(), fontSize(), isVisible(), minimalFontSize(), pen(), rotation(), and textDocument().
QPen TextAttributes::pen | ( | ) | const |
Definition at line 234 of file KDChartTextAttributes.cpp.
References d.
Referenced by KDChart::RadarGrid::drawGrid(), operator<<(), operator==(), KDChart::RadarDiagram::paint(), KDChart::LeveyJenningsAxis::paintAsOrdinate(), setPen(), and KDChart::LeveyJenningsAxis::setType().
void TextAttributes::resetRotation | ( | ) |
Definition at line 218 of file KDChartTextAttributes.cpp.
References d.
int TextAttributes::rotation | ( | ) | const |
Definition at line 213 of file KDChartTextAttributes.cpp.
References d.
Referenced by fitFontSizeToGeometry(), operator<<(), operator==(), KDChart::CartesianAxis::paintCtx(), and setRotation().
void TextAttributes::setAutoRotate | ( | bool | autoRotate | ) |
Set whether the text should be automatically rotated as needed when space is tight.
autoRotate | Whether text should be automatically rotated. |
Definition at line 187 of file KDChartTextAttributes.cpp.
References autoRotate(), and d.
void TextAttributes::setAutoShrink | ( | bool | autoShrink | ) |
Set whether the text should automatically be shrunk if space is tight.
autoShrink | Whether text should be auto-shrunk. |
Definition at line 197 of file KDChartTextAttributes.cpp.
References autoShrink(), and d.
void TextAttributes::setFont | ( | const QFont & | font | ) |
Set the font to be used for rendering the text.
font | The font to use. |
Definition at line 102 of file KDChartTextAttributes.cpp.
Referenced by KDChart::RadarGrid::drawGrid().
void TextAttributes::setFontSize | ( | const Measure & | measure | ) |
Set the size of the font used for rendering text.
measure | The measure to use. |
Definition at line 114 of file KDChartTextAttributes.cpp.
References d.
Referenced by KDChart::Chart::addHeaderFooter(), KDChart::RadarGrid::drawGrid(), KDChart::LeveyJenningsDiagram::iconRect(), and KDChart::CartesianAxis::titleTextAttributes().
void TextAttributes::setMinimalFontSize | ( | const Measure & | measure | ) |
Set the minimal size of the font used for rendering text.
measure | The measure to use. |
Definition at line 124 of file KDChartTextAttributes.cpp.
References d.
void TextAttributes::setPen | ( | const QPen & | pen | ) |
Set the pen to use for rendering the text.
pen | The pen to use. |
Definition at line 229 of file KDChartTextAttributes.cpp.
Referenced by KDChart::LeveyJenningsAxis::setType().
void TextAttributes::setRotation | ( | int | rotation | ) |
Set the rotation angle to use for the text.
rotation | The rotation angle. |
Definition at line 207 of file KDChartTextAttributes.cpp.
References d, and rotation().
Referenced by KDChart::CartesianAxis::paintCtx().
void TextAttributes::setTextDocument | ( | QTextDocument * | layout | ) |
Sets the document to use for the text. The previous document is deleted.
Definition at line 244 of file KDChartTextAttributes.cpp.
References d.
void TextAttributes::setVisible | ( | bool | visible | ) |
Set whether the text is to be rendered at all.
visible | Whether the text is visible. |
Definition at line 92 of file KDChartTextAttributes.cpp.
References d.
QTextDocument * TextAttributes::textDocument | ( | ) | const |
Definition at line 239 of file KDChartTextAttributes.cpp.
References d.
Referenced by operator==().