KD Chart 2  [rev.2.5.1]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
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)
 
virtual void paintEvent (QPaintEvent *event)
 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

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

Definition at line 73 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
protectedvirtual

Implements KDChart::AbstractAreaBase.

Definition at line 178 of file KDChartAbstractAreaWidget.cpp.

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

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

References d, and paintAll().

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

Referenced by positionHasChanged().

void AbstractAreaWidget::positionHasChanged ( )
protectedvirtual

Reimplemented from KDChart::AbstractAreaBase.

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

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-chart/