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

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

#include <KDChartAbstractArea.h>

Inheritance diagram for KDChart::AbstractArea:
KDChart::AbstractAreaBase KDChart::AbstractLayoutItem KDChart::AbstractAxis KDChart::AbstractCoordinatePlane KDChart::CartesianAxis KDChart::TernaryAxis KDChart::CartesianCoordinatePlane KDChart::PolarCoordinatePlane KDChart::TernaryCoordinatePlane KDChart::LeveyJenningsAxis KDChart::LeveyJenningsCoordinatePlane KDChart::RadarCoordinatePlane

Signals

void positionChanged (AbstractArea *)
 

Public Member Functions

 ~AbstractArea () override
 
virtual int bottomOverlap (bool doNotRecalculate=false) const
 
virtual int leftOverlap (bool doNotRecalculate=false) const
 
void paintAll (QPainter &painter) override
 
virtual void paintIntoRect (QPainter &painter, const QRect &rect)
 Draws the background and frame, then calls paint(). More...
 
virtual int rightOverlap (bool doNotRecalculate=false) const
 
virtual int topOverlap (bool doNotRecalculate=false) const
 
- 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::AbstractLayoutItem
 AbstractLayoutItem (Qt::Alignment itemAlignment={})
 
virtual void paint (QPainter *)=0
 
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

 AbstractArea ()
 
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

An area in the chart with a background, a frame, etc.

AbstractArea is the base class for all non-widget chart elements that have a set of background attributes and frame attributes, such as coordinate planes or axes.

Note
This class inherits from AbstractAreaBase, AbstractLayoutItem, QObject. The reason for this triple inheritance is that neither AbstractAreaBase nor AbstractLayoutItem are QObject.

Definition at line 34 of file KDChartAbstractArea.h.

Constructor & Destructor Documentation

◆ ~AbstractArea()

AbstractArea::~AbstractArea ( )
override

Definition at line 44 of file KDChartAbstractArea.cpp.

◆ AbstractArea()

AbstractArea::AbstractArea ( )
protected

Definition at line 36 of file KDChartAbstractArea.cpp.

Member Function Documentation

◆ areaGeometry()

QRect AbstractArea::areaGeometry ( ) const
overrideprotectedvirtual

◆ bottomOverlap()

int AbstractArea::bottomOverlap ( bool  doNotRecalculate = false) const
virtual

This is called at layout time by KDChart:AutoSpacerLayoutItem::sizeHint().

The method triggers AbstractArea::sizeHint() to find out the amount of overlap at the bottom edge of the area.

Note
The default implementation is not using any caching, it might make sense to implement a more sophisticated solution for derived classes that have complex work to do in sizeHint(). All we have here is a primitive flag to be set by the caller if it is sure that no sizeHint() needs to be called.

Definition at line 81 of file KDChartAbstractArea.cpp.

References d.

◆ leftOverlap()

int AbstractArea::leftOverlap ( bool  doNotRecalculate = false) const
virtual

This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint().

The method triggers AbstractArea::sizeHint() to find out the amount of overlap at the left edge of the area.

Note
The default implementation is not using any caching, it might make sense to implement a more sophisticated solution for derived classes that have complex work to do in sizeHint(). All we have here is a primitive flag to be set by the caller if it is sure that no sizeHint() needs to be called.

Definition at line 57 of file KDChartAbstractArea.cpp.

References d.

◆ paintAll()

void AbstractArea::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.

Reimplemented in KDChart::TernaryAxis.

Definition at line 102 of file KDChartAbstractArea.cpp.

References areaGeometry(), d, KDChart::AbstractAreaBase::innerRect(), KDChart::AbstractLayoutItem::paint(), KDChart::AbstractAreaBase::paintBackground(), and KDChart::AbstractAreaBase::paintFrame().

Referenced by paintIntoRect().

◆ paintIntoRect()

void AbstractArea::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 AbstractLayoutItem::paint() instead.

Definition at line 90 of file KDChartAbstractArea.cpp.

References paintAll().

◆ positionChanged

void KDChart::AbstractArea::positionChanged ( AbstractArea )
signal

Referenced by positionHasChanged().

◆ positionHasChanged()

void AbstractArea::positionHasChanged ( )
overrideprotectedvirtual

Reimplemented from KDChart::AbstractAreaBase.

Definition at line 138 of file KDChartAbstractArea.cpp.

References positionChanged().

◆ rightOverlap()

int AbstractArea::rightOverlap ( bool  doNotRecalculate = false) const
virtual

This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint().

The method triggers AbstractArea::sizeHint() to find out the amount of overlap at the right edge of the area.

Note
The default implementation is not using any caching, it might make sense to implement a more sophisticated solution for derived classes that have complex work to do in sizeHint(). All we have here is a primitive flag to be set by the caller if it is sure that no sizeHint() needs to be called.

Definition at line 65 of file KDChartAbstractArea.cpp.

References d.

◆ topOverlap()

int AbstractArea::topOverlap ( bool  doNotRecalculate = false) const
virtual

This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint().

The method triggers AbstractArea::sizeHint() to find out the amount of overlap at the top edge of the area.

Note
The default implementation is not using any caching, it might make sense to implement a more sophisticated solution for derived classes that have complex work to do in sizeHint(). All we have here is a primitive flag to be set by the caller if it is sure that no sizeHint() needs to be called.

Definition at line 73 of file KDChartAbstractArea.cpp.

References d.


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