KD Chart API Documentation 3.1
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
PrerenderedLabel Class Reference

PrerenderedLabel is an internal KDChart class that simplifies creation and caching of cached text labels. More...

#include <KDChartTextLabelCache.h>

Inheritance diagram for PrerenderedLabel:
Inheritance graph
[legend]
Collaboration diagram for PrerenderedLabel:
Collaboration graph
[legend]

Public Member Functions

 PrerenderedLabel ()
 
 ~PrerenderedLabel () override
 
qreal angle () const
 
const QBrushbrush () const
 
const QFontfont () const
 
const QPenpen () const
 
const QPixmappixmap () const override
 
QPointF referencePointLocation () const
 
QPointF referencePointLocation (KDChartEnums::PositionValue position) const override
 
void setAngle (qreal angle)
 
void setBrush (const QBrush &brush)
 
void setFont (const QFont &font)
 
void setPen (const QPen &)
 
void setText (const QString &text)
 
const QStringtext () const
 
- Public Member Functions inherited from PrerenderedElement
 PrerenderedElement ()
 
virtual ~PrerenderedElement ()
 
const QPointFposition () const
 
KDChartEnums::PositionValue referencePoint () const
 
void setPosition (const QPointF &position)
 
void setReferencePoint (KDChartEnums::PositionValue)
 

Protected Member Functions

void invalidate () const override
 

Detailed Description

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:

qreal angle = 90.0;
CachedLabel label;
label.paint( font, tr("Label"), angle );

Definition at line 88 of file KDChartTextLabelCache.h.

Constructor & Destructor Documentation

◆ PrerenderedLabel()

PrerenderedLabel::PrerenderedLabel ( )

Definition at line 70 of file KDChartTextLabelCache.cpp.

◆ ~PrerenderedLabel()

PrerenderedLabel::~PrerenderedLabel ( )
override

Definition at line 78 of file KDChartTextLabelCache.cpp.

References DUMP_CACHE_STATS.

Member Function Documentation

◆ angle()

qreal PrerenderedLabel::angle ( ) const
Returns
the label's angle in degrees

Definition at line 154 of file KDChartTextLabelCache.cpp.

Referenced by setAngle().

◆ brush()

const QBrush & PrerenderedLabel::brush ( ) const
Returns
the label's brush

Definition at line 137 of file KDChartTextLabelCache.cpp.

Referenced by setBrush().

◆ font()

const QFont & PrerenderedLabel::font ( ) const
Returns
the label's font.

Definition at line 103 of file KDChartTextLabelCache.cpp.

Referenced by setFont().

◆ invalidate()

void PrerenderedLabel::invalidate ( ) const
overrideprotectedvirtual

Invalidates the preredendered data, forces re-rendering.

Implements PrerenderedElement.

Definition at line 86 of file KDChartTextLabelCache.cpp.

Referenced by setAngle(), setBrush(), setFont(), and setText().

◆ pen()

const QPen & PrerenderedLabel::pen ( ) const

◆ pixmap()

const QPixmap & PrerenderedLabel::pixmap ( ) const
overridevirtual

Returns the rendered element. If any of the properties have change, the element will be regenerated.

Implements PrerenderedElement.

Definition at line 159 of file KDChartTextLabelCache.cpp.

References INC_HIT_COUNT, and INC_MISS_COUNT.

Referenced by KDChart::TernaryAxis::requiredMargins().

◆ referencePointLocation() [1/2]

QPointF PrerenderedLabel::referencePointLocation ( ) const

◆ referencePointLocation() [2/2]

QPointF PrerenderedLabel::referencePointLocation ( KDChartEnums::PositionValue  ) const
overridevirtual

◆ setAngle()

void PrerenderedLabel::setAngle ( qreal  angle)

Sets the angle of the label to angle degrees

Definition at line 145 of file KDChartTextLabelCache.cpp.

References angle(), and invalidate().

◆ setBrush()

void PrerenderedLabel::setBrush ( const QBrush brush)

Sets the label's brush to brush

Definition at line 128 of file KDChartTextLabelCache.cpp.

References brush(), and invalidate().

◆ setFont()

void PrerenderedLabel::setFont ( const QFont font)

Sets the label's font to font.

Definition at line 94 of file KDChartTextLabelCache.cpp.

References font(), and invalidate().

◆ setPen()

void PrerenderedLabel::setPen ( const QPen )

◆ setText()

void PrerenderedLabel::setText ( const QString text)

Sets the label's text to text

Definition at line 111 of file KDChartTextLabelCache.cpp.

References invalidate(), and text().

Referenced by KDChart::TernaryAxis::TernaryAxis(), KDChart::TernaryAxis::setPosition(), and KDChart::TernaryAxis::setTitleText().

◆ text()

const QString & PrerenderedLabel::text ( ) const
Returns
the label's text

Definition at line 120 of file KDChartTextLabelCache.cpp.

Referenced by setText(), and KDChart::TernaryAxis::titleText().


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

© 2001 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-chart/
Generated on Fri Apr 26 2024 00:04:57 for KD Chart API Documentation by doxygen 1.9.8