Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions

KDChart::AbstractAreaWidget Class Reference

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]

List of all members.

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.
virtual void forceRebuild ()
 Call this to trigger an unconditional re-building of the widget's internals.
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.
virtual void paint (QPainter *painter)=0
 Overwrite this to paint the inner contents of your widget.
void paintAll (QPainter &painter)
 Call paintAll, if you want the background and the frame to be drawn before the normal paint() is invoked automatically.
virtual void paintBackground (QPainter &painter, const QRect &rectangle)
virtual void paintEvent (QPaintEvent *event)
 Draws the background and frame, then calls paint().
virtual void paintFrame (QPainter &painter, const QRect &rectangle)
virtual void paintIntoRect (QPainter &painter, const QRect &rect)
 Draws the background and frame, then calls paint().
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

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

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

AbstractAreaWidget::~AbstractAreaWidget (  )  [protected, virtual]

Definition at line 73 of file KDChartAbstractAreaWidget.cpp.


Member Function Documentation

void AbstractAreaBase::alignToReferencePoint ( const RelativePosition position  )  [inherited]

Definition at line 88 of file KDChartAbstractAreaBase.cpp.

QRect AbstractAreaWidget::areaGeometry (  )  const [protected, virtual]

Implements KDChart::AbstractAreaBase.

Definition at line 183 of file KDChartAbstractAreaWidget.cpp.

BackgroundAttributes AbstractAreaBase::backgroundAttributes (  )  const [inherited]

Definition at line 118 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 73 of file KDChartAbstractAreaBase.cpp.

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

void AbstractAreaWidget::forceRebuild (  )  [virtual]

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

Reimplemented in KDChart::Legend.

Definition at line 137 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 210 of file KDChartAbstractAreaBase.cpp.

References d.

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

QRect AbstractAreaBase::innerRect (  )  const [protected, inherited]
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 83 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 142 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 
) [virtual, inherited]
void AbstractAreaBase::paintBackgroundAttributes ( QPainter &  painter,
const QRect &  rectangle,
const KDChart::BackgroundAttributes attributes 
) [static, inherited]
void AbstractAreaWidget::paintEvent ( QPaintEvent *  event  )  [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.

See also:
paint

Definition at line 96 of file KDChartAbstractAreaWidget.cpp.

References d, and paintAll().

void AbstractAreaBase::paintFrame ( QPainter &  painter,
const QRect &  rectangle 
) [virtual, inherited]
void AbstractAreaBase::paintFrameAttributes ( QPainter &  painter,
const QRect &  rectangle,
const KDChart::FrameAttributes attributes 
) [static, inherited]
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 106 of file KDChartAbstractAreaWidget.cpp.

References d, and paintAll().

Referenced by KDChart::Chart::paint().

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

Referenced by positionHasChanged().

void AbstractAreaWidget::positionHasChanged (  )  [protected, virtual]

Reimplemented from KDChart::AbstractAreaBase.

Definition at line 188 of file KDChartAbstractAreaWidget.cpp.

References positionChanged().

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

Reimplemented in KDChart::Legend.

Definition at line 90 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: