kchart
KDChartCustomBox Class Reference
#include <KDChartCustomBox.h>
Detailed Description
Class for specifying and drawing custom boxes.
Definition at line 54 of file 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 |
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) | |
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) | |
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 |
Friends | |
class | KDChartPainter |
Constructor & Destructor Documentation
KDChartCustomBox::KDChartCustomBox | ( | ) | [inline] |
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 bothwidth
andheight
are zero andfontScaleGlobal
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.
Definition at line 106 of file KDChartCustomBox.h.
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 | |||
) | [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 bothwidth
andheight
are zero andfontScaleGlobal
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, iffontSize
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 casefontScaleGlobal
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 notAreaChartDataRegion
.dataCol The column number of the KDChart data region that is to be used as anchor area. This parameter is ignored if area
is notAreaChartDataRegion
.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 notAreaChartDataRegion
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 mainalign
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 mainalign
parameter is set to right too the anchor point will to be outside of the box / ifalign
is set to left (but thedeltaAlign
to right) the anchor point will be inside the box. Possible values fordeltaAlign
are:KDCHART_AlignAuto
Qt::AlignLeft
| Qt::AlignTopQt::AlignLeft
| Qt::AlignBottomQt::AlignRight
| Qt::AlignTopQt::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
anddeltaY
based upon the size of the drawing area, otherwise they will be calculated based upon the actual font size.
Definition at line 198 of file KDChartCustomBox.h.
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 | |||
) | [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 bothwidth
andheight
are zero andfontScaleGlobal
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, iffontSize
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 casefontScaleGlobal
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 notAreaChartDataRegion
.dataCol The column number of the KDChart data region that is to be used as anchor area. This parameter is ignored if area
is notAreaChartDataRegion
.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 notAreaChartDataRegion
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 mainalign
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 thedeltaX
value), so there will be a gap between the right side of the box and its anchor point IF the mainalign
flag is set to Qt::AlignRight too, so the anchor point will to be outside of the box then. However if the mainalign
flag is set to Qt::AlignLeft the anchor point will be inside the box. Possible values fordeltaAlign
are:KDCHART_AlignAuto
Qt::AlignLeft
| Qt::AlignTopQt::AlignLeft
| Qt::AlignBottomQt::AlignRight
| Qt::AlignTopQt::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 bydeltaAlign
= 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
anddeltaY
based upon the size of the drawing area, otherwise they will be calculated based upon the actual font size.
Definition at line 317 of file KDChartCustomBox.h.
KDChartCustomBox::~KDChartCustomBox | ( | ) | [virtual] |
Member Function Documentation
uint KDChartCustomBox::anchorAlign | ( | ) | const [inline, slot] |
Returns the way how the box is to be aligned to its anchor.
Definition at line 774 of file KDChartCustomBox.h.
uint KDChartCustomBox::anchorArea | ( | ) | const [inline, slot] |
Returns the area to which the box is to be aligned.
Definition at line 756 of file KDChartCustomBox.h.
bool KDChartCustomBox::anchorBeingCalculated | ( | ) | const [inline, protected] |
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.
Definition at line 766 of file KDChartCustomBox.h.
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
Definition at line 73 of file KDChartCustomBox.cpp.
QColor KDChartCustomBox::color | ( | ) | const [inline, slot] |
const KDChartTextPiece& KDChartCustomBox::content | ( | ) | const [inline, slot] |
Returns the text piece content that is to be drawn.
Definition at line 722 of file KDChartCustomBox.h.
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
Definition at line 349 of file KDChartCustomBox.cpp.
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.
Definition at line 805 of file KDChartCustomBox.h.
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.
Definition at line 794 of file KDChartCustomBox.h.
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.
Definition at line 784 of file KDChartCustomBox.h.
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
Definition at line 48 of file KDChartCustomBox.cpp.
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
Definition at line 846 of file KDChartCustomBox.h.
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
Definition at line 857 of file KDChartCustomBox.h.
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
Definition at line 820 of file KDChartCustomBox.h.
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
Definition at line 835 of file KDChartCustomBox.h.
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.
Definition at line 748 of file KDChartCustomBox.h.
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.
Definition at line 737 of file KDChartCustomBox.h.
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.
Definition at line 881 of file KDChartCustomBox.h.
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.
Definition at line 268 of file KDChartCustomBox.cpp.
const QBrush& KDChartCustomBox::paper | ( | ) | const [inline, slot] |
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
Definition at line 389 of file KDChartCustomBox.cpp.
int KDChartCustomBox::rotation | ( | ) | const [inline, slot] |
Returns the rotation angle of the box in degrees (0.
.360).
Definition at line 714 of file KDChartCustomBox.h.
void KDChartCustomBox::setAnchorAlign | ( | uint | align | ) | [inline, slot] |
Specifies the way how the box is to be aligned to its anchor.
Definition at line 507 of file KDChartCustomBox.h.
void KDChartCustomBox::setAnchorArea | ( | uint | area | ) | [inline, slot] |
Specifies the area to which the box is to be aligned.
Definition at line 488 of file KDChartCustomBox.h.
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.
Definition at line 498 of file KDChartCustomBox.h.
void KDChartCustomBox::setColor | ( | QColor | color | ) | [inline, slot] |
Specifies the text color to be used.
- Parameters:
-
color The text color.
Definition at line 696 of file KDChartCustomBox.h.
void KDChartCustomBox::setContent | ( | const KDChartTextPiece & | content | ) | [inline, slot] |
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.
Definition at line 535 of file KDChartCustomBox.h.
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
.
Definition at line 525 of file KDChartCustomBox.h.
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
.
Definition at line 516 of file KDChartCustomBox.h.
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::AlignTopQt::AlignLeft
| Qt::AlignBottomQt::AlignRight
| Qt::AlignTopQt::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 bydeltaAlign
= 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
anddeltaY
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
Definition at line 643 of file KDChartCustomBox.h.
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
anddeltaY
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
Definition at line 661 of file KDChartCustomBox.h.
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 bothwidth
andheight
are zero andfontScaleGlobal
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
anddeltaY
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
Definition at line 603 of file KDChartCustomBox.h.
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
anddeltaY
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
Definition at line 562 of file KDChartCustomBox.h.
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 bothwidth
andheight
are zero andfontScaleGlobal
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, iffontSize
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 casefontScaleGlobal
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.
Definition at line 479 of file KDChartCustomBox.h.
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.
Definition at line 938 of file KDChartCustomBox.h.
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.
Definition at line 706 of file KDChartCustomBox.h.
void KDChartCustomBox::setRotation | ( | int | rotation | ) | [inline, slot] |
Specifies the rotation angle of the box in degrees (0.
.360).
Definition at line 445 of file KDChartCustomBox.h.
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 bothwidth
andheight
are zero andfontScaleGlobal
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
Definition at line 685 of file KDChartCustomBox.h.
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.
Definition at line 178 of file KDChartCustomBox.cpp.
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.
Definition at line 869 of file KDChartCustomBox.h.
The documentation for this class was generated from the following files: