KChart::TextAttributes
#include <KChartTextAttributes.h>
Public Member Functions | |
TextAttributes (const TextAttributes &) | |
bool | autoRotate () const |
bool | autoShrink () const |
const QFont | calculatedFont (const QObject *autoReferenceArea, KChartEnums::MeasureOrientation autoReferenceOrientation) const |
qreal | calculatedFontSize (const QObject *autoReferenceArea, KChartEnums::MeasureOrientation autoReferenceOrientation) const |
qreal | calculatedFontSize (const QSizeF &referenceSize, KChartEnums::MeasureOrientation autoReferenceOrientation) const |
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 |
Detailed Description
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 32 of file KChartTextAttributes.h.
Constructor & Destructor Documentation
◆ TextAttributes() [1/2]
TextAttributes::TextAttributes | ( | ) |
Definition at line 58 of file KChartTextAttributes.cpp.
◆ TextAttributes() [2/2]
TextAttributes::TextAttributes | ( | const TextAttributes & | r | ) |
Definition at line 63 of file KChartTextAttributes.cpp.
◆ ~TextAttributes()
TextAttributes::~TextAttributes | ( | ) |
Definition at line 79 of file KChartTextAttributes.cpp.
Member Function Documentation
◆ autoRotate()
bool TextAttributes::autoRotate | ( | ) | const |
- Returns
- Whether text is automatically rotated when space is tight.
Definition at line 205 of file KChartTextAttributes.cpp.
◆ autoShrink()
bool TextAttributes::autoShrink | ( | ) | const |
- Returns
- Whether text is automatically shrunk if space is tight.
Definition at line 215 of file KChartTextAttributes.cpp.
◆ calculatedFont()
const QFont TextAttributes::calculatedFont | ( | const QObject * | autoReferenceArea, |
KChartEnums::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 171 of file KChartTextAttributes.cpp.
◆ calculatedFontSize() [1/2]
qreal TextAttributes::calculatedFontSize | ( | const QObject * | autoReferenceArea, |
KChartEnums::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 163 of file KChartTextAttributes.cpp.
◆ calculatedFontSize() [2/2]
qreal TextAttributes::calculatedFontSize | ( | const QSizeF & | referenceSize, |
KChartEnums::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 KChartTextAttributes.cpp.
◆ font()
QFont TextAttributes::font | ( | ) | const |
- Returns
- The font that is used for rendering text.
Definition at line 121 of file KChartTextAttributes.cpp.
◆ fontSize()
Measure TextAttributes::fontSize | ( | ) | const |
- Returns
- The measure used for the font size.
Definition at line 131 of file KChartTextAttributes.cpp.
◆ hasAbsoluteFontSize()
bool TextAttributes::hasAbsoluteFontSize | ( | ) | const |
- Returns
- Whether the text has an absolute font size set.
Definition at line 146 of file KChartTextAttributes.cpp.
◆ hasRotation()
bool TextAttributes::hasRotation | ( | ) | const |
Definition at line 237 of file KChartTextAttributes.cpp.
◆ isVisible()
bool TextAttributes::isVisible | ( | ) | const |
- Returns
- Whether the text is visible.
Definition at line 109 of file KChartTextAttributes.cpp.
◆ minimalFontSize()
Measure TextAttributes::minimalFontSize | ( | ) | const |
- Returns
- The measure used for the minimal font size.
Definition at line 141 of file KChartTextAttributes.cpp.
◆ operator!=()
|
inline |
Definition at line 39 of file KChartTextAttributes.h.
◆ operator=()
TextAttributes & TextAttributes::operator= | ( | const TextAttributes & | r | ) |
Definition at line 69 of file KChartTextAttributes.cpp.
◆ operator==()
bool TextAttributes::operator== | ( | const TextAttributes & | r | ) | const |
Definition at line 85 of file KChartTextAttributes.cpp.
◆ pen()
QPen TextAttributes::pen | ( | ) | const |
- Returns
- The pen used for rendering the text.
Definition at line 247 of file KChartTextAttributes.cpp.
◆ resetRotation()
void TextAttributes::resetRotation | ( | ) |
Definition at line 231 of file KChartTextAttributes.cpp.
◆ rotation()
int TextAttributes::rotation | ( | ) | const |
- Returns
- The rotation angle used for rendering the text.
Definition at line 226 of file KChartTextAttributes.cpp.
◆ setAutoRotate()
void TextAttributes::setAutoRotate | ( | bool | autoRotate | ) |
Set whether the text should be automatically rotated as needed when space is tight.
- Parameters
-
autoRotate Whether text should be automatically rotated.
Definition at line 200 of file KChartTextAttributes.cpp.
◆ setAutoShrink()
void TextAttributes::setAutoShrink | ( | bool | autoShrink | ) |
Set whether the text should automatically be shrunk if space is tight.
- Parameters
-
autoShrink Whether text should be auto-shrunk.
Definition at line 210 of file KChartTextAttributes.cpp.
◆ setFont()
void TextAttributes::setFont | ( | const QFont & | font | ) |
Set the font to be used for rendering the text.
- Note
- All of the font's attributes will be used - except of its size! To specify the size please use setFontSize (or setMinimalFontSize, resp.)
- Parameters
-
font The font to use.
- See also
- setFontSize, setMinimalFontSize
Definition at line 114 of file KChartTextAttributes.cpp.
◆ setFontSize()
void TextAttributes::setFontSize | ( | const Measure & | measure | ) |
Set the size of the font used for rendering text.
- Parameters
-
measure The measure to use.
- See also
- Measure
Definition at line 126 of file KChartTextAttributes.cpp.
◆ setMinimalFontSize()
void TextAttributes::setMinimalFontSize | ( | const Measure & | measure | ) |
Set the minimal size of the font used for rendering text.
- Parameters
-
measure The measure to use.
- See also
- Measure
Definition at line 136 of file KChartTextAttributes.cpp.
◆ setPen()
void TextAttributes::setPen | ( | const QPen & | pen | ) |
Set the pen to use for rendering the text.
- Parameters
-
pen The pen to use.
Definition at line 242 of file KChartTextAttributes.cpp.
◆ setRotation()
void TextAttributes::setRotation | ( | int | rotation | ) |
Set the rotation angle to use for the text.
- Note
- For axis titles the rotation angle can be set to one of the following angles: 0, 90, 180, 270 Any other values specified will be replaced by the next smaller one of the allowed values, so no matter what you set the rotation will always be one of these four values.
- Parameters
-
rotation The rotation angle.
Definition at line 220 of file KChartTextAttributes.cpp.
◆ setTextDocument()
void TextAttributes::setTextDocument | ( | QTextDocument * | layout | ) |
Sets the document to use for the text.
The previous document is deleted.
Definition at line 257 of file KChartTextAttributes.cpp.
◆ setVisible()
void TextAttributes::setVisible | ( | bool | visible | ) |
Set whether the text is to be rendered at all.
- Parameters
-
visible Whether the text is visible.
Definition at line 104 of file KChartTextAttributes.cpp.
◆ textDocument()
QTextDocument * TextAttributes::textDocument | ( | ) | const |
- Returns
- The document used for the drawing the text or NULL if the default document is used.
Definition at line 252 of file KChartTextAttributes.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 4 2024 12:04:17 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.