QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
| Public 成员函数 | Protected 成员函数 | 属性 | 所有成员列表
QwtAbstractScale类 参考

An abstract base class for widgets having a scale 更多...

#include <qwt_abstract_scale.h>

类 QwtAbstractScale 继承关系图:
QwtAbstractSlider QwtThermo QwtDial QwtKnob QwtSlider QwtAnalogClock QwtCompass

class  PrivateData
 

Public 成员函数

 QwtAbstractScale (QWidget *parent=nullptr)
 Constructor for QwtAbstractScale
 
void setScale (double lowerBound, double upperBound)
 Specify a scale by interval bounds
 
void setScale (const QwtInterval &)
 Specify a scale by interval
 
void setScale (const QwtScaleDiv &)
 Specify a scale by scale division
 
const QwtScaleDivscaleDiv () const
 Return the scale division
 
void setLowerBound (double value)
 Set the lower bound of the scale
 
double lowerBound () const
 Return the lower bound of the scale
 
void setUpperBound (double value)
 Set the upper bound of the scale
 
double upperBound () const
 Return the upper bound of the scale
 
void setScaleStepSize (double stepSize)
 Set the step size used for calculating scale division
 
double scaleStepSize () const
 Return the step size hint
 
void setScaleMaxMajor (int ticks)
 Set the maximum number of major tick intervals
 
int scaleMaxMinor () const
 Return the maximum number of minor tick intervals
 
void setScaleMaxMinor (int ticks)
 Set the maximum number of minor tick intervals
 
int scaleMaxMajor () const
 Return the maximum number of major tick intervals
 
void setScaleEngine (QwtScaleEngine *)
 Set the scale engine
 
const QwtScaleEnginescaleEngine () const
 Return the scale engine (const version)
 
QwtScaleEnginescaleEngine ()
 Return the scale engine (non-const version)
 
int transform (double) const
 Transform a scale value to widget coordinates
 
double invTransform (int) const
 Transform a widget coordinate to scale value
 
bool isInverted () const
 Check if scale is inverted
 
double minimum () const
 Return the minimum boundary
 
double maximum () const
 Return the maximum boundary
 
const QwtScaleMapscaleMap () const
 Return the scale map
 

Protected 成员函数

virtual void changeEvent (QEvent *) override
 Handle change events (English only)
 
void rescale (double lowerBound, double upperBound, double stepSize)
 Recalculate scale and update scale draw (English only)
 
void setAbstractScaleDraw (QwtAbstractScaleDraw *)
 Set the scale draw object (English only)
 
const QwtAbstractScaleDrawabstractScaleDraw () const
 Return the scale draw (const version) (English only)
 
QwtAbstractScaleDrawabstractScaleDraw ()
 Return the scale draw (non-const version) (English only)
 
void updateScaleDraw ()
 Update the scale draw (English only)
 
virtual void scaleChange ()
 Notify about scale changes (English only)
 

属性

double lowerBound
 
double upperBound
 
int scaleMaxMajor
 
int scaleMaxMinor
 
double scaleStepSize
 

详细描述

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 ...).

构造及析构函数说明

◆ QwtAbstractScale()

QwtAbstractScale::QwtAbstractScale ( QWidget *  parent = nullptr)
explicit

Constructor for QwtAbstractScale

参数
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 scaleMaxMinor to 3.

Destructor for QwtAbstractScale

成员函数说明

◆ abstractScaleDraw() [1/2]

QwtAbstractScaleDraw * QwtAbstractScale::abstractScaleDraw ( )
protected

Return the scale draw (non-const version) (English only)

Return the scale draw object (non-const)

返回
Scale draw object
参见
setAbstractScaleDraw()

◆ abstractScaleDraw() [2/2]

const QwtAbstractScaleDraw * QwtAbstractScale::abstractScaleDraw ( ) const
protected

Return the scale draw (const version) (English only)

Return the scale draw object (const)

返回
Scale draw object
参见
setAbstractScaleDraw()

◆ changeEvent()

void QwtAbstractScale::changeEvent ( QEvent *  event)
overrideprotectedvirtual

Handle change events (English only)

Handle change events

参数
eventChange event

Invalidates internal caches if necessary (e.g., on locale change).

QwtDial, QwtKnob, QwtSlider , 以及 QwtThermo 重载.

◆ invTransform()

double QwtAbstractScale::invTransform ( int  value) const

Transform a widget coordinate to scale value

参数
valueWidget coordinate
返回
Corresponding scale coordinate for value
参见
scaleMap(), transform()

◆ isInverted()

bool QwtAbstractScale::isInverted ( ) const

Check if scale is inverted

返回
True if scale is increasing in opposite direction to widget coordinates

◆ lowerBound()

double QwtAbstractScale::lowerBound ( ) const

Return the lower bound of the scale

返回
Lower bound value
参见
setLowerBound(), setScale(), upperBound()

◆ maximum()

double QwtAbstractScale::maximum ( ) const

Return the maximum boundary

返回
The boundary with the larger value
参见
minimum(), lowerBound(), upperBound()

◆ minimum()

double QwtAbstractScale::minimum ( ) const

Return the minimum boundary

返回
The boundary with the smaller value
参见
maximum(), lowerBound(), upperBound()

◆ rescale()

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

Recalculate scale and update scale draw (English only)

Recalculate scale division and update scale

参数
lowerBoundLower limit of the scale interval
upperBoundUpper limit of the scale interval
stepSizeMajor step size
参见
scaleChange()

