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

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

#include <KDChartAbstractAreaWidget.h>

Inheritance diagram for KDChart::AbstractAreaWidget:
KDChart::AbstractAreaBase KDChart::Legend

Signals

void positionChanged (AbstractAreaWidget *)
 

Public Member Functions

 AbstractAreaWidget (QWidget *parent=nullptr)
 
virtual void forceRebuild ()
 
virtual void needSizeHint ()
 
virtual void paint (QPainter *painter)=0
 
void paintAll (QPainter &painter)
 
void paintEvent (QPaintEvent *event) override
 Draws the background and frame, then calls paint(). More...
 
virtual void paintIntoRect (QPainter &painter, const QRect &rect)
 Draws the background and frame, then calls paint(). More...
 
virtual void resizeLayout (const QSize &)
 
- 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)
 

Protected Member Functions

 ~AbstractAreaWidget () override
 
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)
 

Detailed Description

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

AbstractAreaWidget is the base for all widget classes that have a set of background attributes and frame attributes, such as KDChart::Chart and KDChart::Legend.

Definition at line 31 of file KDChartAbstractAreaWidget.h.

Constructor & Destructor Documentation

◆ AbstractAreaWidget()

AbstractAreaWidget::AbstractAreaWidget ( QWidget *  parent = nullptr)
explicit

Definition at line 50 of file KDChartAbstractAreaWidget.cpp.

◆ ~AbstractAreaWidget()

AbstractAreaWidget::~AbstractAreaWidget ( )
overrideprotected

Definition at line 57 of file KDChartAbstractAreaWidget.cpp.

Member Function Documentation

◆ areaGeometry()

QRect AbstractAreaWidget::areaGeometry ( ) const
overrideprotectedvirtual

Implements KDChart::AbstractAreaBase.

Definition at line 165 of file KDChartAbstractAreaWidget.cpp.

◆ forceRebuild()

void AbstractAreaWidget::forceRebuild ( )
virtual

Call this to trigger an unconditional re-building of the widget's internals.

Reimplemented in KDChart::Legend.

Definition at line 121 of file KDChartAbstractAreaWidget.cpp.

◆ needSizeHint()

void AbstractAreaWidget::needSizeHint ( )
virtual

Call this to trigger an conditional re-building of the widget's internals.

e.g. AbstractAreaWidget call this, before calling layout()->setGeometry()

Reimplemented in KDChart::Legend.

Definition at line 67 of file KDChartAbstractAreaWidget.cpp.

◆ paint()

virtual void KDChart::AbstractAreaWidget::paint ( QPainter *  painter)
pure virtual

Overwrite this to paint the inner contents of your widget.

Note
When overriding this method, please let your widget draw itself at the top/left corner of the painter. You should call rect() (or width(), height(), resp.) to find the drawable area's size: While the paint() method is being executed the frame of the widget is outside of its rect(), so you can use all of rect() for your custom drawing!
See also
paint, paintIntoRect

Implemented in KDChart::Legend.

Referenced by paintAll().

◆ paintAll()

void AbstractAreaWidget::paintAll ( QPainter &  painter)

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

Definition at line 126 of file KDChartAbstractAreaWidget.cpp.

References KDChart::AbstractAreaBase::getFrameLeadings(), paint(), KDChart::AbstractAreaBase::paintBackground(), and KDChart::AbstractAreaBase::paintFrame().

Referenced by paintEvent(), and paintIntoRect().

◆ paintEvent()

void AbstractAreaWidget::paintEvent ( QPaintEvent *  event)
override

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 paint() instead.

See also
paint

Definition at line 80 of file KDChartAbstractAreaWidget.cpp.

References d, and paintAll().

◆ paintIntoRect()

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

Definition at line 90 of file KDChartAbstractAreaWidget.cpp.

References d, and paintAll().

◆ positionChanged

void KDChart::AbstractAreaWidget::positionChanged ( AbstractAreaWidget )
signal

Referenced by positionHasChanged().

◆ positionHasChanged()

void AbstractAreaWidget::positionHasChanged ( )
overrideprotectedvirtual

Reimplemented from KDChart::AbstractAreaBase.

Definition at line 170 of file KDChartAbstractAreaWidget.cpp.

References positionChanged().

◆ resizeLayout()

void AbstractAreaWidget::resizeLayout ( const QSize &  size)
virtual

Reimplemented in KDChart::Legend.

Definition at line 74 of file KDChartAbstractAreaWidget.cpp.


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