Qwt Programmer's Manual

QwtScale


NAME

QwtScale - A Widget which contains a scale

SYNOPSIS

#include <qwt_scale.h>

INHERITED CLASSES

QWidget

PUBLIC MEMBERS

QwtScale
Constructor
~QwtScale
Destructor
enableTitle
Enable or disable the title
setBaselineDist
Specify the border distance of the base line
setBorderDist
Set the border distances of the scale's endpoints
setScale
Assign a scale
setTitle
Assign a title
setTitleFont
Set the title font
setTitleColor
Set the title color
title
Return the title
titleFont
Return the title font
titleColor
Return the title color
minBorderDist
Return a recommended minimum offset
sizeHint
Return a size hint

PROTECTED MEMBERS

scaleChange
Notify a change of the scale
fontChange
Notify a change of the font

DESCRIPTION

This Widget can be used to decorate composite widgets with a scale.

MEMBER FUNCTION DESCRIPTION


QwtScale::QwtScale

Construct a QwtScale object

Syntax

QwtScale::QwtScale(QwtScale::Orientation ori, QWidget *parent, const char *name = 0)

Parameters

QwtScale::Orientation ori
Orientation. Must be one of QwtScale::Left, QwtScale::Right, QwtScale::Bottom, or QwtScale::Top
QWidget *parent
Parent widget
const char *name
name

QwtScale::~QwtScale

Destroy a QwtScale object

Syntax

QwtScale::~QwtScale()

QwtScale::setTitle

Assign a title

Syntax

void QwtScale::setTitle(const char *title)

Parameters

const char *title
new title

QwtScale::setBorderDist

Specify distances of the scale's endpoints from the widget's borders.

Syntax

void QwtScale::setBorderDist(int dist1, int dist2)

Parameters

int dist1
Left or top Distance
int dist2
Right or bottom distance

QwtScale::setBaselineDist

Specify the border distance of the scale's base line.

Syntax

void QwtScale::setBaselineDist(int bd)

Parameters

int bd
border distance of the baseline

QwtScale::setTitleFont

Change the title font

Syntax

void QwtScale::setTitleFont(const QFont &f)

Parameters

const QFont &f
new font

QwtScale::setTitleColor

Change the title color

Syntax

void QwtScale::setTitleColor(const QColor &c)

Parameters

const QColor &c
new title color

QwtScale::scaleChange

Notify a change of the scale

Syntax

void QwtScale::scaleChange()

Description

This virtual function can be overloaded by derived classes. The default implementation repaints the widget.

QwtScale::sizeHint

Return a size hint

Syntax

QSize QwtScale::sizeHint() const

Note

This function uses a QPainter internally. Don't call it while another QPainter is active.

QwtScale::minBorderDist

Determine the minimum Border distance

Syntax

int QwtScale::minBorderDist()

Description

This member function returns the minimum distance of the scale's endpoints from the widget borders which is required for the mark labels to fit into the widget.

Notes

See Also

setBorderDist

QwtScale::fontChange

Notify a change of the font

Syntax

void QwtScale::fontChange(const QFont &oldfont)

Parameters

const QFont &oldfont
old font

Description

This virtual function may be overloaded by derived widgets. The default implementation resizes the scale and repaints the widget.

QwtScale::setScale

Assign a scale division

Syntax

void QwtScale::setScale(const QwtScaleDiv &sd)

Parameters

const QwtScaleDiv &sd
Scale Division

Description

The scale division determines where to set the tick marks. For more information about scale divisions, see QwtScaleDiv.
Qwt Widget Library 02/05/98