#include <KDChartCustomBox.h>
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 KDChartTextPiece & | content () 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 KDChartCustomBox * | clone () 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 |
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.
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>
.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.
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>
.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:
| |
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.
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>
.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:
|
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. 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] |
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.
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.
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.
QPainter
parameter. Passing a QPainter will give you more exact results.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.
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.
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.
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>
.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.
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. |
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.
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>
.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. |
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. 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. 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. |
void KDChartCustomBox::setDeltaScale | ( | bool | deltaScaleGlobal | ) | [inline, slot] |
Specifies the way how the distance between the box and its anchor will be calculated.
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. |
void KDChartCustomBox::setSize | ( | int | width, | |
int | height | |||
) | [inline, slot] |
Specifies the size of the box.
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>
.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. |
void KDChartCustomBox::setColor | ( | QColor | color | ) | [inline, slot] |
Specifies the text color to be used.
color | The text color. |
void KDChartCustomBox::setPaper | ( | const QBrush & | paper | ) | [inline, slot] |
Specifies the brush to be used for the background.
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.
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.
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.
uint KDChartCustomBox::deltaAlign | ( | ) | const [inline, slot] |
Returns the way how the values specified for deltaX and/or deltaY affect the position of the box.
bool KDChartCustomBox::deltaScaleGlobal | ( | ) | const [inline, slot] |
Returns the way how the distance between the box and its anchor is calculated.
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.
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.
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] |
friend class KDChartPainter [friend] |
friend class KDChartParams [friend] |
int KDChartCustomBox::_rotation [private] |
KDChartTextPiece KDChartCustomBox::_content [private] |
int KDChartCustomBox::_fontSize [private] |
bool KDChartCustomBox::_fontScaleGlobal [private] |
int KDChartCustomBox::_deltaX [private] |
int KDChartCustomBox::_deltaY [private] |
int KDChartCustomBox::_width [private] |
int KDChartCustomBox::_height [private] |
QColor KDChartCustomBox::_color [private] |
QBrush KDChartCustomBox::_paper [private] |
uint KDChartCustomBox::_anchorArea [private] |
uint KDChartCustomBox::_anchorAlign [private] |
uint KDChartCustomBox::_dataRow [private] |
uint KDChartCustomBox::_dataCol [private] |
uint KDChartCustomBox::_data3rd [private] |
uint KDChartCustomBox::_deltaAlign [private] |
bool KDChartCustomBox::_deltaScaleGlobal [private] |
bool KDChartCustomBox::_anchorBeingCalculated [private] |
int KDChartCustomBox::_parentAxisArea [private] |