◆ scaleChange()

void QwtAbstractScale::scaleChange ( )
protectedvirtual

Notify about scale changes (English only)

Notify about scale changes

This virtual function is called when the scale changes. Override this function in derived classes to handle scale changes.

QwtAbstractSlider, QwtDial, QwtSlider , 以及 QwtThermo 重载.

◆ scaleDiv()

const QwtScaleDiv & QwtAbstractScale::scaleDiv ( ) const

Return the scale division

返回
Scale boundaries and positions of the ticks

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

◆ scaleEngine() [1/2]

QwtScaleEngine * QwtAbstractScale::scaleEngine ( )

Return the scale engine (non-const version)

返回
Scale engine object
参见
setScaleEngine()

◆ scaleEngine() [2/2]

const QwtScaleEngine * QwtAbstractScale::scaleEngine ( ) const

Return the scale engine (const version)

返回
Scale engine object
参见
setScaleEngine()

◆ scaleMap()

const QwtScaleMap & QwtAbstractScale::scaleMap ( ) const

Return the scale map

返回
Map to translate between scale and widget coordinates

◆ scaleMaxMajor()

int QwtAbstractScale::scaleMaxMajor ( ) const

Return the maximum number of major tick intervals

返回
Maximal number of major tick intervals
参见
setScaleMaxMajor(), scaleMaxMinor()

◆ scaleMaxMinor()

int QwtAbstractScale::scaleMaxMinor ( ) const

Return the maximum number of minor tick intervals

返回
Maximal number of minor tick intervals
参见
setScaleMaxMinor(), scaleMaxMajor()

◆ scaleStepSize()

double QwtAbstractScale::scaleStepSize ( ) const

Return the step size hint

返回
Hint for the step size of the scale
参见
setScaleStepSize(), QwtScaleEngine::divideScale()

◆ setAbstractScaleDraw()

void QwtAbstractScale::setAbstractScaleDraw ( QwtAbstractScaleDraw scaleDraw)
protected

Set the scale draw object (English only)

Set the scale draw object

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

参见
abstractScaleDraw()

◆ setLowerBound()

void QwtAbstractScale::setLowerBound ( double  value)

Set the lower bound of the scale

参数
valueLower bound value
参见
lowerBound(), setScale(), setUpperBound()
注解
For inverted scales, the lower bound is greater than the upper bound

◆ setScale() [1/3]

void QwtAbstractScale::setScale ( const QwtInterval interval)

Specify a scale by interval

Define a scale by an interval. The ticks are calculated using scaleMaxMinor(), scaleMaxMajor() and scaleStepSize().

参数
intervalInterval object

◆ setScale() [2/3]

void QwtAbstractScale::setScale ( const QwtScaleDiv scaleDiv)

Specify a scale by scale division

When using this method, scaleMaxMinor(), scaleMaxMajor() and scaleStepSize() have no effect.

参数
scaleDivScale division object
参见
setAutoScale()

◆ setScale() [3/3]

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

Specify a scale by interval bounds

Define a scale by an interval. The ticks are calculated using scaleMaxMinor(), scaleMaxMajor() and scaleStepSize().

参数
lowerBoundLower limit of the scale interval
upperBoundUpper limit of the scale interval
注解
For inverted scales, the lower bound is greater than the upper bound

◆ setScaleEngine()

void QwtAbstractScale::setScaleEngine ( QwtScaleEngine scaleEngine)

Set the scale engine

The scale engine is responsible for calculating the scale division and provides a transformation between scale and widget coordinates. scaleEngine must be created with new and will be deleted in the destructor or the next call of setScaleEngine().

参数
scaleEngineScale engine object

◆ setScaleMaxMajor()

void QwtAbstractScale::setScaleMaxMajor ( int  ticks)

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.

参数
ticksMaximal number of major ticks
参见
scaleMaxMajor(), setScaleMaxMinor(), setScaleStepSize(), QwtScaleEngine::divideInterval()

◆ setScaleMaxMinor()

void QwtAbstractScale::setScaleMaxMinor ( int  ticks)

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.

参数
ticksMaximal number of minor ticks
参见
scaleMaxMajor(), setScaleMaxMinor(), setScaleStepSize(), QwtScaleEngine::divideInterval()

◆ setScaleStepSize()

void QwtAbstractScale::setScaleStepSize ( double  stepSize)

Set the step size used for calculating scale division

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

参数
stepSizeHint for the step size of the scale
参见
scaleStepSize(), QwtScaleEngine::divideScale()
注解
Position and distance between major ticks also depends on scaleMaxMajor()

◆ setUpperBound()

void QwtAbstractScale::setUpperBound ( double  value)

Set the upper bound of the scale

参数
valueUpper bound value
参见
upperBound(), setScale(), setLowerBound()
注解
For inverted scales, the lower bound is greater than the upper bound

◆ transform()

int QwtAbstractScale::transform ( double  value) const

Transform a scale value to widget coordinates

参数
valueScale value
返回
Corresponding widget coordinate for value
参见
scaleMap(), invTransform()

◆ updateScaleDraw()

void QwtAbstractScale::updateScaleDraw ( )
protected

Update the scale draw (English only)

Recalculate ticks and scale boundaries

Updates the scale draw by recalculating ticks and boundaries based on the current scale division.

◆ upperBound()

double QwtAbstractScale::upperBound ( ) const

Return the upper bound of the scale

返回
Upper bound value
参见
setUpperBound(), setScale(), lowerBound()

该类的文档由以下文件生成: