KD Chart 2: KDChart::TextAttributes class Reference

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# KDChart::TextAttributes Class Reference

`#include <KDChartTextAttributes.h>`

List of all members.

## 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 50 of file KDChartTextAttributes.h.

## Public Member Functions
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.
const qreal | calculatedFontSize (const QObject *autoReferenceArea, KDChartEnums::MeasureOrientation autoReferenceOrientation) const
| Returns the font size that is used at drawing time.
QFont | font () const
Measure | fontSize () const
bool | hasAbsoluteFontSize () 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
int | rotation () const
void | setAutoRotate (bool autoRotate)
| Set whether the text should be automatically rotated as needed when space is constraint.
void | setAutoShrink (bool autoShrink)
| Set whether the text should automatically be shrunk, if space is constraint.
void | setFont (const QFont &font)
| Set the font to be used for rendering the text.
void | setFontSize (const Measure &measure)
| Set the size of the font used for rendering text.
void | setMinimalFontSize (const Measure &measure)
| Set the minimal size of the font used for rendering text.
void | setPen (const QPen &pen)
| Set the pen to use for rendering the text.
void | setRotation (int rotation)
| Set the rotation angle to use for the text.
void | setVisible (bool visible)
| Set whether the text is to be rendered at all.
| TextAttributes (const TextAttributes &)
| TextAttributes ()
| ~TextAttributes ()

## Constructor & Destructor Documentation

KDChart::TextAttributes::TextAttributes | ( |  | ) |

KDChart::TextAttributes::TextAttributes | ( | const TextAttributes & |  | ) |

KDChart::TextAttributes::~TextAttributes | ( |  | ) |

## Member Function Documentation

bool KDChart::TextAttributes::autoRotate | ( |  | ) | const

| Returns: Whether text is automatically rotated when space is constrained. Referenced by operator<<().

bool KDChart::TextAttributes::autoShrink | ( |  | ) | const

| Returns: Whether text is automatically shrunk if space is constraint. Referenced by operator<<().

const QFont KDChart::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. Referenced by KDChart::AbstractDiagram::paintDataValueText().

const qreal KDChart::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. Referenced by KDChart::Legend::buildLegend(), and KDChart::TextLayoutItem::realFontSize().

QFont KDChart::TextAttributes::font | ( |  | ) | const

| Returns: The font that is used for rendering text. Referenced by operator<<().

Measure KDChart::TextAttributes::fontSize | ( |  | ) | const

| Returns: The measure used for the font size. Referenced by KDChart::Chart::addLegend(), operator<<(), and KDChart::CartesianAxis::titleTextAttributes().

bool KDChart::TextAttributes::hasAbsoluteFontSize | ( |  | ) | const

| Returns: Whether the text has an absolute font size set.

bool KDChart::TextAttributes::isVisible | ( |  | ) | const

| Returns: Whether the text is visible. Referenced by KDChart::Legend::buildLegend(), KDChart::CartesianAxis::maximumSize(), operator<<(), KDChart::CartesianAxis::paintCtx(), and KDChart::AbstractDiagram::paintDataValueText().

Measure KDChart::TextAttributes::minimalFontSize | ( |  | ) | const

| Returns: The measure used for the minimal font size. Referenced by operator<<().

bool KDChart::TextAttributes::operator!= | ( | const TextAttributes & | other | ) | const

| Definition at line 57 of file KDChartTextAttributes.h.
    00058   { return !operator==(other); }

TextAttributes& KDChart::TextAttributes::operator= | ( | const TextAttributes & |  | ) |

bool KDChart::TextAttributes::operator== | ( | const TextAttributes & |  | ) | const

QPen KDChart::TextAttributes::pen | ( |  | ) | const

| Returns: The pen used for rendering the text. Referenced by operator<<(), KDChart::TextLayoutItem::paint(), and KDChart::AbstractDiagram::paintDataValueText().

int KDChart::TextAttributes::rotation | ( |  | ) | const

| Returns: The rotation angle used for rendering the text. Referenced by KDChart::TextLayoutItem::intersects(), operator<<(), KDChart::TextLayoutItem::paint(), and KDChart::AbstractDiagram::paintDataValueText().

void KDChart::TextAttributes::setAutoRotate | ( | bool | autoRotate | ) |

  | Set whether the text should be automatically rotated as needed when space is constraint. Parameters:
  autoRotate | Whether text should be automatically rotated.

void KDChart::TextAttributes::setAutoShrink | ( | bool | autoShrink | ) |

  | Set whether the text should automatically be shrunk, if space is constraint. Parameters:
  autoShrink | Whether text should be auto-shrunk.

void KDChart::TextAttributes::setFont | ( | const QFont & | font | ) |

  | Set the font to be used for rendering the text. Parameters:
  font | The font to use.

void KDChart::TextAttributes::setFontSize | ( | const Measure & | measure | ) |

  | Set the size of the font used for rendering text. Parameters:
  measure | The measure to use.
See also: Measure Referenced by KDChart::Chart::addLegend(), and KDChart::CartesianAxis::titleTextAttributes().

void KDChart::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

void KDChart::TextAttributes::setPen | ( | const QPen & | pen | ) |

  | Set the pen to use for rendering the text. Parameters:
  rotation | The pen to use.

void KDChart::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.

void KDChart::TextAttributes::setVisible | ( | bool | visible | ) |

  | Set whether the text is to be rendered at all. Parameters:
  visible | Whether the text is visible.

The documentation for this class was generated from the following file:

- KDChartTextAttributes.h