KDChartCustomBox Class Reference

#include <KDChartCustomBox.h>

Inheritance diagram for KDChartCustomBox:

QObject
Collaboration diagram for KDChartCustomBox:

Collaboration graph
[legend]

List of all members.

Public Slots

float trueFontSize (double areaWidthP1000, double areaHeightP1000, int rectHeight) const
int trueFontLineSpacing (double areaWidthP1000, double areaHeightP1000, int rectHeight) const
int trueRectAlignX (const QRect &rect) const
int trueRectAlignY (const QRect &rect) const
void getTrueShift (double areaWidthP1000, double areaHeightP1000, int rectHeight, int &dX, int &dY) const
QRect trueRect (QPainter *painter, QPoint anchor, double areaWidthP1000, double areaHeightP1000) const
virtual QRect trueRect (QPoint anchor, double areaWidthP1000, double areaHeightP1000) const
virtual void paint (QPainter *painter, QPoint anchor, double areaWidthP1000, double areaHeightP1000, const KDFrame *frame=0, const QRect &frameRect=QRect(), const QColor *color=0, const QBrush *paper=0) const
void setRotation (int rotation)
void setContent (const KDChartTextPiece &content)
void setFontSize (int fontSize, bool fontScaleGlobal)
void setAnchorArea (uint area)
void setAnchorPosition (KDChartEnums::PositionFlag position)
void setAnchorAlign (uint align)
void setDataRow (uint dataRow)
void setDataCol (uint dataCol)
void setData3rd (uint data3rd)
void setDistanceAndSize (int deltaX, int deltaY, int width, int height, uint deltaAlign=KDCHART_AlignAuto, bool deltaScaleGlobal=true)
void setDistance (int deltaX, int deltaY, uint align=KDCHART_AlignAuto, bool deltaScaleGlobal=true)
void setDeltaAlign (uint align, bool deltaScaleGlobal=true)
void setDeltaScale (bool deltaScaleGlobal)
void setSize (int width, int height)
void setColor (QColor color)
void setPaper (const QBrush &paper)
int rotation () const
const KDChartTextPiececontent () const
int fontSize () const
bool fontScaleGlobal () const
uint anchorArea () const
KDChartEnums::PositionFlag anchorPosition () const
uint anchorAlign () const
uint dataRow () const
uint dataCol () const
uint data3rd () const
int deltaX () const
int deltaY () const
uint deltaAlign () const
bool deltaScaleGlobal () const
int width () const
int height () const
QColor color () const
const QBrush & paper () const

Public Member Functions

 KDChartCustomBox ()
 KDChartCustomBox (const KDChartTextPiece &content, int fontSize, bool fontScaleGlobal=true)
 KDChartCustomBox (const KDChartTextPiece &content, int fontSize, bool fontScaleGlobal, int deltaX, int deltaY, int width, int height, const QColor &color=QColor(Qt::black), const QBrush &paper=QBrush(Qt::NoBrush), uint area=KDChartEnums::AreaInnermost, KDChartEnums::PositionFlag position=KDChartEnums::PosTopLeft, uint align=Qt::AlignTop+Qt::AlignLeft, uint dataRow=0, uint dataCol=0, uint data3rd=0, uint deltaAlign=KDCHART_AlignAuto, bool deltaScaleGlobal=true, int parentAxis=-1)
 KDChartCustomBox (int rotation, const KDChartTextPiece &content, int fontSize, bool fontScaleGlobal, int deltaX, int deltaY, int width, int height, const QColor &color=QColor(Qt::black), const QBrush &paper=QBrush(Qt::NoBrush), uint area=KDChartEnums::AreaInnermost, KDChartEnums::PositionFlag position=KDChartEnums::PosTopLeft, uint align=Qt::AlignTop+Qt::AlignLeft, uint dataRow=0, uint dataCol=0, uint data3rd=0, uint deltaAlign=KDCHART_AlignAuto, bool deltaScaleGlobal=true, int parentAxis=-1)
virtual ~KDChartCustomBox ()
void deepCopy (const KDChartCustomBox *source)
const KDChartCustomBoxclone () const

Static Public Member Functions

static void createCustomBoxNode (QDomDocument &document, QDomNode &parent, const QString &elementName, const KDChartCustomBox *custombox)
static bool readCustomBoxNode (const QDomElement &element, KDChartCustomBox &custombox)

Protected Member Functions

void setInternalFlagAnchorBeingCalculated (bool flag) const
bool anchorBeingCalculated () const
void setParentAxisArea (int parentAxis) const
int parentAxisArea () const

Private Member Functions

 KDChartCustomBox (const KDChartCustomBox &)

Private Attributes

int _rotation
KDChartTextPiece _content
int _fontSize
bool _fontScaleGlobal
int _deltaX
int _deltaY
int _width
int _height
QColor _color
QBrush _paper
uint _anchorArea
KDChartEnums::PositionFlag _anchorPos
uint _anchorAlign
uint _dataRow
uint _dataCol
uint _data3rd
uint _deltaAlign
bool _deltaScaleGlobal
bool _anchorBeingCalculated
int _parentAxisArea

Friends

class KDChartPainter
class KDChartParams


Detailed Description

Class for specifying and drawing custom boxes.

Constructor & Destructor Documentation

KDChartCustomBox::KDChartCustomBox (  )  [inline]

Constructor. Set default values.

KDChartCustomBox::KDChartCustomBox ( const KDChartTextPiece content,
int  fontSize,
bool  fontScaleGlobal = true 
) [inline]

Constructor. Set content and font size but no position/size parameters.

Note:
If fontScaleGlobal is set to true it is not necessary to specify the size of the box: if both width and height are zero and fontScaleGlobal is true the size of the box will be calculated automatically based upon the content size. In this case the content size is interpreted as rich text string - even if the text is NOT framed by <qt> and </qt>.
Parameters:
content The string or rich text string to be written into the box.
fontSize The size of the font to be used, see explanation above.
fontScaleGlobal If true the font size will be calculated based upon the the size of the drawing area, otherwise it will be calculated based upon the height of the box.

KDChartCustomBox::KDChartCustomBox ( const KDChartTextPiece content,
int  fontSize,
bool  fontScaleGlobal,
int  deltaX,
int  deltaY,
int  width,
int  height,
const QColor &  color = QColor( Qt::black   ),
const QBrush &  paper = QBrush( Qt::NoBrush ),
uint  area = KDChartEnums::AreaInnermost,
KDChartEnums::PositionFlag  position = KDChartEnums::PosTopLeft,
uint  align = Qt::AlignTop + Qt::AlignLeft,
uint  dataRow = 0,
uint  dataCol = 0,
uint  data3rd = 0,
uint  deltaAlign = KDCHART_AlignAuto,
bool  deltaScaleGlobal = true,
int  parentAxis = -1 
) [inline]

Constructor. Set content and position/size parameters and the color and brush to be used.

