Classes | Public Member Functions | Protected Member Functions | Properties | Private Attributes
QwtAbstractScale Class Reference

An abstract base class for widgets having a scale. More...

#include <qwt_abstract_scale.h>

Inheritance diagram for QwtAbstractScale:
Inheritance graph
[legend]

List of all members.

Classes

class  PrivateData

Public Member Functions

double invTransform (int) const
bool isInverted () const
double lowerBound () const
double maximum () const
double minimum () const
 QwtAbstractScale (QWidget *parent=NULL)
const QwtScaleDivscaleDiv () const
const QwtScaleEnginescaleEngine () const
QwtScaleEnginescaleEngine ()
const QwtScaleMapscaleMap () const
int scaleMaxMajor () const
int scaleMaxMinor () const
double scaleStepSize () const
void setLowerBound (double value)
void setScale (double lowerBound, double upperBound)
 Specify a scale.
void setScale (const QwtInterval &)
 Specify a scale.
void setScale (const QwtScaleDiv &)
 Specify a scale.
void setScaleEngine (QwtScaleEngine *)
 Set a scale engine.
void setScaleMaxMajor (int ticks)
 Set the maximum number of major tick intervals.
void setScaleMaxMinor (int ticks)
 Set the maximum number of minor tick intervals.
void setScaleStepSize (double stepSize)
 Set the step size used for calculating a scale division.
void setUpperBound (double value)
int transform (double) const
double upperBound () const
virtual ~QwtAbstractScale ()
 Destructor.

Protected Member Functions

const QwtAbstractScaleDrawabstractScaleDraw () const
QwtAbstractScaleDrawabstractScaleDraw ()
virtual void changeEvent (QEvent *)
void rescale (double lowerBound, double upperBound, double stepSize)
virtual void scaleChange ()
 Notify changed scale.
void setAbstractScaleDraw (QwtAbstractScaleDraw *)
 Set a scale draw.
void updateScaleDraw ()

Properties

double lowerBound
int scaleMaxMajor
int scaleMaxMinor
double scaleStepSize
double upperBound

Private Attributes

PrivateDatad_data

Detailed Description

An abstract base class for widgets having a scale.

The scale of an QwtAbstractScale is determined by a QwtScaleDiv definition, that contains the boundaries and the ticks of the scale. The scale is painted using a QwtScaleDraw object.

The scale division might be assigned explicitly - but usually it is calculated from the boundaries using a QwtScaleEngine.

The scale engine also decides the type of transformation of the scale ( linear, logarithmic ... ).

Definition at line 36 of file qwt_abstract_scale.h.


Constructor & Destructor Documentation

QwtAbstractScale::QwtAbstractScale ( QWidget *  parent = NULL) [explicit]

Constructor

Parameters:
parentParent widget

Creates a default QwtScaleDraw and a QwtLinearScaleEngine. The initial scale boundaries are set to [ 0.0, 100.0 ]

The scaleStepSize() is initialized to 0.0, scaleMaxMajor() to 5 and scaleMaxMajor to 3.

Definition at line 56 of file qwt_abstract_scale.cpp.

Destructor.

Definition at line 64 of file qwt_abstract_scale.cpp.


Member Function Documentation

Returns:
Scale draw
See also:
setAbstractScaleDraw()

Definition at line 301 of file qwt_abstract_scale.cpp.

Returns:
Scale draw
See also:
setAbstractScaleDraw()

Definition at line 292 of file qwt_abstract_scale.cpp.

void QwtAbstractScale::changeEvent ( QEvent *  event) [protected, virtual]

Change Event handler

Parameters:
eventChange event

Invalidates internal caches if necessary

Reimplemented in QwtThermo, QwtKnob, QwtDial, and QwtSlider.

Definition at line 452 of file qwt_abstract_scale.cpp.

double QwtAbstractScale::invTransform ( int  value) const

Translate a widget coordinate into a scale value

Parameters:
valueWidget coordinate
Returns:
Corresponding scale coordinate for value
See also:
scaleMap(), transform()

Definition at line 380 of file qwt_abstract_scale.cpp.

Returns:
True, when the scale is increasing in opposite direction to the widget coordinates

Definition at line 389 of file qwt_abstract_scale.cpp.

double QwtAbstractScale::lowerBound ( ) const
double QwtAbstractScale::maximum ( ) const
Returns:
The boundary with the larger value
See also:
minimum(), lowerBound(), upperBound()

Definition at line 408 of file qwt_abstract_scale.cpp.

double QwtAbstractScale::minimum ( ) const
Returns:
The boundary with the smaller value
See also:
maximum(), lowerBound(), upperBound()

Definition at line 398 of file qwt_abstract_scale.cpp.

void QwtAbstractScale::rescale ( double  lowerBound,
double  upperBound,
double  stepSize 
) [protected]

Recalculate the scale division and update the scale.

Parameters:
lowerBoundLower limit of the scale interval
upperBoundUpper limit of the scale interval
stepSizeMajor step size
See also:
scaleChange()

Definition at line 428 of file qwt_abstract_scale.cpp.

void QwtAbstractScale::scaleChange ( ) [protected, virtual]

Notify changed scale.

Reimplemented in QwtThermo, QwtDial, QwtAbstractSlider, and QwtSlider.

Definition at line 415 of file qwt_abstract_scale.cpp.

Returns:
Scale boundaries and positions of the ticks

The scale division might have been assigned explicitly or calculated implicitly by rescale().

Definition at line 348 of file qwt_abstract_scale.cpp.

Returns:
Scale engine
See also:
setScaleEngine()

Definition at line 328 of file qwt_abstract_scale.cpp.

Returns:
Scale engine
See also:
setScaleEngine()

Definition at line 337 of file qwt_abstract_scale.cpp.

Returns:
Map to translate between scale and widget coordinates

Definition at line 356 of file qwt_abstract_scale.cpp.

Set a scale draw.

scaleDraw has to be created with new and will be deleted in the destructor or the next call of setAbstractScaleDraw().

See also:
abstractScaleDraw()

Definition at line 276 of file qwt_abstract_scale.cpp.

void QwtAbstractScale::setLowerBound ( double  value)

Set the lower bound of the scale

Parameters:
valueLower bound
See also:
lowerBound(), setScale(), setUpperBound()
Note:
For inverted scales the lower bound is greater than the upper bound

Definition at line 78 of file qwt_abstract_scale.cpp.

void QwtAbstractScale::setScale ( double  lowerBound,
double  upperBound 
)

Specify a scale.

Define a scale by an interval

The ticks are calculated using scaleMaxMinor(), scaleMaxMajor() and scaleStepSize().

Parameters:
lowerBoundlower limit of the scale interval
upperBoundupper limit of the scale interval
Note:
For inverted scales the lower bound is greater than the upper bound

Definition at line 129 of file qwt_abstract_scale.cpp.

void QwtAbstractScale::setScale ( const QwtInterval interval)

Specify a scale.

Define a scale by an interval

The ticks are calculated using scaleMaxMinor(), scaleMaxMajor() and scaleStepSize().

Parameters:
intervalInterval

Definition at line 144 of file qwt_abstract_scale.cpp.

void QwtAbstractScale::setScale ( const QwtScaleDiv scaleDiv)

Specify a scale.

scaleMaxMinor(), scaleMaxMajor() and scaleStepSize() and have no effect.

Parameters:
scaleDivScale division
See also:
setAutoScale()

Definition at line 157 of file qwt_abstract_scale.cpp.

Set a scale engine.

The scale engine is responsible for calculating the scale division and provides a transformation between scale and widget coordinates.

scaleEngine has to be created with new and will be deleted in the destructor or the next call of setScaleEngine.

Definition at line 315 of file qwt_abstract_scale.cpp.

Set the maximum number of major tick intervals.

The scale's major ticks are calculated automatically such that the number of major intervals does not exceed ticks.

The default value is 5.

Parameters:
ticksMaximal number of major ticks.
See also:
scaleMaxMajor(), setScaleMaxMinor(), setScaleStepSize(), QwtScaleEngine::divideInterval()

Definition at line 188 of file qwt_abstract_scale.cpp.

Set the maximum number of minor tick intervals.

The scale's minor ticks are calculated automatically such that the number of minor intervals does not exceed ticks. The default value is 3.

Parameters:
ticksMaximal number of minor ticks.
See also:
scaleMaxMajor(), setScaleMaxMinor(), setScaleStepSize(), QwtScaleEngine::divideInterval()

Definition at line 218 of file qwt_abstract_scale.cpp.

void QwtAbstractScale::setScaleStepSize ( double  stepSize)

Set the step size used for calculating a scale division.

The step size is hint for calculating the intervals for the major ticks of the scale. A value of 0.0 is interpreted as no hint.

Parameters:
stepSizeHint for the step size of the scale
See also:
scaleStepSize(), QwtScaleEngine::divideScale()
Note:
Position and distance between the major ticks also depends on scaleMaxMajor().

Definition at line 250 of file qwt_abstract_scale.cpp.

void QwtAbstractScale::setUpperBound ( double  value)

Set the upper bound of the scale

Parameters:
valueUpper bound
See also:
upperBound(), setScale(), setLowerBound()
Note:
For inverted scales the lower bound is greater than the upper bound

Definition at line 101 of file qwt_abstract_scale.cpp.

int QwtAbstractScale::transform ( double  value) const

Translate a scale value into a widget coordinate

Parameters:
valueScale value
Returns:
Corresponding widget coordinate for value
See also:
scaleMap(), invTransform()

Definition at line 368 of file qwt_abstract_scale.cpp.

void QwtAbstractScale::updateScaleDraw ( ) [protected]

Recalculate ticks and scale boundaries.

Definition at line 465 of file qwt_abstract_scale.cpp.

double QwtAbstractScale::upperBound ( ) const

Member Data Documentation

Reimplemented in QwtKnob, QwtThermo, QwtDial, QwtAbstractSlider, QwtSlider, and QwtCompass.

Definition at line 102 of file qwt_abstract_scale.h.


Property Documentation

double QwtAbstractScale::lowerBound [read, write]
Returns:
Lower bound of the scale
See also:
setLowerBound(), setScale(), upperBound()

Definition at line 40 of file qwt_abstract_scale.h.

Returns:
Maximal number of major tick intervals
See also:
setScaleMaxMajor(), scaleMaxMinor()

Definition at line 43 of file qwt_abstract_scale.h.

Returns:
Maximal number of minor tick intervals
See also:
setScaleMaxMinor(), scaleMaxMajor()

Definition at line 44 of file qwt_abstract_scale.h.

double QwtAbstractScale::scaleStepSize [read, write]
Returns:
Hint for the step size of the scale
See also:
setScaleStepSize(), QwtScaleEngine::divideScale()

Definition at line 46 of file qwt_abstract_scale.h.

double QwtAbstractScale::upperBound [read, write]
Returns:
Upper bound of the scale
See also:
setUpperBound(), setScale(), lowerBound()

Definition at line 41 of file qwt_abstract_scale.h.


The documentation for this class was generated from the following files:


plotjuggler
Author(s): Davide Faconti
autogenerated on Wed Jul 3 2019 19:28:05