Qwt Programmer's manual
QwtScaleIf
QwtScaleIf - An interface class for widgets containing a scale
#include <qwt_sclif.h>
- setScale (1)
- Set user-defined scale
- setScale (2)
- Set user-defined scale
- setScaleMaxMajor
-
Set Max. number of major tick intervals
- setScaleMaxMinor
-
Set max. number of minor tick intervals
- autoScale
- adjust scale automatically
- scaleMaxMinor
- return max. number of minor tick intervals
- scaleMaxMajor
- return max. number of major tick intervals
- hasUserScale
- Check for user-defined scale
- scaleChange
- Notify change of scale
This interface class is used to provide classes
with a protected QwtScaleDraw member and a public
interface to access that scale.
The primary purpose of this class is to define
a common interface for classes which are supposed to
contain a ScaleDraw class. It provides a protected
ScaleDraw member
called d_scale and a couple of public member functions
which allow direct but restricted access
to this scale by the user.
Widgets derived from this class have
to implement the member function scaleChange(),
which is called to notify changes of the
scale parameters and usually requires repainting or
resizing respectively.
In general, a class derived from QwtScaleIf is
expected to manage the division and the position of its scale internally
when no user-defined scale is set. It should take the d_maxMinor
and d_maxMajor members into account, which can be set by the user.
An implementation can check if a user-defined scale is set by calling the
hasUserScale member.
Construct a QwtScaleIf instance
QwtScaleIf::QwtScaleIf()
Specify a user-defined scale.
void QwtScaleIf::setScale(double vmin, double vmax, int logarithmic)
- double vmin, double vmax
- boundary values
- int logarithmic
- If != 0, Build a logarithmic scale
By default, the widget is supposed to control the range of its scale
automatically, but sometimes it is desirable to have a user-defined
scale which is not in sync with
the widget's range, e.g. if a logarithmic scale is needed
(sliders don't support that) or if the scale is required
to have a fixed range (say 0...100%), independent of the
widget's range.
autoScale
Specify a user-defined scale.
void QwtScaleIf::setScale(double vmin, double vmax, int logarithmic)
- double vmin, double vmax
- interval boundaries
- int step
- major step size
- int logarithmic
- If != 0, build a logarithmic scale
By default, the widget is supposed to control the range of its scale
automatically, but sometimes it is desirable to have a user-defined
scale which is not in sync with
the widget's range, e.g. if a logarithmic scale is needed
(sliders don't support that) or if the scale is required
to have a fixed range (say 0...100%), independent of the
widget's range.
autoScale
Assign a user-defined scale division
void QwtScale::setScale(const QwtScaleDiv &s)
- const QwtScaleDiv &s
- scale division
Advise the widget to control the scale range
internally.
void QwtScaleIf::autoScale
Autoscaling is on by default.
QwtScaleIf::setScale@
Set the maximum number of major tick intervals.
void QwtScaleIf::setScaleMaxMajor(int ticks)
- int ticks
- maximal number of major ticks.
The scale's major ticks are calculated automatically such that
the number of major intervals does not exceed <ticks>.
The default value is 5.
QwtScaleDraw
Set the maximum number of minor tick intervals
void QwtScaleIf::setScaleMaxMinor(int ticks)
- int ticks
-
The scale's minor ticks are calculated automatically such that
the number of minor intervals does not exceed <ticks>.
The default value is 3.
QwtScaleDraw
Qwt Widget Library 02/04/98