KDChart::TernaryAxis Class Reference

The class for ternary axes. More...

#include <KDChartTernaryAxis.h>

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

List of all members.

Public Slots

void update ()

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.
bool compare (const AbstractAxis *other) const
 Returns true if both axes have the same settings.
virtual void connectSignals ()
 Wireing the signal/slot connections.
const AbstractCoordinatePlanecoordinatePlane () 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 AbstractDiagramdiagram () const
virtual Qt::Orientations expandingDirections () const
FrameAttributes frameAttributes () const
virtual QRect geometry () const
void getFrameLeadings (int &left, int &top, int &right, int &bottom) const
bool hasDefaultTitleTextAttributes () const
virtual bool isEmpty () 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().
virtual QSize maximumSize () const
virtual QSize minimumSize () const
bool observedBy (AbstractDiagram *diagram) const
virtual void paint (QPainter *)
virtual void paintAll (QPainter &)
 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 *)
 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 ()
virtual const Position position () const
void removeFromParentLayout ()
QPair< QSizeF, QSizeF > requiredMargins () const
void resetTitleTextAttributes ()
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)
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.
virtual void setPosition (Position p)
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.
void setTitleText (const QString &text)
void setTitleTextAttributes (const TextAttributes &a)
QStringList shortLabels () const
 Returns a list of strings, that are used as axis labels, as set via setShortLabels.
virtual QSize sizeHint () const
virtual void sizeHintChanged () const
 Report changed size hint: ask the parent widget to recalculate the layout.
 TernaryAxis (AbstractTernaryDiagram *diagram=0)
TextAttributes textAttributes () const
 Returns the text attributes to be used for axis labels.
QString titleText () const
TextAttributes titleTextAttributes () const
virtual int topOverlap (bool doNotRecalculate=false) const
 This is called at layout time by KDChart::AutoSpacerLayoutItem::sizeHint().
 ~TernaryAxis ()

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
QRect innerRect () const
virtual void positionHasChanged ()

Protected Attributes

QWidgetmParent
QLayout * mParentLayout

Detailed Description

The class for ternary axes.

Definition at line 40 of file KDChartTernaryAxis.h.


Constructor & Destructor Documentation

TernaryAxis::TernaryAxis ( AbstractTernaryDiagram diagram = 0  )  [explicit]
TernaryAxis::~TernaryAxis (  ) 

Definition at line 56 of file KDChartTernaryAxis.cpp.


Member Function Documentation

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

Definition at line 88 of file KDChartAbstractAreaBase.cpp.

QRect AbstractArea::areaGeometry (  )  const [protected, virtual, inherited]
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.

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 73 of file KDChartAbstractAreaBase.cpp.

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

bool AbstractAxis::compare ( const AbstractAxis other  )  const [inherited]

Returns true if both axes have the same settings.

Definition at line 139 of file KDChartAbstractAxis.cpp.

References KDChart::AbstractAxis::labels(), KDChart::AbstractAxis::shortLabels(), and KDChart::AbstractAxis::textAttributes().

void AbstractAxis::connectSignals (  )  [virtual, inherited]

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.

See also:
AbstractCartesianDiagram::addAxis()

Definition at line 175 of file KDChartAbstractAxis.cpp.

References d, and KDChart::AbstractAxis::update().

Referenced by KDChart::AbstractAxis::createObserver().

const AbstractCoordinatePlane * AbstractAxis::coordinatePlane (  )  const [inherited]

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  )  [inherited]
const QString AbstractAxis::customizedLabel ( const QString &  label  )  const [virtual, inherited]

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.

Parameters:
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.)
Returns:
The text to be drawn. By default this is the same as label.

Definition at line 158 of file KDChartAbstractAxis.cpp.

Referenced by KDChart::LeveyJenningsAxis::paintAsOrdinate(), and KDChart::CartesianAxis::paintCtx().

void AbstractAxis::delayedInit (  )  [protected, virtual, slot, inherited]

called for initializing after the c'tor has completed

Definition at line 131 of file KDChartAbstractAxis.cpp.

References d.

Referenced by KDChart::AbstractAxis::AbstractAxis().

void AbstractAxis::deleteObserver ( AbstractDiagram diagram  )  [inherited]
const AbstractDiagram * KDChart::AbstractAxis::diagram (  )  const [inherited]
Qt::Orientations TernaryAxis::expandingDirections (  )  const [virtual]

Definition at line 124 of file KDChartTernaryAxis.cpp.

FrameAttributes AbstractAreaBase::frameAttributes (  )  const [inherited]
QRect TernaryAxis::geometry (  )  const [virtual]

Implements KDChart::AbstractAxis.

Definition at line 98 of file KDChartTernaryAxis.cpp.

void AbstractAreaBase::getFrameLeadings ( int &  left,
int &  top,
int &  right,
int &  bottom 
) const [inherited]
bool TernaryAxis::hasDefaultTitleTextAttributes (  )  const

Definition at line 195 of file KDChartTernaryAxis.cpp.

QRect AbstractAreaBase::innerRect (  )  const [protected, inherited]
bool TernaryAxis::isEmpty (  )  const [virtual]

Definition at line 92 of file KDChartTernaryAxis.cpp.

QStringList AbstractAxis::labels (  )  const [inherited]

Returns a list of strings, that are used as axis labels, as set via setLabels.

See also:
setLabels

Definition at line 219 of file KDChartAbstractAxis.cpp.

References d.