Note:
If fontScaleGlobal is set to true it is not necessary to specify the size of the box: if both width and height are zero and fontScaleGlobal is true the size of the box will be calculated automatically based upon the content size. In this case the content size is interpreted as rich text string - even if the text is NOT framed by <qt> and </qt>.
Parameters:
content The text piece to be displayed.
fontSize If fontSize value is greater 0, the value is taken as exact size, if fontSize is less than 0 it is interpreted as being a per-mille value of the size of the drawing area (or of the height of the box in case fontScaleGlobal is set to false, resp.). Normally the actual font size is calculated dynamically in methode paint. However if fontSize is zero no calculating will take place but the size of the content font is used.
fontScaleGlobal If true the font size will be calculated based upon the the size of the drawing area, otherwise it will be calculated based upon the height of the box.
deltaX The X distance between the box and its anchor. Note: If greater 0, the value is taken as exact offset, if less than 0, it is interpreted as being a per-mille value of the size of the drawing area (or as percent value of the actual font size (as returned by QFontMetrics::lineSpacing() ) if deltaScaleGlobal is FALSE, resp.). Actual drawing position/size is calculated dynamically in methode trueRect.
deltaY The Y distance between the box and its anchor.
width The width of the box.
height The height of the box.
color The text color.
paper The brush to be used for the background.
area The area to which the box is to be aligned.
position The anchor position. This is the edge (or the corner, resp.) of the area to which the box is to be aligned.
align The way how the box is to be aligned to its anchor.
dataRow The row number of the KDChart data region that is to be used as anchor area. This parameter is ignored if area is not AreaChartDataRegion.
dataCol The column number of the KDChart data region that is to be used as anchor area. This parameter is ignored if area is not AreaChartDataRegion.
data3rd The third dimensions number of the KDChart data region that is to be used as anchor area. This parameter is ignored if area is not AreaChartDataRegion or if there is no 3-dimensional data structure.
deltaAlign The way how deltaX and affect the position of the box. Leave this parameter to its default value KDCHART_AlignAuto to have the delta values used according to the box's main align settings, otherwise specify your own alignment settings: e.g. right means there will be a gap between the right side of the box and its anchor point - if the main align parameter is set to right too the anchor point will to be outside of the box / if align is set to left (but the deltaAlign to right) the anchor point will be inside the box. Possible values for deltaAlign are:
  • KDCHART_AlignAuto
  • Qt::AlignLeft | Qt::AlignTop
  • Qt::AlignLeft | Qt::AlignBottom
  • Qt::AlignRight | Qt::AlignTop
  • Qt::AlignRight | Qt::AlignBottom Using AlignVCenter or AlignHCenter or AlignCenter does not make sense here: center delta alignment will cause KDChart to ignore the respective delta settings: deltaX or deltaY or both will become ineffective.
deltaScaleGlobal If true the actual delta X and delta Y values will be calculated by deltaX and deltaY based upon the size of the drawing area, otherwise they will be calculated based upon the actual font size.

KDChartCustomBox::KDChartCustomBox ( int  rotation,
const KDChartTextPiece content,
int  fontSize,
bool  fontScaleGlobal,
int  deltaX,
int  deltaY,
int  width,
int  height,
const QColor &  color = QColor( Qt::black   ),
const QBrush &  paper = QBrush( Qt::NoBrush ),
uint  area = KDChartEnums::AreaInnermost,
KDChartEnums::PositionFlag  position = KDChartEnums::PosTopLeft,
uint  align = Qt::AlignTop + Qt::AlignLeft,
uint  dataRow = 0,
uint  dataCol = 0,
uint  data3rd = 0,
uint  deltaAlign = KDCHART_AlignAuto,
bool  deltaScaleGlobal = true,
int  parentAxis = -1 
) [inline]

Constructor. Use this special constructor to specify a rotated box, reference point of the rotation is the anchor specified by the area and the position parameters.

