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

A special scale draw made for QwtCompass 更多...

#include <qwt_compass.h>

类 QwtCompassScaleDraw 继承关系图:
QwtRoundScaleDraw QwtAbstractScaleDraw

class  PrivateData
 

Public 成员函数

 QwtCompassScaleDraw ()
 Constructor
 
 QwtCompassScaleDraw (const QMap< double, QString > &map)
 
void setLabelMap (const QMap< double, QString > &map)
 Set a map, mapping values to labels
 
QMap< double, QString > labelMap () const
 Get the map, mapping values to labels
 
virtual QwtText label (double value) const override
 Map a value to a corresponding label
 
- Public 成员函数 继承自 QwtRoundScaleDraw
 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
 
void setMinimumExtent (double)
 Set a minimum for the extent
 
double minimumExtent () const
 Get the minimum extent
 
void invalidateCache ()
 Invalidate the cache used by tickLabel()
 

额外继承的成员函数

- Public 类型 继承自 QwtAbstractScaleDraw
enum  ScaleComponent { Backbone = 0x01 , Ticks = 0x02 , Labels = 0x04 }
 Components of a scale 更多...
 
- Protected 成员函数 继承自 QwtRoundScaleDraw
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
 

详细描述

A special scale draw made for QwtCompass

QwtCompassScaleDraw maps values to strings using a special map, that can be modified by the application. The default map consists of the labels N, NE, E, SE, S, SW, W, NW.

参见
QwtCompass

构造及析构函数说明

◆ QwtCompassScaleDraw()

QwtCompassScaleDraw::QwtCompassScaleDraw ( )
explicit

Constructor

Initializes a label map for multiples of 45 degrees. The default map consists of the labels N, NE, E, SE, S, SW, W, NW.

Constructor

参数
[in]mapValue to label map

Destructor

成员函数说明

◆ label()

QwtText QwtCompassScaleDraw::label ( double  value) const
overridevirtual

Map a value to a corresponding label

参数
[in]valueValue that will be mapped

label() looks in the labelMap() for a corresponding label for value or returns a null text.

返回
Label corresponding to the value, or null text if not found
参见
labelMap(), setLabelMap()

重载 QwtAbstractScaleDraw .

◆ labelMap()

QMap< double, QString > QwtCompassScaleDraw::labelMap ( ) const

Get the map, mapping values to labels

返回
Map, mapping values to labels
参见
setLabelMap()

◆ setLabelMap()

void QwtCompassScaleDraw::setLabelMap ( const QMap< double, QString > &  map)

Set a map, mapping values to labels

参数
[in]mapValue to label map

The values of the major ticks are found by looking into this map. The default map consists of the labels N, NE, E, SE, S, SW, W, NW.

警告
The map will have no effect for values that are no major tick values. Major ticks can be changed by QwtScaleDraw::setScale.
参见
labelMap(), scaleDraw(), setScale()

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