KD Chart 2  [rev.2.7]
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

qreal angle () const
 
const QBrush & brush () const
 
const QFont & font () const
 
const QPen & pen () const
 
const QPixmap & pixmap () const override
 Returns the rendered element. More...
 
const QPointF & position () const
 Get the position of the element. More...
 
 PrerenderedLabel ()
 
KDChartEnums::PositionValue referencePoint () const
 Get the reference point of the element. More...
 
QPointF referencePointLocation (KDChartEnums::PositionValue position) const override
 Return the location of the reference point relatively to the pixmap's origin. More...
 
QPointF referencePointLocation () const
 
void setAngle (qreal angle)
 Sets the angle of the label to angle degrees. More...
 
void setBrush (const QBrush &brush)
 Sets the label's brush to brush. More...
 
void setFont (const QFont &font)
 Sets the label's font to font. More...
 
void setPen (const QPen &)
 
void setPosition (const QPointF &position)
 Set the position of the element. More...
 
void setReferencePoint (KDChartEnums::PositionValue)
 Set the reference point of the element. More...
 
void setText (const QString &text)
 Sets the label's text to text. More...
 
const QString & text () const
 
 ~PrerenderedLabel () override
 

Protected Member Functions

void invalidate () const override
 Invalidates the preredendered data, forces re-rendering. More...
 

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 97 of file KDChartTextLabelCache.h.

Constructor & Destructor Documentation

PrerenderedLabel::PrerenderedLabel ( )

Definition at line 77 of file KDChartTextLabelCache.cpp.

PrerenderedLabel::~PrerenderedLabel ( )
override

Definition at line 87 of file KDChartTextLabelCache.cpp.

References DUMP_CACHE_STATS.

Member Function Documentation

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

Definition at line 163 of file KDChartTextLabelCache.cpp.

Referenced by setAngle().

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

Definition at line 146 of file KDChartTextLabelCache.cpp.

Referenced by setBrush().

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

Definition at line 112 of file KDChartTextLabelCache.cpp.

Referenced by setFont().

void PrerenderedLabel::invalidate ( ) const
overrideprotectedvirtual

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
overridevirtual
const QPointF & PrerenderedElement::position ( ) const
inherited
KDChartEnums::PositionValue PrerenderedElement::referencePoint ( ) const
inherited

Get the reference point of the element.

Definition at line 72 of file KDChartTextLabelCache.cpp.

Referenced by referencePointLocation(), and PrerenderedElement::~PrerenderedElement().

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

Definition at line 285 of file KDChartTextLabelCache.cpp.

References PrerenderedElement::referencePoint().

Referenced by pixmap().

void PrerenderedLabel::setAngle ( qreal  angle)

Sets the angle of the label to angle degrees.

Definition at line 154 of file KDChartTextLabelCache.cpp.

References angle(), and invalidate().

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

void PrerenderedLabel::setBrush ( const QBrush &  brush)

Sets the label's brush to brush.

Definition at line 137 of file KDChartTextLabelCache.cpp.

References brush(), and invalidate().

void PrerenderedLabel::setFont ( const QFont &  font)

Sets the label's font to font.

Definition at line 103 of file KDChartTextLabelCache.cpp.

References font(), and invalidate().

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

void PrerenderedLabel::setPen ( const QPen &  )
void PrerenderedElement::setPosition ( const QPointF &  position)
inherited
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.

Referenced by KDChart::TernaryAxis::hasDefaultTitleTextAttributes(), and PrerenderedElement::~PrerenderedElement().

void PrerenderedLabel::setText ( const QString &  text)

Sets the label's text to text.

Definition at line 120 of file KDChartTextLabelCache.cpp.

References invalidate(), and text().

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

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

Definition at line 129 of file KDChartTextLabelCache.cpp.

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


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

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/