Note:
If fontScaleGlobal is set to true it is not necessary to specify the size of the box: if both width and height are zero and fontScaleGlobal is true the size of the box will be calculated automatically based upon the content size. In this case the content size is interpreted as rich text string - even if the text is NOT framed by <qt> and </qt>.
Parameters:
rotation The box's rotation angle in degrees (0 .. 360).
content The text piece to be displayed.
fontSize If fontSize value is greater 0, the value is taken as exact size, if fontSize is less than 0 it is interpreted as being a per-mille value of the size of the drawing area (or of the height of the box in case fontScaleGlobal is set to false, resp.). Normally the actual font size is calculated dynamically in methode paint. However if fontSize is zero no calculating will take place but the size of the content font is used.
fontScaleGlobal If true the font size will be calculated based upon the the size of the drawing area, otherwise it will be calculated based upon the height of the box.
deltaX The X distance between the box and its anchor. Note: If greater 0, the value is taken as exact offset, if less than 0, it is interpreted as being a per-mille value of the width of the drawing area (or as percent value of the actual font size (as returned by QFontMetrics::lineSpacing() ) if deltaScaleGlobal is FALSE, resp.). Actual drawing position/size is calculated dynamically in method trueRect.
deltaY The Y distance between the box and its anchor. Note: If greater 0, the value is taken as exact offset, if less than 0, it is interpreted as being a per-mille value of the height of the drawing area (or as percent value of the actual font size (as returned by QFontMetrics::lineSpacing() ) if deltaScaleGlobal is FALSE, resp.). Actual drawing position/size is calculated dynamically in method trueRect.
width The width of the box.
height The height of the box.
color The text color.
paper The brush to be used for the background.
area The area to which the box is to be aligned.
position The anchor position. This is the edge (or the corner, resp.) of the area to which the box is to be aligned and it is also used as the reference point of the rotation.
align The way how the box is to be aligned to its anchor.
dataRow The row number of the KDChart data region that is to be used as anchor area. This parameter is ignored if area is not AreaChartDataRegion.
dataCol The column number of the KDChart data region that is to be used as anchor area. This parameter is ignored if area is not AreaChartDataRegion.
data3rd The third dimensions number of the KDChart data region that is to be used as anchor area. This parameter is ignored if area is not AreaChartDataRegion or if there is no 3-dimensional data structure.
deltaAlign The way how deltaX and affect the position of the box. Leave this parameter to its default value KDCHART_AlignAuto to have the delta values used according to the box's main align settings, otherwise specify your own alignment settings: e.g. Qt::AlignRight means the box will be moved to the left (by the amount calculated using the deltaX value), so there will be a gap between the right side of the box and its anchor point IF the main align flag is set to Qt::AlignRight too, so the anchor point will to be outside of the box then. However if the main align flag is set to Qt::AlignLeft the anchor point will be inside the box. Possible values for deltaAlign are:
  • KDCHART_AlignAuto
  • Qt::AlignLeft | Qt::AlignTop
  • Qt::AlignLeft | Qt::AlignBottom
  • Qt::AlignRight | Qt::AlignTop
  • Qt::AlignRight | Qt::AlignBottom Using AlignVCenter or AlignHCenter or AlignCenter does not make sense here: center delta alignment will cause KDChart to ignore the respective delta settings: deltaX or deltaY or both will become ineffective.
Note:
Moving of the box due to deltaAlign settings is applied after the box is rotated: e.g. this means a gap specified by deltaAlign = Qt::AlignTop gap will actually result in a left gap if the box is rotated by 90 degrees.
Parameters:
deltaScaleGlobal If true the actual delta X and delta Y values will be calculated by deltaX and deltaY based upon the size of the drawing area, otherwise they will be calculated based upon the actual font size.

virtual KDChartCustomBox::~KDChartCustomBox (  )  [virtual]

Destructor. Only defined to have it virtual.

KDChartCustomBox::KDChartCustomBox ( const KDChartCustomBox  )  [inline, private]


Member Function Documentation

static void KDChartCustomBox::createCustomBoxNode ( QDomDocument &  document,
QDomNode &  parent,
const QString &  elementName,
const KDChartCustomBox custombox 
) [static]

Creates a DOM element node that represents a custom box for use in a DOM document.

Parameters:
document the DOM document to which the node will belong
parent the parent node to which the new node will be appended
elementName the name of the new node
custombox the custom box to be represented

static bool KDChartCustomBox::readCustomBoxNode ( const QDomElement &  element,
KDChartCustomBox custombox 
) [static]

Reads data from a DOM element node that represents a custom box object and fills a KDChartCustomBox object with the data.

Parameters:
element the DOM element to read from
settings the custom box object to read the data into

float KDChartCustomBox::trueFontSize ( double  areaWidthP1000,
double  areaHeightP1000,
int  rectHeight 
) const [slot]

int KDChartCustomBox::trueFontLineSpacing ( double  areaWidthP1000,
double  areaHeightP1000,
int  rectHeight 
) const [slot]

int KDChartCustomBox::trueRectAlignX ( const QRect &  rect  )  const [slot]

int KDChartCustomBox::trueRectAlignY ( const QRect &  rect  )  const [slot]

void KDChartCustomBox::getTrueShift ( double  areaWidthP1000,
double  areaHeightP1000,
int  rectHeight,
int &  dX,
int &  dY 
) const [slot]