Referenced by KDChart::AbstractAxis::compare(), KDChart::LeveyJenningsAxis::paintAsOrdinate(), paintCtx(), 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.

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

QSize TernaryAxis::maximumSize (  )  const [virtual]

Definition at line 114 of file KDChartTernaryAxis.cpp.

QSize TernaryAxis::minimumSize (  )  const [virtual]

Definition at line 108 of file KDChartTernaryAxis.cpp.

bool KDChart::AbstractAxis::observedBy ( AbstractDiagram diagram  )  const [inherited]

Definition at line 250 of file KDChartAbstractAxis.cpp.

References d.

void TernaryAxis::paint ( QPainter *   )  [virtual]

Implements KDChart::AbstractLayoutItem.

Definition at line 67 of file KDChartTernaryAxis.cpp.

void TernaryAxis::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::AbstractArea.

Definition at line 62 of file KDChartTernaryAxis.cpp.

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 TernaryAxis::paintCtx ( PaintContext context  )  [virtual]
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 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.

const Position TernaryAxis::position (  )  const [virtual]

Definition at line 129 of file KDChartTernaryAxis.cpp.

Referenced by requiredMargins(), and setPosition().

void KDChart::AbstractArea::positionChanged ( AbstractArea  )  [signal, inherited]
void AbstractArea::positionHasChanged (  )  [protected, virtual, inherited]

Reimplemented from KDChart::AbstractAreaBase.

Definition at line 152 of file KDChartAbstractArea.cpp.

References KDChart::AbstractArea::positionChanged().

void KDChart::AbstractLayoutItem::removeFromParentLayout (  )  [inherited]

Definition at line 80 of file KDChartLayoutItems.h.

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

QPair< QSizeF, QSizeF > TernaryAxis::requiredMargins (  )  const
void TernaryAxis::resetTitleTextAttributes (  ) 

Definition at line 188 of file KDChartTernaryAxis.cpp.

Referenced by TernaryAxis().

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.

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

RulerAttributes AbstractAxis::rulerAttributes (  )  const [inherited]

Returns the attributes to be used for painting the rulers.

See also:
setRulerAttributes

Definition at line 205 of file KDChartAbstractAxis.cpp.

References d.

Referenced by KDChart::CartesianAxis::paintCtx().

void AbstractAreaBase::setBackgroundAttributes ( const BackgroundAttributes a  )  [inherited]
void AbstractAreaBase::setFrameAttributes ( const FrameAttributes a  )  [inherited]
void TernaryAxis::setGeometry ( const QRect &  rect  )  [virtual]

Implements KDChart::AbstractAxis.

Definition at line 103 of file KDChartTernaryAxis.cpp.

void AbstractAxis::setLabels ( const QStringList &  list  )  [inherited]

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.

See also:
labels, setShortLabels

Definition at line 210 of file KDChartAbstractAxis.cpp.

References d, and KDChart::AbstractAxis::update().

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 TernaryAxis::setPosition ( Position  p  )  [virtual]
void AbstractAxis::setRulerAttributes ( const RulerAttributes a  )  [inherited]

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.

See also:
rulerAttributes

Definition at line 199 of file KDChartAbstractAxis.cpp.

References d, and KDChart::AbstractAxis::update().

void AbstractAxis::setShortLabels ( const QStringList &  list  )  [inherited]

Use this to specify your own set of strings, to be used as axis labels, in case the normal labels are too long.

Note:
Setting done via setShortLabels will be ignored, if you did not pass a non-empty string list via setLabels too!
By passing an empty QStringList you can reset the default behaviour.

See also:
shortLabels, setLabels

Definition at line 224 of file KDChartAbstractAxis.cpp.

References d, and KDChart::AbstractAxis::update().

void AbstractAxis::setTextAttributes ( const TextAttributes a  )  [inherited]

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.

See also:
textAttributes, setLabels

Definition at line 184 of file KDChartAbstractAxis.cpp.

References d, and KDChart::AbstractAxis::update().

Referenced by KDChart::LeveyJenningsAxis::setType().

void TernaryAxis::setTitleText ( const QString &  text  ) 

Definition at line 166 of file KDChartTernaryAxis.cpp.

References PrerenderedLabel::setText().

void TernaryAxis::setTitleTextAttributes ( const TextAttributes a  ) 

Definition at line 177 of file KDChartTernaryAxis.cpp.

QStringList AbstractAxis::shortLabels (  )  const [inherited]

Returns a list of strings, that are used as axis labels, as set via setShortLabels.

Note:
Setting done via setShortLabels will be ignored, if you did not pass a non-empty string list via setLabels too!
See also:
setShortLabels

Definition at line 233 of file KDChartAbstractAxis.cpp.

References d.

Referenced by KDChart::AbstractAxis::compare(), and KDChart::CartesianAxis::paintCtx().

QSize TernaryAxis::sizeHint (  )  const [virtual]

Definition at line 119 of file KDChartTernaryAxis.cpp.

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 [inherited]
QString TernaryAxis::titleText (  )  const

Definition at line 172 of file KDChartTernaryAxis.cpp.

References PrerenderedLabel::text().

TextAttributes TernaryAxis::titleTextAttributes (  )  const

Definition at line 183 of file KDChartTernaryAxis.cpp.

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.

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

void KDChart::AbstractAxis::update (  )  [slot, inherited]

Member Data Documentation

QLayout* KDChart::AbstractLayoutItem::mParentLayout [protected, inherited]

Definition at line 91 of file KDChartLayoutItems.h.

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


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines

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