QwtScale(3)

NAME
QwtScale - A Widget which contains a scale.

SYNOPSIS

#include <qwt_scale.h>

Inherits QWidget.

  Public Types
enum Orientation { Left, Right, Top, Bottom }

  Public Methods
QwtScale (Orientation, QWidget *parent, const char *name=0)
~QwtScale ()
void setTitle (const char *title)
void setBorderDist (int start, int end)
void setScale (const QwtScaleDiv &sd)
void setLabelFormat (char f, int prec)
void setBaselineDist (int bd)
void setTitleFont (const QFont &f)
void setTitleColor (const QColor &c)
void enableTitle (bool tf)
const QFont & titleFont () const
const QColor & titleColor () const
const QString & title () const
int minBorderDist () const
void labelFormat (char &f, int &prec) const
QSize sizeHint () const

  Protected Methods
void paintEvent (QPaintEvent *e)
void resizeEvent (QResizeEvent *e)
void scaleChange ()
void fontChange (const QFont &oldfont)
const QwtDiMap & map () const

DETAILED DESCRIPTION

A Widget which contains a scale.

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

CONSTRUCTOR & DESTRUCTOR DOCUMENTATION

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

Constructor.

Parameters:

ori Orientation. Must be one of QwtScale::Left, QwtScale::Right, QwtScale::Bottom, or QwtScale::Top

parent

name
    passed to QWidget's CTOR

  QwtScale::~QwtScale ()

Destroy a QwtScale object.

MEMBER FUNCTION DOCUMENTATION

  void QwtScale::fontChange (const QFont & oldfont) [protected]

Notify a change of the font.

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

Parameters:

oldfont
    old font

  void QwtScale::labelFormat (char & f, int & prec) const

Format character and precision have the same meaning as for the QString class.

Parameters:

f   format character

prec
    precision

Returns:
the number format for the major scale labels

See also:
QString::setNum in the Qt manual

  int QwtScale::minBorderDist () const

Determine the minimum Border distance.

 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.

Warning:

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

The minimum border distance depends on the font.

See also:
setBorderDist()

  void QwtScale::scaleChange () [protected]

Notify a change of the scale.

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

  void QwtScale::setBaselineDist (int bd)

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

Parameters:

bd  border distance of the baseline

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

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

Parameters:

dist1
    Left or top Distance

dist2
    Right or bottom distance

  void QwtScale::setLabelFormat (char f, int prec)

Set the number format for the major scale labels.

 Format character and precision have the same meaning as for the QString class.

Parameters:

f   -- format character

prec
    -- precision

See also:
QString::setNum in the Qt manual

  void QwtScale::setScale (const QwtScaleDiv & sd)

Assign a scale division.

 The scale division determines where to set the tick marks.

Parameters:

sd  Scale Division

See also:
For more information about scale divisions, see QwtScaleDiv.

  void QwtScale::setTitle (const char * title)

Assign a title.

Parameters:

title
    new title

  void QwtScale::setTitleColor (const QColor & c)

Change the title color.

Parameters:

c   new title color

  void QwtScale::setTitleFont (const QFont & f)

Change the title font.

Parameters:

f   new font

  QSize QwtScale::sizeHint () const

Returns:
a size hint

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

AUTHOR

Generated automatically by Doxygen for Qwt User's Guide from the source code.