QRect KDChartCustomBox::trueRect ( QPainter *  painter,
QPoint  anchor,
double  areaWidthP1000,
double  areaHeightP1000 
) const [slot]

Return the actual rectangle which to draw box into.

Note:
When ever possible, use this method, instead of the other trueRect(), that has no QPainter parameter. Passing a QPainter will give you more exact results.
Parameters:
painter The QPainter to be used.
anchor The anchor point which the box is to be aligned to. This can be any point within the painter drawing area but you will probably compute a point using anchorArea(), anchorPosition(), anchorAlign() (and dataRow(), dataCol(), data3rd() when dealing with KDChart data regions, resp.)
areaWidthP1000 The thousands part of the logical width of the area to be used for drawing.
areaHeightP1000 The thousands part of the logical height of the area to be used for drawing.

virtual QRect KDChartCustomBox::trueRect ( QPoint  anchor,
double  areaWidthP1000,
double  areaHeightP1000 
) const [virtual, slot]

Return the actual rectangle which to draw box into.

Parameters:
anchor The anchor point which the box is to be aligned to. This can be any point within the painter drawing area but you will probably compute a point using anchorArea(), anchorPosition(), anchorAlign() (and dataRow(), dataCol(), data3rd() when dealing with KDChart data regions, resp.)
areaWidthP1000 The thousands part of the logical width of the area to be used for drawing.
areaHeightP1000 The thousands part of the logical height of the area to be used for drawing.

virtual void KDChartCustomBox::paint ( QPainter *  painter,
QPoint  anchor,
double  areaWidthP1000,
double  areaHeightP1000,
const KDFrame frame = 0,
const QRect &  frameRect = QRect(),
const QColor *  color = 0,
const QBrush *  paper = 0 
) const [virtual, slot]

Paints the box.

Parameters:
painter The QPainter to be used for drawing.
anchor The anchor point which the box is to be aligned to. This can be any point within the painter drawing area but you will probably compute a point using anchorArea(), anchorPosition(), anchorAlign() (and dataRow(), dataCol(), data3rd() when dealing with KDChart data regions, resp.)
areaWidthP1000 The thousands part of the drawing area width.
areaHeightP1000 The thousands part of the drawing area height.
color The text color to be used.
paper The brush to be used for the background.
rect The rectangle to be drawn into. If empty the rectangle will be calculated dynamically based upon the x, y, width, height values (that were set via Constructor or via setPosAndSize) and based upon the logical height (or width, resp.) of the painters drawing area.

void KDChartCustomBox::setRotation ( int  rotation  )  [inline, slot]

Specifies the rotation angle of the box in degrees (0..360).

void KDChartCustomBox::setContent ( const KDChartTextPiece content  )  [inline, slot]

Specifies the text piece content to be drawn.

void KDChartCustomBox::setFontSize ( int  fontSize,
bool  fontScaleGlobal 
) [inline, slot]

Specifies the font size to be used.

Note:
If fontScaleGlobal is set to true it is not necessary to specify the size of the box: if both width and height are zero and fontScaleGlobal is true the size of the box will be calculated automatically based upon the content size. In this case the content size is interpreted as rich text string - even if the text is NOT framed by <qt> and </qt>.
Parameters:
fontSize If fontSize value is greater 0, the value is taken as exact size, if fontSize is less than 0 it is interpreted as being a per-mille value of the size of the drawing area (or of the height of the box in case fontScaleGlobal is set to false, resp.). Normally the actual font size is calculated dynamically in methode paint. However if fontSize is zero no calculating will take place but the size of the content font is used.
fontScaleGlobal If true the font size will be calculated based upon the the size of the drawing area, otherwise it will be calculated based upon the height of the box.

void KDChartCustomBox::setAnchorArea ( uint  area  )  [inline, slot]

Specifies the area to which the box is to be aligned.

void KDChartCustomBox::setAnchorPosition ( KDChartEnums::PositionFlag  position  )  [inline, slot]

Specifies the anchor position. This is the edge (or the corner, resp.) of the area to which the box is to be aligned.

