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

A class for drawing round scales 更多...

#include <qwt_round_scale_draw.h>

类 QwtRoundScaleDraw 继承关系图:
QwtAbstractScaleDraw QwtCompassScaleDraw

class  PrivateData
 

Public 成员函数

 QwtRoundScaleDraw ()
 Constructor
 
 ~QwtRoundScaleDraw () override
 Destructor
 
void setRadius (double radius)
 Set the radius
 
double radius () const
 Get the radius
 
void moveCenter (double x, double y)
 Move the center
 
void moveCenter (const QPointF &)
 Move the center
 
QPointF center () const
 Get the center of the scale
 
void setAngleRange (double angle1, double angle2)
 Set the angle range
 
virtual double extent (const QFont &) const override
 Calculate the extent of the scale
 
- Public 成员函数 继承自 QwtAbstractScaleDraw
 QwtAbstractScaleDraw ()
 Constructor for QwtAbstractScaleDraw
 
void setScaleDiv (const QwtScaleDiv &)
 Set the scale division
 
const QwtScaleDivscaleDiv () const
 Return the scale division
 
void setTransformation (QwtTransform *)
 Set the scale transformation
 
const QwtScaleMapscaleMap () const
 Return the scale map (const version)
 
QwtScaleMapscaleMap ()
 Return the scale map (non-const version)
 
void enableComponent (ScaleComponent, bool enable=true)
 Enable or disable a scale component
 
bool hasComponent (ScaleComponent) const
 Check if a component is enabled
 
void setTickLength (QwtScaleDiv::TickType, double length)
 Set the length of the ticks
 
double tickLength (QwtScaleDiv::TickType) const
 Get the length of the ticks
 
double maxTickLength () const
 Get the length of the longest tick
 
void setSpacing (double)
 Set the spacing between tick and labels
 
double spacing () const
 Get the spacing
 
void setPenWidthF (qreal width)
 Specify the width of the scale pen
 
qreal penWidthF () const
 Get the scale pen width
 
void setSelected (bool on)
 Set whether the scale draw is selected
 
bool isSelected () const
 Check if the scale draw is selected
 
void setSelectedPenWidthOffset (qreal offset=1)
 Set the pen width offset for the axis when it is in selected state
 
qreal selectedPenWidthOffset () const
 Get the current pen width offset for the axis when it is in selected state
 
virtual void draw (QPainter *, const QPalette &) const
 Draw the scale
 
virtual QwtText label (double) const
 Convert a value into its representing label
 
void setMinimumExtent (double)
 Set a minimum for the extent
 
double minimumExtent () const
 Get the minimum extent
 
void invalidateCache ()
 Invalidate the cache used by tickLabel()
 

Protected 成员函数

virtual void drawTick (QPainter *, double value, double len) const override
 Draw a tick
 
virtual void drawBackbone (QPainter *) const override
 Draws the baseline of the scale
 
virtual void drawLabel (QPainter *, double value) const override
 Draws the label for a major scale tick
 
- Protected 成员函数 继承自 QwtAbstractScaleDraw
const QwtTexttickLabel (const QFont &, double value) const
 Convert a value into its representing label and cache it
 

额外继承的成员函数

- Public 类型 继承自 QwtAbstractScaleDraw
enum  ScaleComponent { Backbone = 0x01 , Ticks = 0x02 , Labels = 0x04 }
 Components of a scale 更多...
 

详细描述

A class for drawing round scales

QwtRoundScaleDraw can be used to draw round scales. The circle segment can be adjusted by setAngleRange(). The geometry of the scale can be specified with moveCenter() and setRadius().

After a scale division has been specified as a QwtScaleDiv object using QwtAbstractScaleDraw::setScaleDiv(const QwtScaleDiv &s), the scale can be drawn with the QwtAbstractScaleDraw::draw() member.

构造及析构函数说明

◆ QwtRoundScaleDraw()

QwtRoundScaleDraw::QwtRoundScaleDraw ( )

Constructor

The range of the scale is initialized to [0, 100], the center is set to (50, 50) with a radius of 50. The angle range is set to [-135, 135].

成员函数说明

◆ center()

QPointF QwtRoundScaleDraw::center ( ) const

Get the center of the scale

返回
the center
Center point of the scale
参见
moveCenter()

◆ drawBackbone()

void QwtRoundScaleDraw::drawBackbone ( QPainter *  painter) const
overrideprotectedvirtual

Draws the baseline of the scale

参数
painterPainter
参见
drawTick(), drawLabel()

实现了 QwtAbstractScaleDraw.

◆ drawLabel()

void QwtRoundScaleDraw::drawLabel ( QPainter *  painter,
double  value 
) const
overrideprotectedvirtual

Draws the label for a major scale tick

参数
painterPainter
valueValue
参见
drawTick(), drawBackbone()

实现了 QwtAbstractScaleDraw.

◆ drawTick()

void QwtRoundScaleDraw::drawTick ( QPainter *  painter,
double  value,
double  len 
) const
overrideprotectedvirtual

Draw a tick

参数
painterPainter
valueValue of the tick
lenLength of the tick
参见
drawBackbone(), drawLabel()

实现了 QwtAbstractScaleDraw.

◆ extent()

double QwtRoundScaleDraw::extent ( const QFont &  font) const
overridevirtual

Calculate the extent of the scale

参数
fontFont used for painting the labels
返回
Calculated extent

The extent is the distance between the baseline to the outermost pixel of the scale draw. radius() + extent() is an upper limit for the radius of the bounding circle.

警告
The implemented algorithm is not too smart and calculates only an upper limit, that might be a few pixels too large.
参见
setMinimumExtent(), minimumExtent()

实现了 QwtAbstractScaleDraw.

◆ moveCenter() [1/2]

void QwtRoundScaleDraw::moveCenter ( const QPointF &  center)

Move the center

Move the center of the scale draw, leaving the radius unchanged

参数
centerNew center
参见
setRadius()

◆ moveCenter() [2/2]

void QwtRoundScaleDraw::moveCenter ( double  x,
double  y 
)
inline

Move the center

Move the center of the scale draw, leaving the radius unchanged

◆ radius()

double QwtRoundScaleDraw::radius ( ) const

Get the radius

返回
the radius
Radius of the scale

Radius is the radius of the backbone without ticks and labels.

参见
setRadius(), extent()

◆ setAngleRange()

void QwtRoundScaleDraw::setAngleRange ( double  angle1,
double  angle2 
)

Set the angle range

Adjust the baseline circle segment for round scales

参数
angle1First boundary of the angle interval in degrees
angle2Second boundary of the angle interval in degrees

The baseline will be drawn from min(angle1,angle2) to max(angle1, angle2). The default setting is [ -135, 135 ]. An angle of 0 degrees corresponds to the 12 o'clock position, and positive angles count in a clockwise direction.

警告
  • The angle range is limited to [-360, 360] degrees. Angles exceeding this range will be clipped.
  • For angles more or equal than 360 degrees above or below min(angle1, angle2), scale marks will not be drawn.
  • If you need a counterclockwise scale, use QwtScaleDiv::setInterval()

◆ setRadius()

void QwtRoundScaleDraw::setRadius ( double  radius)

Set the radius

Change the radius of the scale

参数
radiusNew radius

Radius is the radius of the backbone without ticks and labels.

参见
moveCenter()

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