KD Chart API Documentation  3.1
Signals | Public Member Functions | Protected Member Functions | List of all members
KDChart::TextArea Class Reference

A text area in the chart with a background, a frame, etc. More...

#include <KDChartTextArea.h>

Inheritance diagram for KDChart::TextArea:
KDChart::AbstractAreaBase KDChart::TextLayoutItem KDChart::AbstractLayoutItem KDChart::HeaderFooter

Signals

void positionChanged (TextArea *)
 

Public Member Functions

 ~TextArea () override
 
void paintAll (QPainter &painter) override
 
virtual void paintIntoRect (QPainter &painter, const QRect &rect)
 Draws the background and frame, then calls paint(). More...
 
- Public Member Functions inherited from KDChart::AbstractAreaBase
void alignToReferencePoint (const RelativePosition &position)
 
BackgroundAttributes backgroundAttributes () const
 
bool compare (const AbstractAreaBase *other) const
 
FrameAttributes frameAttributes () const
 
void getFrameLeadings (int &left, int &top, int &right, int &bottom) const
 
virtual void paintBackground (QPainter &painter, const QRect &rectangle)
 
virtual void paintFrame (QPainter &painter, const QRect &rectangle)
 
void setBackgroundAttributes (const BackgroundAttributes &a)
 
void setFrameAttributes (const FrameAttributes &a)
 
- Public Member Functions inherited from KDChart::TextLayoutItem
 TextLayoutItem ()
 
 TextLayoutItem (const QString &text, const TextAttributes &attributes, const QObject *autoReferenceArea, KDChartEnums::MeasureOrientation autoReferenceOrientation, Qt::Alignment alignment={})
 
const QObject * autoReferenceArea () const
 
QPolygon boundingPolygon () const
 
Qt::Orientations expandingDirections () const override
 
QRect geometry () const override
 
virtual bool intersects (const TextLayoutItem &other, const QPoint &myPos, const QPoint &otherPos) const
 
virtual bool intersects (const TextLayoutItem &other, const QPointF &myPos, const QPointF &otherPos) const
 
bool isEmpty () const override
 
virtual int marginWidth () const
 
QSize maximumSize () const override
 
QSize minimumSize () const override
 
void paint (QPainter *) override
 
virtual QFont realFont () const
 
virtual qreal realFontSize () const
 
void setAutoReferenceArea (const QObject *area)
 
void setGeometry (const QRect &r) override
 
void setText (const QString &text)
 
void setTextAlignment (Qt::Alignment)
 
void setTextAttributes (const TextAttributes &a)
 Use this to specify the text attributes to be used for this item. More...
 
QSize sizeHint () const override
 
virtual QSize sizeHintUnrotated () const
 
QString text () const
 
Qt::Alignment textAlignment () const
 
TextAttributes textAttributes () const
 
- Public Member Functions inherited from KDChart::AbstractLayoutItem
 AbstractLayoutItem (Qt::Alignment itemAlignment={})
 
virtual void paintCtx (PaintContext *context)
 
QLayout * parentLayout ()
 
void removeFromParentLayout ()
 
void setParentLayout (QLayout *lay)
 
virtual void setParentWidget (QWidget *widget)
 
virtual void sizeHintChanged () const
 

Protected Member Functions

 TextArea ()
 
QRect areaGeometry () const override
 
void positionHasChanged () override
 
- Protected Member Functions inherited from KDChart::AbstractAreaBase
 AbstractAreaBase ()
 
virtual ~AbstractAreaBase ()
 
QRect innerRect () const
 

Additional Inherited Members

- Static Public Member Functions inherited from KDChart::AbstractAreaBase
static void paintBackgroundAttributes (QPainter &painter, const QRect &rectangle, const KDChart::BackgroundAttributes &attributes)
 
static void paintFrameAttributes (QPainter &painter, const QRect &rectangle, const KDChart::FrameAttributes &attributes)
 
- Protected Attributes inherited from KDChart::AbstractLayoutItem
QWidget * mParent = nullptr
 
QLayout * mParentLayout = nullptr
 

Detailed Description

A text area in the chart with a background, a frame, etc.

TextArea is the base class for all text containing non-widget chart elements that have a set of background attributes and frame attributes, such as headers or footers.

Note
This class inherits AbstractAreaBase, TextLayoutItem, and QObject. The reason for this triple inheritance is that neither AbstractAreaBase nor TextLayoutItem inherit QObject.

Definition at line 34 of file KDChartTextArea.h.

Constructor & Destructor Documentation

◆ ~TextArea()

TextArea::~TextArea ( )
override

Definition at line 42 of file KDChartTextArea.cpp.

◆ TextArea()

TextArea::TextArea ( )
protected

Definition at line 34 of file KDChartTextArea.cpp.

Member Function Documentation

◆ areaGeometry()

QRect TextArea::areaGeometry ( ) const
overrideprotectedvirtual

Implements KDChart::AbstractAreaBase.

Definition at line 86 of file KDChartTextArea.cpp.

References KDChart::TextLayoutItem::geometry().

Referenced by paintAll().

◆ paintAll()

void TextArea::paintAll ( QPainter &  painter)
overridevirtual

Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked automatically.

Reimplemented from KDChart::AbstractLayoutItem.

Definition at line 64 of file KDChartTextArea.cpp.

References areaGeometry(), KDChart::TextLayoutItem::geometry(), KDChart::AbstractAreaBase::innerRect(), KDChart::TextLayoutItem::paint(), KDChart::AbstractAreaBase::paintBackground(), KDChart::AbstractAreaBase::paintFrame(), and KDChart::TextLayoutItem::setGeometry().

Referenced by paintIntoRect().

◆ paintIntoRect()

void TextArea::paintIntoRect ( QPainter &  painter,
const QRect &  rect 
)
virtual

Draws the background and frame, then calls paint().

In most cases there is no need to overwrite this method in a derived class, but you would overwrite TextLayoutItem::paint() instead.

Definition at line 52 of file KDChartTextArea.cpp.

References KDChart::TextLayoutItem::geometry(), paintAll(), and KDChart::TextLayoutItem::setGeometry().

◆ positionChanged

void KDChart::TextArea::positionChanged ( TextArea )
signal

Referenced by positionHasChanged().

◆ positionHasChanged()

void TextArea::positionHasChanged ( )
overrideprotectedvirtual

Reimplemented from KDChart::AbstractAreaBase.

Definition at line 91 of file KDChartTextArea.cpp.

References positionChanged().


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 by doxygen 1.9.1