Label

class Label: public AlterableObject

Implements a label object.

Inherits from AlterableObject.

Summary
LabelImplements a label object.
Functions
LabelInitializes the object.
~LabelReleases all allocated resources.
DrawDraws the label.
DrawLabelsUnused function.
ChangePositionChanges the position of the label.
ChangePositionCalls ChangePosition(int, int).
ChangeTextChanges the text of the label.
ChangeAlphaChanges the alpha value of the label’s font.
GetRedReturns the red color value of the label’s font.
GetGreenReturns the green color value of the label’s font.
GetBlueReturns the blue color value of the label’s font.
GetAlphaReturns the alpha color value of the label’s font.
GetTextReturns the text of the label.
GetLeftReturns the X coordinate of the label.
GetTopReturns the Y coordinate of the label.
GetOrientationReturns the orientation of the label, either ORIENTATION_HORIZONTAL or ORIENTATION_VERTICAL.
GetAlignmentReturns the alignment of the label, either Qt::AlignCenter, Qt::AlignLeft or Qt::AlignRight.
GetStyleReturns the style flags of the label.

Functions

Label

Label(QString sText,
int iStyle,
int iLeft,
int iTop,
int iOrientation,
int iAlignment)

Initializes the object.

Parameters

sTextThe text for the label.
iStyleStyle flags for the label.
iLeftX value of the label in QPainter coordinates.
iTopY value of the label in QPainter coordinates.
iOrientationORIENTATION_HORIZONTAL or ORIENTATION_VERTICAL.
iAlignmentQt::AlignCenter, Qt::AlignLeft or Qt::AlignRight.

~Label

~Label()

Releases all allocated resources.

Draw

void Draw(QPainter *pPainter)

Draws the label.  Inherited from AlterableObject.

Parameters

pPainterThe QPainter object that shall be used for painting.

DrawLabels

void DrawLabels(QPainter *pPainter)

Unused function.  Inherited from AlterableObject.

Parameters

pPainterUnused parameter.

ChangePosition

void ChangePosition(int iLeft,
int iTop)

Changes the position of the label.

Parameters

iLeftTotal horizontal distance in pixels.
iTopTotal vertical distance in pixels.

ChangePosition

void ChangePosition(float fDeltaLeft,
float fDeltaTop,
float fDeltaBottom)

Calls ChangePosition(int, int).  Inherited from AlterableObject.

Parameters

fDeltaLeftTotal horizontal distance in pixels.
fDeltaTopTotal vertical distance according to the upper vertices in pixels.
fDeltaBottomUnused parameter.

ChangeText

void ChangeText(QString sText)

Changes the text of the label.

Parameters

sTextNew text to be displayed.

ChangeAlpha

void ChangeAlpha(float fDeltaAlpha)

Changes the alpha value of the label’s font.

Parameters

fDeltaAlphaChange of alpha value.

GetRed

float GetRed()

Returns the red color value of the label’s font.

Returns

The red color value of the label’s font.

GetGreen

float GetGreen()

Returns the green color value of the label’s font.

Returns

The green color value of the label’s font.

GetBlue

float GetBlue()

Returns the blue color value of the label’s font.

Returns

The blue color value of the label’s font.

GetAlpha

float GetAlpha()

Returns the alpha color value of the label’s font.

Returns

The alpha color value of the label’s font.

GetText

QString GetText()

Returns the text of the label.

Returns

The text of the label.

GetLeft

int GetLeft()

Returns the X coordinate of the label.

Returns

The X coordinate of the label.

GetTop

int GetTop()

Returns the Y coordinate of the label.

Returns

The Y coordinate of the label.

GetOrientation

int GetOrientation()

Returns the orientation of the label, either ORIENTATION_HORIZONTAL or ORIENTATION_VERTICAL.

Returns

The orientation of the label.

GetAlignment

int GetAlignment()

Returns the alignment of the label, either Qt::AlignCenter, Qt::AlignLeft or Qt::AlignRight.

Returns

The alignment of the label.

GetStyle

int GetStyle()

Returns the style flags of the label.

Returns

The style flags of the label.

class Label: public AlterableObject
Implements a label object.
Label(QString sText,
int iStyle,
int iLeft,
int iTop,
int iOrientation,
int iAlignment)
Initializes the object.
~Label()
Releases all allocated resources.
void Draw(QPainter *pPainter)
Draws the label.
void DrawLabels(QPainter *pPainter)
Unused function.
void ChangePosition(int iLeft,
int iTop)
Changes the position of the label.
void ChangeText(QString sText)
Changes the text of the label.
void ChangeAlpha(float fDeltaAlpha)
Changes the alpha value of the label’s font.
float GetRed()
Returns the red color value of the label’s font.
float GetGreen()
Returns the green color value of the label’s font.
float GetBlue()
Returns the blue color value of the label’s font.
float GetAlpha()
Returns the alpha color value of the label’s font.
QString GetText()
Returns the text of the label.
int GetLeft()
Returns the X coordinate of the label.
int GetTop()
Returns the Y coordinate of the label.
int GetOrientation()
Returns the orientation of the label, either ORIENTATION_HORIZONTAL or ORIENTATION_VERTICAL.
Indicator for horizontal orientation.
Indicator for vertical orientation.
int GetAlignment()
Returns the alignment of the label, either Qt::AlignCenter, Qt::AlignLeft or Qt::AlignRight.
int GetStyle()
Returns the style flags of the label.
class AlterableObject
Abstract class that implements the skeleton of an alterable object, i.e.
Close