KD Chart 2  [rev.2.7]
Signals | Public Member Functions | Static 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:
Inheritance graph
[legend]
Collaboration diagram for KDChart::AbstractAreaWidget:
Collaboration graph
[legend]

Signals

void positionChanged (AbstractAreaWidget *)
 

Public Member Functions

 AbstractAreaWidget (QWidget *parent=0)
 
void alignToReferencePoint (const RelativePosition &position)
 
BackgroundAttributes backgroundAttributes () const
 
bool compare (const AbstractAreaBase *other) const
 Returns true if both areas have the same settings. More...
 
virtual void forceRebuild ()
 Call this to trigger an unconditional re-building of the widget's internals. More...
 
FrameAttributes frameAttributes () const
 
void getFrameLeadings (int &left, int &top, int &right, int &bottom) const
 
virtual void needSizeHint ()
 Call this to trigger an conditional re-building of the widget's internals. More...
 
virtual void paint (QPainter *painter)=0
 Overwrite this to paint the inner contents of your widget. More...
 
void paintAll (QPainter &painter)
 Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked automatically. More...
 
virtual void paintBackground (QPainter &painter, const QRect &rectangle)
 
void paintEvent (QPaintEvent *event) override
 Draws the background and frame, then calls paint(). More...
 
virtual void paintFrame (QPainter &painter, const QRect &rectangle)
 
virtual void paintIntoRect (QPainter &painter, const QRect &rect)
 Draws the background and frame, then calls paint(). More...
 
virtual void resizeLayout (const QSize &)
 
void setBackgroundAttributes (const BackgroundAttributes &a)
 
void setFrameAttributes (const FrameAttributes &a)
 

Static Public Member Functions

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 Member Functions

QRect areaGeometry () const override
 
QRect innerRect () const
 
void positionHasChanged () override
 
 ~AbstractAreaWidget () override
 

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 44 of file KDChartAbstractAreaWidget.h.

Constructor & Destructor Documentation

AbstractAreaWidget::AbstractAreaWidget ( QWidget parent = 0)
explicit

Definition at line 65 of file KDChartAbstractAreaWidget.cpp.

AbstractAreaWidget::~AbstractAreaWidget ( )
overrideprotected

Definition at line 72 of file KDChartAbstractAreaWidget.cpp.

Member Function Documentation

void AbstractAreaBase::alignToReferencePoint ( const RelativePosition position)
inherited

Definition at line 81 of file KDChartAbstractAreaBase.cpp.

QRect AbstractAreaWidget::areaGeometry ( ) const
overrideprotectedvirtual

Implements KDChart::AbstractAreaBase.

Definition at line 179 of file KDChartAbstractAreaWidget.cpp.

Referenced by updateToplevelLayout().

BackgroundAttributes AbstractAreaBase::backgroundAttributes ( ) const
inherited

Definition at line 111 of file KDChartAbstractAreaBase.cpp.

References d.

Referenced by KDChart::AbstractAreaBase::compare(), and updateCommonBrush().

bool AbstractAreaBase::compare ( const AbstractAreaBase other) const
inherited

Returns true if both areas have the same settings.

Definition at line 71 of file KDChartAbstractAreaBase.cpp.

References KDChart::AbstractAreaBase::backgroundAttributes(), and KDChart::AbstractAreaBase::frameAttributes().

Referenced by KDChart::Legend::compare().

void AbstractAreaWidget::forceRebuild ( )
virtual

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

Reimplemented in KDChart::Legend.

Definition at line 135 of file KDChartAbstractAreaWidget.cpp.

FrameAttributes AbstractAreaBase::frameAttributes ( ) const
inherited
void AbstractAreaBase::getFrameLeadings ( int &  left,
int &  top,
int &  right,
int &  bottom 
) const
inherited

Definition at line 213 of file KDChartAbstractAreaBase.cpp.

References d.

Referenced by KDChart::AbstractAreaBase::innerRect(), and paintAll().

QRect AbstractAreaBase::innerRect ( ) const
protectedinherited
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 82 of file KDChartAbstractAreaWidget.cpp.

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

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 140 of file KDChartAbstractAreaWidget.cpp.

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

Referenced by paintEvent(), and paintIntoRect().

void AbstractAreaBase::paintBackground ( QPainter &  painter,
const QRect &  rectangle 
)
virtualinherited
void AbstractAreaBase::paintBackgroundAttributes ( QPainter &  painter,
const QRect &  rectangle,
const KDChart::BackgroundAttributes attributes 
)
staticinherited
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 95 of file KDChartAbstractAreaWidget.cpp.

References d, and paintAll().

void AbstractAreaBase::paintFrame ( QPainter &  painter,
const QRect &  rectangle 
)
virtualinherited
void AbstractAreaBase::paintFrameAttributes ( QPainter &  painter,
const QRect &  rectangle,
const KDChart::FrameAttributes attributes 
)
staticinherited
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 105 of file KDChartAbstractAreaWidget.cpp.

References d, and paintAll().

Referenced by findSharingAxisDiagrams().

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

Reimplemented from KDChart::AbstractAreaBase.

Definition at line 184 of file KDChartAbstractAreaWidget.cpp.

References positionChanged().

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

Reimplemented in KDChart::Legend.

Definition at line 89 of file KDChartAbstractAreaWidget.cpp.

void AbstractAreaBase::setBackgroundAttributes ( const BackgroundAttributes a)
inherited
void AbstractAreaBase::setFrameAttributes ( const FrameAttributes a)
inherited

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/