PrerenderedLabel is an internal KDChart class that simplifies creation and caching of cached text labels. More...
#include <KDChartTextLabelCache.h>
Public Member Functions | |
double | angle () const |
const QBrush & | brush () const |
const QFont & | font () const |
const QPen & | pen () const |
const QPixmap & | pixmap () const |
Returns the rendered element. | |
const QPointF & | position () const |
Get the position of the element. | |
PrerenderedLabel () | |
KDChartEnums::PositionValue | referencePoint () const |
Get the reference point of the element. | |
QPointF | referencePointLocation () const |
QPointF | referencePointLocation (KDChartEnums::PositionValue position) const |
Return the location of the reference point relatively to the pixmap's origin. | |
void | setAngle (double angle) |
Sets the angle of the label to angle degrees. | |
void | setBrush (const QBrush &brush) |
Sets the label's brush to brush. | |
void | setFont (const QFont &font) |
Sets the label's font to font. | |
void | setPen (const QPen &) |
void | setPosition (const QPointF &position) |
Set the position of the element. | |
void | setReferencePoint (KDChartEnums::PositionValue) |
Set the reference point of the element. | |
void | setText (const QString &text) |
Sets the label's text to text. | |
const QString & | text () const |
~PrerenderedLabel () | |
Protected Member Functions | |
void | invalidate () const |
Invalidates the preredendered data, forces re-rendering. |
PrerenderedLabel is an internal KDChart class that simplifies creation and caching of cached text labels.
It provides referenze points to anchor the text to other elements. Reference points use the positions defined in KDChartEnums.
Usage:
double angle = 90.0; CachedLabel label; label.paint( font, tr("Label"), angle );
Definition at line 97 of file KDChartTextLabelCache.h.
PrerenderedLabel::PrerenderedLabel | ( | ) |
Definition at line 77 of file KDChartTextLabelCache.cpp.
PrerenderedLabel::~PrerenderedLabel | ( | ) |
Definition at line 87 of file KDChartTextLabelCache.cpp.
References DUMP_CACHE_STATS.
double PrerenderedLabel::angle | ( | ) | const |
Definition at line 163 of file KDChartTextLabelCache.cpp.
const QBrush & PrerenderedLabel::brush | ( | ) | const |
Definition at line 146 of file KDChartTextLabelCache.cpp.
const QFont & PrerenderedLabel::font | ( | ) | const |
Definition at line 112 of file KDChartTextLabelCache.cpp.
void PrerenderedLabel::invalidate | ( | ) | const [protected, virtual] |
Invalidates the preredendered data, forces re-rendering.
Implements PrerenderedElement.
Definition at line 95 of file KDChartTextLabelCache.cpp.
Referenced by setAngle(), setBrush(), setFont(), and setText().
const QPen& PrerenderedLabel::pen | ( | ) | const |
const QPixmap & PrerenderedLabel::pixmap | ( | ) | const [virtual] |
Returns the rendered element.
If any of the properties have change, the element will be regenerated.
Implements PrerenderedElement.
Definition at line 168 of file KDChartTextLabelCache.cpp.
References INC_HIT_COUNT, and INC_MISS_COUNT.
Referenced by KDChart::TernaryAxis::paintCtx(), and KDChart::TernaryAxis::requiredMargins().
const QPointF & PrerenderedElement::position | ( | ) | const [inherited] |
Get the position of the element.
Definition at line 62 of file KDChartTextLabelCache.cpp.
Referenced by KDChart::TernaryAxis::paintCtx().
KDChartEnums::PositionValue PrerenderedElement::referencePoint | ( | ) | const [inherited] |
Get the reference point of the element.
Definition at line 72 of file KDChartTextLabelCache.cpp.
Referenced by referencePointLocation().
QPointF PrerenderedLabel::referencePointLocation | ( | ) | const |
Definition at line 282 of file KDChartTextLabelCache.cpp.
References PrerenderedElement::referencePoint().
QPointF PrerenderedLabel::referencePointLocation | ( | KDChartEnums::PositionValue | ) | const [virtual] |
Return the location of the reference point relatively to the pixmap's origin.
Implements PrerenderedElement.
Definition at line 287 of file KDChartTextLabelCache.cpp.
References INC_HIT_COUNT, INC_MISS_COUNT, KDChartEnums::PositionCenter, KDChartEnums::PositionEast, KDChartEnums::PositionFloating, KDChartEnums::PositionNorth, KDChartEnums::PositionNorthEast, KDChartEnums::PositionNorthWest, KDChartEnums::PositionSouth, KDChartEnums::PositionSouthEast, KDChartEnums::PositionSouthWest, and KDChartEnums::PositionUnknown.
Referenced by KDChart::TernaryAxis::paintCtx(), and KDChart::TernaryAxis::requiredMargins().
void PrerenderedLabel::setAngle | ( | double | angle | ) |
Sets the angle of the label to angle degrees.
Definition at line 154 of file KDChartTextLabelCache.cpp.
References invalidate().
void PrerenderedLabel::setBrush | ( | const QBrush & | brush | ) |
Sets the label's brush to brush.
Definition at line 137 of file KDChartTextLabelCache.cpp.
References invalidate().
void PrerenderedLabel::setFont | ( | const QFont & | font | ) |
Sets the label's font to font.
Definition at line 103 of file KDChartTextLabelCache.cpp.
References invalidate().
void PrerenderedLabel::setPen | ( | const QPen & | ) |
void PrerenderedElement::setPosition | ( | const QPointF & | position | ) | [inherited] |
Set the position of the element.
Definition at line 57 of file KDChartTextLabelCache.cpp.
void PrerenderedElement::setReferencePoint | ( | KDChartEnums::PositionValue | point | ) | [inherited] |
Set the reference point of the element.
Every element has nine possible reference points (all compass directions, plus the center.
Definition at line 67 of file KDChartTextLabelCache.cpp.
void PrerenderedLabel::setText | ( | const QString & | text | ) |
Sets the label's text to text.
Definition at line 120 of file KDChartTextLabelCache.cpp.
References invalidate().
Referenced by KDChart::TernaryAxis::setPosition(), KDChart::TernaryAxis::setTitleText(), and KDChart::TernaryAxis::TernaryAxis().
const QString & PrerenderedLabel::text | ( | ) | const |
Definition at line 129 of file KDChartTextLabelCache.cpp.
Referenced by KDChart::TernaryAxis::titleText().