KD Chart 2  [rev.2.6]
Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KDChart::AbstractArea Class Referenceabstract

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

#include <KDChartAbstractArea.h>

Inheritance diagram for KDChart::AbstractArea:
Inheritance graph
[legend]
Collaboration diagram for KDChart::AbstractArea:
Collaboration graph
[legend]

Signals

void positionChanged (AbstractArea *)
 

Public Member Functions

void alignToReferencePoint (const RelativePosition &position)
 
BackgroundAttributes backgroundAttributes () const
 
virtual int bottomOverlap (bool doNotRecalculate=false) const
 This is called at layout time by KDChart:AutoSpacerLayoutItem::sizeHint(). More...
 
bool compare (const AbstractAreaBase *other) const
 Returns true if both areas have the same settings. More...
 
FrameAttributes frameAttributes () const
 
void getFrameLeadings (int &left, int &top, int &right, int &bottom) const
 
virtual int leftOverlap (bool doNotRecalculate=false) const
 This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint(). More...
 
virtual void paint (QPainter *)=0
 
virtual 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 paintCtx (PaintContext *context)
 Default impl: Paint the complete item using its layouted position and size. 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...
 
QLayout * parentLayout ()
 
void removeFromParentLayout ()
 
virtual int rightOverlap (bool doNotRecalculate=false) const
 This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint(). More...
 
void setBackgroundAttributes (const BackgroundAttributes &a)
 
void setFrameAttributes (const FrameAttributes &a)
 
void setParentLayout (QLayout *lay)
 
virtual void setParentWidget (QWidget *widget)
 Inform the item about its widget: This enables the item, to trigger that widget's update, whenever the size of the item's contents has changed. More...
 
virtual void sizeHintChanged () const
 Report changed size hint: ask the parent widget to recalculate the layout. More...
 
virtual int topOverlap (bool doNotRecalculate=false) const
 This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint(). More...
 
virtual ~AbstractArea ()
 

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

 AbstractArea ()
 
virtual QRect areaGeometry () const
 
QRect innerRect () const
 
virtual void positionHasChanged ()
 

Protected Attributes

QWidgetmParent
 
QLayout * mParentLayout
 

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 47 of file KDChartAbstractArea.h.

Constructor & Destructor Documentation

AbstractArea::~AbstractArea ( )
virtual

Definition at line 59 of file KDChartAbstractArea.cpp.

References d.

AbstractArea::AbstractArea ( )
protected

Definition at line 51 of file KDChartAbstractArea.cpp.

Member Function Documentation

void AbstractAreaBase::alignToReferencePoint ( const RelativePosition position)
inherited

Definition at line 80 of file KDChartAbstractAreaBase.cpp.

QRect AbstractArea::areaGeometry ( ) const
protectedvirtual
BackgroundAttributes AbstractAreaBase::backgroundAttributes ( ) const
inherited

Definition at line 110 of file KDChartAbstractAreaBase.cpp.

References d.

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

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 98 of file KDChartAbstractArea.cpp.

References d.

Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().

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

Returns true if both areas have the same settings.

Definition at line 70 of file KDChartAbstractAreaBase.cpp.

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

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

FrameAttributes AbstractAreaBase::frameAttributes ( ) const
inherited
void AbstractAreaBase::getFrameLeadings ( int &  left,
int &  top,
int &  right,
int &  bottom 
) const
inherited
QRect AbstractAreaBase::innerRect ( ) const
protectedinherited
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 74 of file KDChartAbstractArea.cpp.

References d.

Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().

virtual void KDChart::AbstractLayoutItem::paint ( QPainter *  )
pure virtualinherited
void AbstractArea::paintAll ( QPainter &  painter)
virtual

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 120 of file KDChartAbstractArea.cpp.

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

Referenced by paintIntoRect().

void AbstractAreaBase::paintBackground ( QPainter &  painter,
const QRect &  rectangle 
)
virtualinherited
void AbstractAreaBase::paintBackgroundAttributes ( QPainter &  painter,
const QRect &  rectangle,
const KDChart::BackgroundAttributes attributes 
)
staticinherited
void KDChart::AbstractLayoutItem::paintCtx ( PaintContext context)
virtualinherited

Default impl: Paint the complete item using its layouted position and size.

Reimplemented in KDChart::CartesianAxis, KDChart::LeveyJenningsAxis, and KDChart::TernaryAxis.

Definition at line 72 of file KDChartLayoutItems.cpp.

References KDChart::AbstractLayoutItem::paint(), and KDChart::PaintContext::painter().

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

References paintAll().

QLayout* KDChart::AbstractLayoutItem::parentLayout ( )
inherited

Definition at line 78 of file KDChartLayoutItems.h.

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

Referenced by positionHasChanged().

void AbstractArea::positionHasChanged ( )
protectedvirtual

Reimplemented from KDChart::AbstractAreaBase.

Definition at line 156 of file KDChartAbstractArea.cpp.

References positionChanged().

void KDChart::AbstractLayoutItem::removeFromParentLayout ( )
inherited
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 82 of file KDChartAbstractArea.cpp.

References d.

Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().

void AbstractAreaBase::setBackgroundAttributes ( const BackgroundAttributes a)
inherited
void AbstractAreaBase::setFrameAttributes ( const FrameAttributes a)
inherited
void KDChart::AbstractLayoutItem::setParentLayout ( QLayout *  lay)
inherited
void KDChart::AbstractLayoutItem::setParentWidget ( QWidget widget)
virtualinherited

Inform the item about its widget: This enables the item, to trigger that widget's update, whenever the size of the item's contents has changed.

Thus, you need to call setParentWidget on every item, that has a non-fixed size.

Definition at line 59 of file KDChartLayoutItems.cpp.

References KDChart::AbstractLayoutItem::mParent.

Referenced by KDChart::HeaderFooter::setParent(), KDChart::AbstractCartesianDiagram::takeAxis(), and updateToplevelLayout().

void KDChart::AbstractLayoutItem::sizeHintChanged ( ) const
virtualinherited

Report changed size hint: ask the parent widget to recalculate the layout.

Definition at line 81 of file KDChartLayoutItems.cpp.

References KDChart::AbstractLayoutItem::mParent.

Referenced by KDChart::TextLayoutItem::sizeHint().

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 90 of file KDChartAbstractArea.cpp.

References d.

Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().

Member Data Documentation

QWidget* KDChart::AbstractLayoutItem::mParent
protectedinherited
QLayout* KDChart::AbstractLayoutItem::mParentLayout
protectedinherited

Definition at line 93 of file KDChartLayoutItems.h.

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


The documentation for this class was generated from the following files:

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