KD Chart 2
[rev.2.7]
|
A set of text attributes. More...
#include <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. More... | |
qreal | calculatedFontSize (const QSizeF &referenceSize, KDChartEnums::MeasureOrientation autoReferenceOrientation) const |
Returns the font size that is used at drawing time. More... | |
const qreal | calculatedFontSize (const QObject *autoReferenceArea, 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) |
Set whether the text should be automatically rotated as needed when space is tight. More... | |
void | setAutoShrink (bool autoShrink) |
Set whether the text should automatically be shrunk if space is tight. More... | |
void | setFont (const QFont &font) |
Set the font to be used for rendering the text. More... | |
void | setFontSize (const Measure &measure) |
Set the size of the font used for rendering text. More... | |
void | setMinimalFontSize (const Measure &measure) |
Set the minimal size of the font used for rendering text. More... | |
void | setPen (const QPen &pen) |
Set the pen to use for rendering the text. More... | |
void | setRotation (int rotation) |
Set the rotation angle to use for the text. More... | |
void | setTextDocument (QTextDocument *layout) |
Sets the document to use for the text. More... | |
void | setVisible (bool visible) |
Set whether the text is to be rendered at all. More... | |
TextAttributes () | |
TextAttributes (const TextAttributes &) | |
QTextDocument * | textDocument () const |
~TextAttributes () | |
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 46 of file KDChartTextAttributes.h.
TextAttributes::TextAttributes | ( | ) |
Definition at line 72 of file KDChartTextAttributes.cpp.
TextAttributes::TextAttributes | ( | const TextAttributes & | r | ) |
Definition at line 77 of file KDChartTextAttributes.cpp.
TextAttributes::~TextAttributes | ( | ) |
Definition at line 93 of file KDChartTextAttributes.cpp.
bool TextAttributes::autoRotate | ( | ) | const |
Definition at line 219 of file KDChartTextAttributes.cpp.
References d.
Referenced by operator<<(), operator==(), KDChart::CartesianAxis::paintCtx(), and setAutoRotate().
bool TextAttributes::autoShrink | ( | ) | const |
Definition at line 229 of file KDChartTextAttributes.cpp.
References d.
Referenced by operator<<(), operator==(), KDChart::TextLayoutItem::paint(), 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 185 of file KDChartTextAttributes.cpp.
References calculatedFontSize(), d, and KDChart::CartesianCoordinatePlane::hasFixedDataCoordinateSpaceRelation().
Referenced by KDChart::LeveyJenningsDiagram::iconRect().
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 166 of file KDChartTextAttributes.cpp.
References KDChart::Measure::calculatedValue(), fontSize(), and minimalFontSize().
Referenced by calculatedFont(), KDChart::TextLayoutItem::realFontSize(), and updateToplevelLayout().
const 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 177 of file KDChartTextAttributes.cpp.
References KDChart::Measure::calculatedValue(), fontSize(), and minimalFontSize().
QFont TextAttributes::font | ( | ) | const |
Definition at line 135 of file KDChartTextAttributes.cpp.
References d.
Referenced by KDChart::TernaryAxis::hasDefaultTitleTextAttributes(), operator<<(), operator==(), KDChart::RadarDiagram::paint(), setFont(), KDChart::TextLayoutItem::setTextAttributes(), and updateToplevelLayout().
Measure TextAttributes::fontSize | ( | ) | const |
Definition at line 145 of file KDChartTextAttributes.cpp.
References d.
Referenced by calculatedFontSize(), operator<<(), operator==(), and KDChart::CartesianAxis::titleTextAttributes().
bool TextAttributes::hasAbsoluteFontSize | ( | ) | const |
Definition at line 160 of file KDChartTextAttributes.cpp.
References d, and KDChartEnums::MeasureCalculationModeAbsolute.
bool TextAttributes::hasRotation | ( | ) | const |
Definition at line 251 of file KDChartTextAttributes.cpp.
References d.
Referenced by KDChart::RingDiagram::resize().
bool TextAttributes::isVisible | ( | ) | const |
Definition at line 123 of file KDChartTextAttributes.cpp.
References d.
Referenced by KDChart::CartesianAxis::maximumSize(), operator<<(), operator==(), KDChart::RadarDiagram::paint(), KDChart::LeveyJenningsAxis::paintAsAbscissa(), KDChart::LeveyJenningsAxis::paintAsOrdinate(), KDChart::CartesianAxis::paintCtx(), and KDChart::CartesianAxis::titleSize().
Measure TextAttributes::minimalFontSize | ( | ) | const |
Definition at line 155 of file KDChartTextAttributes.cpp.
References d.
Referenced by calculatedFontSize(), operator<<(), operator==(), and rotatedRect().
bool KDChart::TextAttributes::operator!= | ( | const TextAttributes & | other | ) | const |
Definition at line 53 of file KDChartTextAttributes.h.
References KDCHART_DECLARE_PRIVATE_BASE_VALUE, KDCHART_DECLARE_SWAP_SPECIALISATION, KDChart::operator<<(), KDGantt::operator==(), and Q_DECLARE_TYPEINFO().
TextAttributes & TextAttributes::operator= | ( | const TextAttributes & | r | ) |
Definition at line 83 of file KDChartTextAttributes.cpp.
References d.
bool TextAttributes::operator== | ( | const TextAttributes & | r | ) | const |
Definition at line 99 of file KDChartTextAttributes.cpp.
References autoRotate(), autoShrink(), font(), fontSize(), isVisible(), minimalFontSize(), pen(), rotation(), and textDocument().
QPen TextAttributes::pen | ( | ) | const |
Definition at line 261 of file KDChartTextAttributes.cpp.
References d.
Referenced by operator<<(), operator==(), KDChart::RadarDiagram::paint(), KDChart::TextLayoutItem::paint(), KDChart::LeveyJenningsAxis::paintAsOrdinate(), setPen(), and KDChart::LeveyJenningsAxis::setType().
void TextAttributes::resetRotation | ( | ) |
Definition at line 245 of file KDChartTextAttributes.cpp.
References d.
int TextAttributes::rotation | ( | ) | const |
Definition at line 240 of file KDChartTextAttributes.cpp.
References d.
Referenced by fitFontSizeToGeometry(), KDChart::TextLayoutItem::marginWidth(), operator<<(), operator==(), KDChart::CartesianAxis::paint(), KDChart::TextLayoutItem::paint(), KDChart::CartesianAxis::paintCtx(), rotatedRect(), setRotation(), and KDChart::TextLayoutItem::sizeHint().
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 214 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 224 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 128 of file KDChartTextAttributes.cpp.
Referenced by KDChart::HeaderFooter::setParent(), and KDChart::Legend::~Legend().
void TextAttributes::setFontSize | ( | const Measure & | measure | ) |
Set the size of the font used for rendering text.
measure | The measure to use. |
Definition at line 140 of file KDChartTextAttributes.cpp.
References d.
Referenced by KDChart::Chart::addLegend(), KDChart::LeveyJenningsDiagram::iconRect(), KDChart::HeaderFooter::setParent(), KDChart::CartesianAxis::titleTextAttributes(), and KDChart::Legend::~Legend().
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 150 of file KDChartTextAttributes.cpp.
References d.
Referenced by KDChart::HeaderFooter::setParent(), and KDChart::Legend::~Legend().
void TextAttributes::setPen | ( | const QPen & | pen | ) |
Set the pen to use for rendering the text.
pen | The pen to use. |
Definition at line 256 of file KDChartTextAttributes.cpp.
Referenced by KDChart::HeaderFooter::setParent(), KDChart::LeveyJenningsAxis::setType(), wraparound(), and KDChart::Legend::~Legend().
void TextAttributes::setRotation | ( | int | rotation | ) |
Set the rotation angle to use for the text.
rotation | The rotation angle. |
Definition at line 234 of file KDChartTextAttributes.cpp.
References d, and rotation().
Referenced by KDChart::CartesianAxis::paint(), and KDChart::CartesianAxis::paintCtx().
void TextAttributes::setTextDocument | ( | QTextDocument * | layout | ) |
Sets the document to use for the text.
The previous document is deleted.
Definition at line 271 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 118 of file KDChartTextAttributes.cpp.
References d.
QTextDocument * TextAttributes::textDocument | ( | ) | const |
Definition at line 266 of file KDChartTextAttributes.cpp.
References d.
Referenced by operator==(), and KDChart::TextLayoutItem::paint().