An area in the chart with a background, a frame, etc. More...
#include <KDChartAbstractArea.h>
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(). | |
bool | compare (const AbstractAreaBase *other) const |
Returns true if both areas have the same settings. | |
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(). | |
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. | |
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. | |
virtual void | paintFrame (QPainter &painter, const QRect &rectangle) |
virtual void | paintIntoRect (QPainter &painter, const QRect &rect) |
Draws the background and frame, then calls paint(). | |
QLayout * | parentLayout () |
void | removeFromParentLayout () |
virtual int | rightOverlap (bool doNotRecalculate=false) const |
This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint(). | |
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. | |
virtual void | sizeHintChanged () const |
Report changed size hint: ask the parent widget to recalculate the layout. | |
virtual int | topOverlap (bool doNotRecalculate=false) const |
This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint(). | |
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 | |
QWidget * | mParent |
QLayout * | mParentLayout |
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.
Definition at line 47 of file KDChartAbstractArea.h.
AbstractArea::~AbstractArea | ( | ) | [virtual] |
Definition at line 59 of file KDChartAbstractArea.cpp.
AbstractArea::AbstractArea | ( | ) | [protected] |
Definition at line 51 of file KDChartAbstractArea.cpp.
void AbstractAreaBase::alignToReferencePoint | ( | const RelativePosition & | position | ) | [inherited] |
Definition at line 88 of file KDChartAbstractAreaBase.cpp.
QRect AbstractArea::areaGeometry | ( | ) | const [protected, virtual] |
Implements KDChart::AbstractAreaBase.
Definition at line 147 of file KDChartAbstractArea.cpp.
Referenced by KDChart::CartesianCoordinatePlane::drawingArea(), KDChart::TernaryCoordinatePlane::layoutDiagrams(), KDChart::PolarCoordinatePlane::layoutDiagrams(), KDChart::TernaryCoordinatePlane::paint(), KDChart::CartesianAxis::paint(), paintAll(), and KDChart::CartesianAxis::paintCtx().
BackgroundAttributes AbstractAreaBase::backgroundAttributes | ( | ) | const [inherited] |
Definition at line 118 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.
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 73 of file KDChartAbstractAreaBase.cpp.
References KDChart::AbstractAreaBase::backgroundAttributes(), and KDChart::AbstractAreaBase::frameAttributes().
FrameAttributes AbstractAreaBase::frameAttributes | ( | ) | const [inherited] |
Definition at line 104 of file KDChartAbstractAreaBase.cpp.
References d.
Referenced by KDChart::Legend::clone(), KDChart::AbstractAreaBase::compare(), and updateCommonBrush().
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 KDChart::AbstractAreaWidget::paintAll().
QRect AbstractAreaBase::innerRect | ( | ) | const [protected, inherited] |
Definition at line 226 of file KDChartAbstractAreaBase.cpp.
References KDChart::AbstractAreaBase::areaGeometry(), and KDChart::AbstractAreaBase::getFrameLeadings().
Referenced by KDChart::TextArea::paintAll(), and paintAll().
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.
Definition at line 74 of file KDChartAbstractArea.cpp.
References d.
Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().
virtual void KDChart::AbstractLayoutItem::paint | ( | QPainter * | ) | [pure virtual, inherited] |
Implemented in KDChart::CartesianAxis, KDChart::CartesianCoordinatePlane, KDChart::TextLayoutItem, KDChart::TextBubbleLayoutItem, KDChart::MarkerLayoutItem, KDChart::LineLayoutItem, KDChart::LineWithMarkerLayoutItem, KDChart::HorizontalLineLayoutItem, KDChart::VerticalLineLayoutItem, KDChart::AutoSpacerLayoutItem, KDChart::PolarCoordinatePlane, KDChart::TernaryAxis, and KDChart::TernaryCoordinatePlane.
Referenced by KDChart::Legend::paint(), KDChart::AbstractLayoutItem::paintAll(), paintAll(), and KDChart::AbstractLayoutItem::paintCtx().
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 | |||
) | [virtual, inherited] |
Definition at line 194 of file KDChartAbstractAreaBase.cpp.
References d, and KDChart::AbstractAreaBase::paintBackgroundAttributes().
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and paintAll().
void AbstractAreaBase::paintBackgroundAttributes | ( | QPainter & | painter, | |
const QRect & | rectangle, | |||
const KDChart::BackgroundAttributes & | attributes | |||
) | [static, inherited] |
Definition at line 125 of file KDChartAbstractAreaBase.cpp.
References KDChart::BackgroundAttributes::BackgroundPixmapModeCentered, KDChart::BackgroundAttributes::BackgroundPixmapModeNone, KDChart::BackgroundAttributes::BackgroundPixmapModeScaled, KDChart::BackgroundAttributes::BackgroundPixmapModeStretched, KDChart::BackgroundAttributes::brush(), KDChart::BackgroundAttributes::isVisible(), KDChart::BackgroundAttributes::pixmap(), and KDChart::BackgroundAttributes::pixmapMode().
Referenced by KDChart::AbstractAreaBase::paintBackground().
void KDChart::AbstractLayoutItem::paintCtx | ( | PaintContext * | context | ) | [virtual, inherited] |
Default impl: Paint the complete item using its layouted position and size.
Reimplemented in KDChart::CartesianAxis, KDChart::LeveyJenningsAxis, and KDChart::TernaryAxis.
Definition at line 75 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::paint(), and KDChart::PaintContext::painter().
void AbstractAreaBase::paintFrame | ( | QPainter & | painter, | |
const QRect & | rectangle | |||
) | [virtual, inherited] |
Definition at line 202 of file KDChartAbstractAreaBase.cpp.
References d, and KDChart::AbstractAreaBase::paintFrameAttributes().
Referenced by KDChart::TextArea::paintAll(), KDChart::AbstractAreaWidget::paintAll(), and paintAll().
void AbstractAreaBase::paintFrameAttributes | ( | QPainter & | painter, | |
const QRect & | rectangle, | |||
const KDChart::FrameAttributes & | attributes | |||
) | [static, inherited] |
Definition at line 175 of file KDChartAbstractAreaBase.cpp.
References KDChart::FrameAttributes::isVisible(), KDChart::FrameAttributes::pen(), and KDChart::PrintingParameters::scalePen().
Referenced by KDChart::AbstractAreaBase::paintFrame().
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 76 of file KDChartLayoutItems.h.
void KDChart::AbstractArea::positionChanged | ( | AbstractArea * | ) | [signal] |
Referenced by positionHasChanged().
void AbstractArea::positionHasChanged | ( | ) | [protected, virtual] |
Reimplemented from KDChart::AbstractAreaBase.
Definition at line 152 of file KDChartAbstractArea.cpp.
References positionChanged().
void KDChart::AbstractLayoutItem::removeFromParentLayout | ( | ) | [inherited] |
Definition at line 80 of file KDChartLayoutItems.h.
Referenced by KDChart::Chart::takeCoordinatePlane().
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.
Definition at line 82 of file KDChartAbstractArea.cpp.
References d.
Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().
void AbstractAreaBase::setBackgroundAttributes | ( | const BackgroundAttributes & | a | ) | [inherited] |
Definition at line 109 of file KDChartAbstractAreaBase.cpp.
References d, and KDChart::AbstractAreaBase::positionHasChanged().
void AbstractAreaBase::setFrameAttributes | ( | const FrameAttributes & | a | ) | [inherited] |
Definition at line 95 of file KDChartAbstractAreaBase.cpp.
References d, and KDChart::AbstractAreaBase::positionHasChanged().
Referenced by KDChart::Legend::clone().
void KDChart::AbstractLayoutItem::setParentLayout | ( | QLayout * | lay | ) | [inherited] |
Definition at line 72 of file KDChartLayoutItems.h.
void KDChart::AbstractLayoutItem::setParentWidget | ( | QWidget * | widget | ) | [virtual, inherited] |
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 62 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
Referenced by KDChart::HeaderFooter::setParent(), and KDChart::AbstractCartesianDiagram::takeAxis().
void KDChart::AbstractLayoutItem::sizeHintChanged | ( | ) | const [virtual, inherited] |
Report changed size hint: ask the parent widget to recalculate the layout.
Definition at line 84 of file KDChartLayoutItems.cpp.
References KDChart::AbstractLayoutItem::mParent.
Referenced by KDChart::TextLayoutItem::sizeHintAndRotatedCorners().
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.
Definition at line 90 of file KDChartAbstractArea.cpp.
References d.
Referenced by KDChart::AutoSpacerLayoutItem::sizeHint().
QWidget* KDChart::AbstractLayoutItem::mParent [protected, inherited] |
QLayout* KDChart::AbstractLayoutItem::mParentLayout [protected, inherited] |
Definition at line 91 of file KDChartLayoutItems.h.
Referenced by KDChart::AutoSpacerLayoutItem::paint().