Qwt Programmer's Manual
QwtScale
QwtScale - A Widget which contains a scale
#include <qwt_scale.h>
QWidget
- 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
- scaleChange
- Notify a change of the scale
- fontChange
- Notify a change of the font
This Widget can be used to decorate composite widgets with
a scale.
Construct a QwtScale object
QwtScale::QwtScale(QwtScale::Orientation ori, QWidget *parent, const char *name = 0)
- 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
Destroy a QwtScale object
QwtScale::~QwtScale()
Assign a title
void QwtScale::setTitle(const char *title)
- const char *title
- new title
Specify distances of the scale's endpoints from the
widget's borders.
void QwtScale::setBorderDist(int dist1, int dist2)
- int dist1
- Left or top Distance
- int dist2
- Right or bottom distance
Specify the border distance of the scale's base line.
void QwtScale::setBaselineDist(int bd)
- int bd
- border distance of the baseline
Change the title font
void QwtScale::setTitleFont(const QFont &f)
- const QFont &f
- new font
Change the title color
void QwtScale::setTitleColor(const QColor &c)
- const QColor &c
- new title color
Notify a change of the scale
void QwtScale::scaleChange()
This virtual function can be overloaded by derived
classes. The default implementation repaints the widget.
Return a size hint
QSize QwtScale::sizeHint() const
This function uses a QPainter internally. Don't call
it while another QPainter is active.
Determine the minimum Border distance
int QwtScale::minBorderDist()
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.
- This function uses a QPainter internally. Don't call it
while another QPainter is active.
- The minimum border distance depends on the font.
setBorderDist
Notify a change of the font
void QwtScale::fontChange(const QFont &oldfont)
- const QFont &oldfont
- old font
This virtual function may be overloaded by derived widgets.
The default implementation resizes the scale and repaints
the widget.
Assign a scale division
void QwtScale::setScale(const QwtScaleDiv &sd)
- const QwtScaleDiv &sd
- Scale Division
The scale division determines where to set the tick
marks. For more information about scale divisions, see
QwtScaleDiv.
Qwt Widget Library 02/05/98