void KDChartCustomBox::setAnchorAlign ( uint  align  )  [inline, slot]

Specifies the way how the box is to be aligned to its anchor.

void KDChartCustomBox::setDataRow ( uint  dataRow  )  [inline, slot]

Specifies the row number of the KDChart data region that is to be used as anchor area. This value is ignored if anchorArea is not AreaChartDataRegion.

void KDChartCustomBox::setDataCol ( uint  dataCol  )  [inline, slot]

Specifies the column number of the KDChart data region that is to be used as anchor area. This value is ignored if anchorArea is not AreaChartDataRegion.

void KDChartCustomBox::setData3rd ( uint  data3rd  )  [inline, slot]

Specifies the third dimensions number of the KDChart data region that is to be used as anchor area. This value is ignored if anchorArea is not AreaChartDataRegion or if there is no 3-dimensional data structure.

void KDChartCustomBox::setDistanceAndSize ( int  deltaX,
int  deltaY,
int  width,
int  height,
uint  deltaAlign = KDCHART_AlignAuto,
bool  deltaScaleGlobal = true 
) [inline, slot]

Specifies the distance between the box and the anchor point and specifies the size of the box.

Parameters:
deltaX The X distance between the box and its anchor. Note: If greater 0, the value is taken as exact offset, if less than 0, it is interpreted as being a per-mille value of the size of the drawing area (or as percent value of the actual font size (as returned by QFontMetrics::lineSpacing() ) if deltaScaleGlobal is FALSE, resp.). Actual drawing position/size is calculated dynamically in methode trueRect.
deltaY The Y distance between the box and its anchor.
width The width of the drawing region.
height The height of the drawing region.
deltaAlign the way how the values specified for deltaX and/or deltaY affect the position of the box.
deltaScaleGlobal If true the actual delta X and delta Y values will be calculated by deltaX and deltaY based upon the size of the drawing area, otherwise they will be calculated based upon the actual font size.
See also:
setDistance, setSize, setDeltaAlign, setDeltaScale

void KDChartCustomBox::setDistance ( int  deltaX,
int  deltaY,
uint  align = KDCHART_AlignAuto,
bool  deltaScaleGlobal = true 
) [inline, slot]

Specifies the distance between the box and the anchor point.

Note:
If fontScaleGlobal is set to true it is not necessary to specify the size of the box: if both width and height are zero and fontScaleGlobal is true the size of the box will be calculated automatically based upon the content size. In this case the content size is interpreted as rich text string - even if the text is NOT framed by <qt> and </qt>.
Parameters:
deltaX The X distance between the box and its anchor. Note: If greater 0, the value is taken as exact offset, if less than 0, it is interpreted as being a per-mille value of the size of the drawing area (or as percent value of the actual font size (as returned by QFontMetrics::lineSpacing() ) if deltaScaleGlobal is FALSE, resp.). Actual drawing position/size is calculated dynamically in methode trueRect.
deltaY The Y distance between the box and its anchor.
align the way how the values specified for deltaX and/or deltaY affect the position of the box.
deltaScaleGlobal If true the actual delta X and delta Y values will be calculated by deltaX and deltaY based upon the size of the drawing area, otherwise they will be calculated based upon the actual font size.
See also:
setDistanceAndSize, setSize, setDeltaAlign, setDeltaScale

void KDChartCustomBox::setDeltaAlign ( uint  align,
bool  deltaScaleGlobal = true 
) [inline, slot]

Specifies the way how the values specified for deltaX and/or deltaY affect the position of the box.

Set this to KDHART_KDCHART_AlignAuto to have the delta values used according to the box's main align settings, otherwise specify your own alignment settings: e.g. right means there will be a gap between the right side of the box and its anchor point - if the main align parameter is set to right too the anchor point will to be outside of the box / if align is set to left (but the deltaAlign to right) the anchor point will be inside the box. Possible values for deltaAlign are:

  • KDCHART_AlignAuto
  • Qt::AlignLeft | Qt::AlignTop
  • Qt::AlignLeft | Qt::AlignBottom
  • Qt::AlignRight | Qt::AlignTop
  • Qt::AlignRight | Qt::AlignBottom Using AlignVCenter or AlignHCenter or AlignCenter does not make sense here: center delta alignment will cause KDChart to ignore the respective delta settings: deltaX or deltaY or both will become ineffective.
    Note:
    Moving of the box due to deltaAlign settings is applied after the box is rotated: e.g. this means a gap specified by deltaAlign = Qt::AlignTop gap will actually result in a left gap if the box is rotated by 90 degrees.
    Parameters:
    deltaScaleGlobal If true the actual delta X and delta Y values will be calculated by deltaX and deltaY based upon the size of the drawing area, otherwise they will be calculated based upon the actual font size.
    See also:
    setDeltaScale, setDistance, setDistanceAndSize, deltaAlign

void KDChartCustomBox::setDeltaScale ( bool  deltaScaleGlobal  )  [inline, slot]

Specifies the way how the distance between the box and its anchor will be calculated.

Parameters:
deltaScaleGlobal If true the actual delta X and delta Y values will be calculated by deltaX and deltaY based upon the size of the drawing area, otherwise they will be calculated based upon the actual font size.
See also:
setDeltaAlign, setDistance, setDistanceAndSize, deltaAlign

void KDChartCustomBox::setSize ( int  width,
int  height 
) [inline, slot]

Specifies the size of the box.

Note:
If fontScaleGlobal is set to true it is not necessary to specify the size of the box: if both width and height are zero and fontScaleGlobal is true the size of the box will be calculated automatically based upon the content size. In this case the content size is interpreted as rich text string - even if the text is NOT framed by <qt> and </qt>.
Parameters:
width The width of the box. Note: If greater 0, the value is taken as exact offset, if less than 0, it is interpreted as being a per-mille value of the logical height (or width, resp.) of the area to be used for drawing. Actual drawing position/size is calculated dynamically in methode trueRect.
height The height of the box.
See also:
setDistance, setDistanceAndSize, setDeltaAlign

void KDChartCustomBox::setColor ( QColor  color  )  [inline, slot]

Specifies the text color to be used.

Parameters:
color The text color.

void KDChartCustomBox::setPaper ( const QBrush &  paper  )  [inline, slot]

Specifies the brush to be used for the background.

Parameters:
paper The brush to be used for the background.

int KDChartCustomBox::rotation (  )  const [inline, slot]

Returns the rotation angle of the box in degrees (0..360).

const KDChartTextPiece& KDChartCustomBox::content (  )  const [inline, slot]

Returns the text piece content that is to be drawn.

int KDChartCustomBox::fontSize (  )  const [inline, slot]

Returns the font size to be used.

Note:
If fontSize value is greater 0, the value is taken as exact size, if less than 0, it is interpreted as being a per-mille value of the logical height (or width, resp.) of the area to be used for drawing. Normally the actual font size is calculated dynamically in methode paint. However if fontSize is zero no calculating will take place but the size of the content font is used.

bool KDChartCustomBox::fontScaleGlobal (  )  const [inline, slot]

Returns the way how the font size is calculated if fontSize() is negative.

If true the font size will be calculated based upon the the size of the drawing area, otherwise it will be calculated based upon the height of the box.

uint KDChartCustomBox::anchorArea (  )  const [inline, slot]

Returns the area to which the box is to be aligned.

KDChartEnums::PositionFlag KDChartCustomBox::anchorPosition (  )  const [inline, slot]

Returns the anchor position. This is the edge (or the corner, resp.) of the area to which the box is to be aligned.

uint KDChartCustomBox::anchorAlign (  )  const [inline, slot]

Returns the way how the box is to be aligned to its anchor.

uint KDChartCustomBox::dataRow (  )  const [inline, slot]

Returns the row number of the KDChart data region that is to be used as anchor area. You should use this if anchorArea is AreaChartDataRegion to find out the data region which the box is to be aligned to.

uint KDChartCustomBox::dataCol (  )  const [inline, slot]

Returns the column number of the KDChart data region that is to be used as anchor area. You should use this if anchorArea is AreaChartDataRegion to find out the data region which the box is to be aligned to.

uint KDChartCustomBox::data3rd (  )  const [inline, slot]

Returns the third dimensions number of the KDChart data region that is to be used as anchor area. You should use this if anchorArea is AreaChartDataRegion and if there is a 3-dimensional data structure to find out the data region which the box is to be aligned to.

int KDChartCustomBox::deltaX (  )  const [inline, slot]

Returns the X distance between the box and its anchor. Note: If greater 0, the value is taken as exact offset, if less than 0, it is interpreted as being a per-mille value of the size of the drawing area (or as percent value of the actual font size (as returned by QFontMetrics::lineSpacing() ) if deltaScaleGlobal is FALSE, resp.). Actual drawing position/size is calculated dynamically in methode trueRect.

See also:
deltaY, deltaAlign, deltaScaleGlobal

int KDChartCustomBox::deltaY (  )  const [inline, slot]

Returns the Y distance between the box and its anchor. Note: If greater 0, the value is taken as exact offset, if less than 0, it is interpreted as being a per-mille value of the size of the drawing area (or as percent value of the actual font size (as returned by QFontMetrics::lineSpacing() ) if deltaScaleGlobal is FALSE, resp.). Actual drawing position/size is calculated dynamically in methode trueRect.

See also:
deltaX, deltaAlign, deltaScaleGlobal

uint KDChartCustomBox::deltaAlign (  )  const [inline, slot]

Returns the way how the values specified for deltaX and/or deltaY affect the position of the box.

See also:
setDeltaAlign, deltaX, deltaY, deltaScaleGlobal

bool KDChartCustomBox::deltaScaleGlobal (  )  const [inline, slot]

Returns the way how the distance between the box and its anchor is calculated.

See also:
setDeltaScaleGlobal, deltaX, deltaY, deltaAlign

int KDChartCustomBox::width (  )  const [inline, slot]

Returns the width of the region where to draw the box. Note: If greater 0, the value is the exact offset, if less than 0, it is interpreted as being a per-mille value of the logical height (or width, resp.) of the area to be used for drawing. Actual drawing position/size is calculated dynamically in methode trueRect.

int KDChartCustomBox::height (  )  const [inline, slot]

Returns the height of the region where to draw the box. Note: If greater 0, the value is the exact offset, if less than 0, it is interpreted as being a per-mille value of the logical height (or width, resp.) of the area to be used for drawing. Actual drawing position/size is calculated dynamically in methode trueRect.

QColor KDChartCustomBox::color (  )  const [inline, slot]

Returns the text color.

const QBrush& KDChartCustomBox::paper (  )  const [inline, slot]

Returns the background brush.

void KDChartCustomBox::deepCopy ( const KDChartCustomBox source  ) 

Copy the settings of box source into this box.

Note:
Use this method instead of using the assignment operator.
See also:
clone

const KDChartCustomBox* KDChartCustomBox::clone (  )  const

Create a new box on the heap, copy the settings stored by this box into the newly created box and return the pointer to the new box.

Note:
Use this method instead of using the copy constructor.
See also:
deepCopy

void KDChartCustomBox::setInternalFlagAnchorBeingCalculated ( bool  flag  )  const [inline, protected]

Internal routine for recursion handling. Note: This is a const methode changing NO VITAL information of the box but setting an internal, temporary flag.

bool KDChartCustomBox::anchorBeingCalculated (  )  const [inline, protected]

Internal routine for recursion handling.

void KDChartCustomBox::setParentAxisArea ( int  parentAxis  )  const [inline, protected]

int KDChartCustomBox::parentAxisArea (  )  const [inline, protected]


Friends And Related Function Documentation

friend class KDChartPainter [friend]

friend class KDChartParams [friend]


Member Data Documentation

int KDChartCustomBox::_width [private]

QColor KDChartCustomBox::_color [private]

QBrush KDChartCustomBox::_paper [private]


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

Generated on Wed Jan 26 13:06:22 2011 for KMyMoney by  doxygen 1.5.6