The base class for axes. More...
#include <KDChartAbstractAxis.h>
Public Slots | |
void | update () |
Signals | |
void | positionChanged (AbstractArea *) |
Public Member Functions | |
AbstractAxis (AbstractDiagram *diagram=0) | |
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 AbstractAxis *other) const |
Returns true if both axes have the same settings. | |
bool | compare (const AbstractAreaBase *other) const |
Returns true if both areas have the same settings. | |
virtual void | connectSignals () |
Wireing the signal/slot connections. | |
const AbstractCoordinatePlane * | coordinatePlane () const |
Convenience function, returns the coordinate plane, in which this axis is used. | |
void | createObserver (AbstractDiagram *diagram) |
virtual const QString | customizedLabel (const QString &label) const |
Implement this method if you want to adjust axis labels before they are printed. | |
void | deleteObserver (AbstractDiagram *diagram) |
const AbstractDiagram * | diagram () const |
FrameAttributes | frameAttributes () const |
virtual QRect | geometry () const =0 |
void | getFrameLeadings (int &left, int &top, int &right, int &bottom) const |
QStringList | labels () const |
Returns a list of strings, that are used as axis labels, as set via setLabels. | |
virtual int | leftOverlap (bool doNotRecalculate=false) const |
This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint(). | |
bool | observedBy (AbstractDiagram *diagram) const |
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(). | |
RulerAttributes | rulerAttributes () const |
Returns the attributes to be used for painting the rulers. | |
void | setBackgroundAttributes (const BackgroundAttributes &a) |
void | setFrameAttributes (const FrameAttributes &a) |
virtual void | setGeometry (const QRect &rect)=0 |
void | setLabels (const QStringList &list) |
Use this to specify your own set of strings, to be used as axis labels. | |
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. | |
void | setRulerAttributes (const RulerAttributes &a) |
Use this to specify the attributes used to paint the axis ruler. | |
void | setShortLabels (const QStringList &list) |
Use this to specify your own set of strings, to be used as axis labels, in case the normal labels are too long. | |
void | setTextAttributes (const TextAttributes &a) |
Use this to specify the text attributes to be used for axis labels. | |
QStringList | shortLabels () const |
Returns a list of strings, that are used as axis labels, as set via setShortLabels. | |
virtual void | sizeHintChanged () const |
Report changed size hint: ask the parent widget to recalculate the layout. | |
TextAttributes | textAttributes () const |
Returns the text attributes to be used for axis labels. | |
virtual int | topOverlap (bool doNotRecalculate=false) const |
This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint(). | |
virtual | ~AbstractAxis () |
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 Slots | |
virtual void | delayedInit () |
called for initializing after the c'tor has completed | |
Protected Member Functions | |
virtual QRect | areaGeometry () const |
virtual QRect | areaGeometry () const =0 |
QRect | innerRect () const |
virtual void | positionHasChanged () |
virtual void | positionHasChanged () |
Protected Attributes | |
QWidget * | mParent |
QLayout * | mParentLayout |
The base class for axes.
For being useful, axes need to be assigned to a diagram, see AbstractCartesianDiagram::addAxis and AbstractCartesianDiagram::takeAxis.
Definition at line 57 of file KDChartAbstractAxis.h.
AbstractAxis::AbstractAxis | ( | AbstractDiagram * | diagram = 0 |
) | [explicit] |
Definition at line 105 of file KDChartAbstractAxis.cpp.
References delayedInit().
AbstractAxis::~AbstractAxis | ( | ) | [virtual] |
Definition at line 112 of file KDChartAbstractAxis.cpp.
References d.
void AbstractAreaBase::alignToReferencePoint | ( | const RelativePosition & | position | ) | [inherited] |
Definition at line 88 of file KDChartAbstractAreaBase.cpp.
QRect AbstractArea::areaGeometry | ( | ) | const [protected, virtual, inherited] |
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(), KDChart::AbstractArea::paintAll(), and KDChart::CartesianAxis::paintCtx().
virtual QRect KDChart::AbstractAreaBase::areaGeometry | ( | ) | const [protected, pure virtual, inherited] |
Implemented in KDChart::AbstractAreaWidget.
Referenced by KDChart::AbstractAreaBase::innerRect().
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, inherited] |
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().
bool AbstractAxis::compare | ( | const AbstractAxis * | other | ) | const |
Returns true if both axes have the same settings.
Definition at line 139 of file KDChartAbstractAxis.cpp.
References labels(), shortLabels(), and textAttributes().
void AbstractAxis::connectSignals | ( | ) | [virtual] |
Wireing the signal/slot connections.
This method gets called automatically, each time, when you assign the axis to a diagram, either by passing a diagram* to the c'tor, or by calling the diagram's setAxis method, resp.
If overwriting this method in derived classes, make sure to call this base method AbstractAxis::connectSignals(), so your axis gets connected to the diagram's built-in signals.
Definition at line 175 of file KDChartAbstractAxis.cpp.
Referenced by createObserver().
const AbstractCoordinatePlane * AbstractAxis::coordinatePlane | ( | ) | const |
Convenience function, returns the coordinate plane, in which this axis is used.
If the axis is not used in a coordinate plane, the return value is Zero.
Definition at line 238 of file KDChartAbstractAxis.cpp.
References d.
Referenced by KDChart::CartesianCoordinatePlane::sharedAxisMasterPlane().
void AbstractAxis::createObserver | ( | AbstractDiagram * | diagram | ) |
Definition at line 164 of file KDChartAbstractAxis.cpp.
References connectSignals(), and d.
Referenced by KDChart::AbstractCartesianDiagram::addAxis().
const QString AbstractAxis::customizedLabel | ( | const QString & | label | ) | const [virtual] |
Implement this method if you want to adjust axis labels before they are printed.
KD Chart is calling this method immediately before drawing the text, this means: What you return here will be drawn without further modifications.
label | The text of the label as KD Chart has calculated it automatically (or as it was taken from a QStringList provided by you, resp.) |
label
. Definition at line 158 of file KDChartAbstractAxis.cpp.
Referenced by KDChart::LeveyJenningsAxis::paintAsOrdinate(), and KDChart::CartesianAxis::paintCtx().
void AbstractAxis::delayedInit | ( | ) | [protected, virtual, slot] |
called for initializing after the c'tor has completed
Definition at line 131 of file KDChartAbstractAxis.cpp.
References d.
Referenced by AbstractAxis().
void AbstractAxis::deleteObserver | ( | AbstractDiagram * | diagram | ) |
Definition at line 170 of file KDChartAbstractAxis.cpp.
References d.
Referenced by KDChart::AbstractCartesianDiagram::takeAxis(), and KDChart::AbstractCartesianDiagram::~AbstractCartesianDiagram().
const AbstractDiagram * KDChart::AbstractAxis::diagram | ( | ) | const |
Definition at line 245 of file KDChartAbstractAxis.cpp.
References d.
Referenced by KDChart::CartesianAxis::paintCtx(), KDChart::CartesianAxis::~CartesianAxis(), and KDChart::LeveyJenningsAxis::~LeveyJenningsAxis().
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().
virtual QRect KDChart::AbstractAxis::geometry | ( | ) | const [pure virtual] |
Implemented in KDChart::CartesianAxis, and KDChart::TernaryAxis.
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 KDChart::AbstractArea::paintAll().
QStringList AbstractAxis::labels | ( | ) | const |
Returns a list of strings, that are used as axis labels, as set via setLabels.
Definition at line 219 of file KDChartAbstractAxis.cpp.
References d.
Referenced by compare(), KDChart::LeveyJenningsAxis::paintAsOrdinate(), and KDChart::CartesianAxis::paintCtx().
int AbstractArea::leftOverlap | ( | bool | doNotRecalculate = false |
) | const [virtual, inherited] |
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().
bool KDChart::AbstractAxis::observedBy | ( | AbstractDiagram * | diagram | ) | const |
Definition at line 250 of file KDChartAbstractAxis.cpp.
References d.
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(), KDChart::AbstractArea::paintAll(), and KDChart::AbstractLayoutItem::paintCtx().
void AbstractArea::paintAll | ( | QPainter & | painter | ) | [virtual, inherited] |
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 KDChart::AbstractArea::areaGeometry(), d, KDChart::AbstractAreaBase::innerRect(), KDChart::AbstractLayoutItem::paint(), KDChart::AbstractAreaBase::paintBackground(), and KDChart::AbstractAreaBase::paintFrame().
Referenced by KDChart::AbstractArea::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 KDChart::AbstractArea::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::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 KDChart::AbstractArea::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, inherited] |
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 KDChart::AbstractArea::paintAll().
QLayout* KDChart::AbstractLayoutItem::parentLayout | ( | ) | [inherited] |
Definition at line 76 of file KDChartLayoutItems.h.
void KDChart::AbstractArea::positionChanged | ( | AbstractArea * | ) | [signal, inherited] |
Referenced by KDChart::AbstractArea::positionHasChanged().
void AbstractArea::positionHasChanged | ( | ) | [protected, virtual, inherited] |
Definition at line 152 of file KDChartAbstractArea.cpp.
References KDChart::AbstractArea::positionChanged().
void AbstractAreaBase::positionHasChanged | ( | ) | [protected, virtual, inherited] |
Reimplemented in KDChart::AbstractAreaWidget.
Definition at line 238 of file KDChartAbstractAreaBase.cpp.
Referenced by KDChart::AbstractAreaBase::setBackgroundAttributes(), and KDChart::AbstractAreaBase::setFrameAttributes().
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, inherited] |
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().
RulerAttributes AbstractAxis::rulerAttributes | ( | ) | const |
Returns the attributes to be used for painting the rulers.
Definition at line 205 of file KDChartAbstractAxis.cpp.
References d.
Referenced by KDChart::CartesianAxis::paintCtx().
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().
virtual void KDChart::AbstractAxis::setGeometry | ( | const QRect & | rect | ) | [pure virtual] |
Implemented in KDChart::CartesianAxis, and KDChart::TernaryAxis.
void AbstractAxis::setLabels | ( | const QStringList & | list | ) |
Use this to specify your own set of strings, to be used as axis labels.
Labels specified via setLabels take precedence: If a non-empty list is passed, KD Chart will use these strings as axis labels, instead of calculating them.
If you a smaller number of strings than the number of labels drawn at this axis, KD Chart will iterate over the list, repeating the strings, until all labels are drawn. As an example you could specify the seven days of the week as abscissa labels, which would be repeatedly used then.
By passing an empty QStringList you can reset the default behaviour.
Definition at line 210 of file KDChartAbstractAxis.cpp.
Referenced by KDChart::LeveyJenningsAxis::paintAsAbscissa().
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 AbstractAxis::setRulerAttributes | ( | const RulerAttributes & | a | ) |
Use this to specify the attributes used to paint the axis ruler.
Every axis has a default set of ruler attributes that is exactly the same among them. Use this method to specify your own attributes.
Definition at line 199 of file KDChartAbstractAxis.cpp.
void AbstractAxis::setShortLabels | ( | const QStringList & | list | ) |
Use this to specify your own set of strings, to be used as axis labels, in case the normal labels are too long.
By passing an empty QStringList you can reset the default behaviour.
Definition at line 224 of file KDChartAbstractAxis.cpp.
void AbstractAxis::setTextAttributes | ( | const TextAttributes & | a | ) |
Use this to specify the text attributes to be used for axis labels.
By default, the reference area will be set at painting time. It will be the then-valid coordinate plane's parent widget, so normally, it will be the KDChart::Chart. Thus the labels of all of your axes in all of your diagrams within that Chart will be drawn in same font size, by default.
Definition at line 184 of file KDChartAbstractAxis.cpp.
Referenced by KDChart::LeveyJenningsAxis::setType().
QStringList AbstractAxis::shortLabels | ( | ) | const |
Returns a list of strings, that are used as axis labels, as set via setShortLabels.
Definition at line 233 of file KDChartAbstractAxis.cpp.
References d.
Referenced by compare(), and KDChart::CartesianAxis::paintCtx().
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().
TextAttributes AbstractAxis::textAttributes | ( | ) | const |
Returns the text attributes to be used for axis labels.
Definition at line 193 of file KDChartAbstractAxis.cpp.
References d.
Referenced by compare(), KDChart::LeveyJenningsAxis::paintAsAbscissa(), KDChart::LeveyJenningsAxis::paintAsOrdinate(), KDChart::CartesianAxis::paintCtx(), KDChart::LeveyJenningsAxis::setType(), and KDChart::CartesianAxis::titleTextAttributes().
int AbstractArea::topOverlap | ( | bool | doNotRecalculate = false |
) | const [virtual, inherited] |
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().
void KDChart::AbstractAxis::update | ( | ) | [slot] |
Definition at line 255 of file KDChartAbstractAxis.cpp.
References d.
Referenced by connectSignals(), KDChart::CartesianAxis::setAnnotations(), KDChart::CartesianAxis::setCustomTicks(), setLabels(), setRulerAttributes(), setShortLabels(), and setTextAttributes().
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().