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

QwtDial 类提供圆形范围控件 更多...

#include <qwt_dial.h>

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

class  PrivateData
 

Public 类型

enum  Shadow { Plain = QFrame::Plain , Raised = QFrame::Raised , Sunken = QFrame::Sunken }
 框架阴影 更多...
 
enum  Mode { RotateNeedle , RotateScale }
 控制指针或刻度是否旋转的模式 更多...
 

Public 成员函数

 QwtDial (QWidget *parent=nullptr)
 Constructor
 
virtual ~QwtDial ()
 Destructor
 
void setFrameShadow (Shadow)
 Set the frame shadow
 
Shadow frameShadow () const
 Return the frame shadow
 
void setLineWidth (int)
 Set the line width
 
int lineWidth () const
 Return the line width
 
void setMode (Mode)
 Set the mode
 
Mode mode () const
 Return the mode
 
void setScaleArc (double minArc, double maxArc)
 Set the scale arc range
 
void setMinScaleArc (double)
 Set the minimum scale arc
 
double minScaleArc () const
 Return the minimum scale arc
 
void setMaxScaleArc (double)
 Set the maximum scale arc
 
double maxScaleArc () const
 Return the maximum scale arc
 
virtual void setOrigin (double)
 Set the origin
 
double origin () const
 Return the origin
 
void setNeedle (QwtDialNeedle *)
 Set the needle
 
const QwtDialNeedleneedle () const
 Return the needle (const version)
 
QwtDialNeedleneedle ()
 Return the needle
 
QRect boundingRect () const
 Return the bounding rectangle
 
QRect innerRect () const
 Return the inner rectangle
 
virtual QRect scaleInnerRect () const
 Return the scale inner rectangle
 
virtual QSize sizeHint () const override
 Return the size hint
 
virtual QSize minimumSizeHint () const override
 Return the minimum size hint
 
void setScaleDraw (QwtRoundScaleDraw *)
 Set the scale draw
 
QwtRoundScaleDrawscaleDraw ()
 Return the scale draw
 
const QwtRoundScaleDrawscaleDraw () const
 Return the scale draw (const version)
 
- Public 成员函数 继承自 QwtAbstractSlider
 QwtAbstractSlider (QWidget *parent=nullptr)
 Constructor for QwtAbstractSlider (English only)
 
virtual ~QwtAbstractSlider ()
 Destructor for QwtAbstractSlider (English only)
 
void setValid (bool)
 Set whether the slider is valid (English only)
 
bool isValid () const
 Return whether the slider is valid (English only)
 
double value () const
 Return the current value (English only)
 
void setWrapping (bool)
 Set whether wrapping is enabled (English only)
 
bool wrapping () const
 Return whether wrapping is enabled (English only)
 
void setTotalSteps (uint)
 Set the total number of steps (English only)
 
uint totalSteps () const
 Return the total number of steps (English only)
 
void setSingleSteps (uint)
 Set the number of single steps (English only)
 
uint singleSteps () const
 Return the number of single steps (English only)
 
void setPageSteps (uint)
 Set the number of page steps (English only)
 
uint pageSteps () const
 Return the number of page steps (English only)
 
void setStepAlignment (bool)
 Set whether step alignment is enabled (English only)
 
bool stepAlignment () const
 Return whether step alignment is enabled (English only)
 
void setTracking (bool)
 Set whether tracking is enabled (English only)
 
bool isTracking () const
 Return whether tracking is enabled (English only)
 
void setReadOnly (bool)
 Set whether the slider is read-only (English only)
 
bool isReadOnly () const
 Return whether the slider is read-only (English only)
 
void setInvertedControls (bool)
 Set whether controls are inverted (English only)
 
bool invertedControls () const
 Return whether controls are inverted (English only)
 
- Public 成员函数 继承自 QwtAbstractScale
 QwtAbstractScale (QWidget *parent=nullptr)
 QwtAbstractScale 构造函数
 
virtual ~QwtAbstractScale ()
 QwtAbstractScale 析构函数
 
void setScale (double lowerBound, double upperBound)
 通过区间边界指定刻度
 
void setScale (const QwtInterval &)
 通过区间对象指定刻度
 
void setScale (const QwtScaleDiv &)
 通过刻度划分指定刻度
 
const QwtScaleDivscaleDiv () const
 返回刻度划分
 
void setLowerBound (double value)
 设置刻度的下界
 
double lowerBound () const
 返回刻度的下界
 
void setUpperBound (double value)
 设置刻度的上界
 
double upperBound () const
 返回刻度的上界
 
void setScaleStepSize (double stepSize)
 设置用于计算刻度划分的步长
 
double scaleStepSize () const
 返回步长提示值
 
void setScaleMaxMajor (int ticks)
 设置主刻度间隔的最大数量
 
int scaleMaxMinor () const
 返回次刻度间隔的最大数量
 
void setScaleMaxMinor (int ticks)
 设置次刻度间隔的最大数量
 
int scaleMaxMajor () const
 返回主刻度间隔的最大数量
 
void setScaleEngine (QwtScaleEngine *)
 设置刻度引擎
 
const QwtScaleEnginescaleEngine () const
 返回刻度引擎(常量版本)
 
QwtScaleEnginescaleEngine ()
 返回刻度引擎(非常量版本)
 
int transform (double) const
 将刻度值转换为控件坐标
 
double invTransform (int) const
 将控件坐标转换为刻度值
 
bool isInverted () const
 检查刻度是否反向
 
double minimum () const
 返回最小边界
 
double maximum () const
 返回最大边界
 
const QwtScaleMapscaleMap () const
 返回刻度映射
 

Protected 成员函数

virtual void wheelEvent (QWheelEvent *) override
 Wheel Event handler
 
virtual void paintEvent (QPaintEvent *) override
 Paint the dial
 
virtual void changeEvent (QEvent *) override
 Change Event handler
 
virtual void drawFrame (QPainter *)
 Draw the frame around the dial
 
virtual void drawContents (QPainter *) const
 Draw the contents inside the frame
 
virtual void drawFocusIndicator (QPainter *) const
 Draw the focus indicator
 
void invalidateCache ()
 使用于加速重绘的内部缓存失效
 
virtual void drawScale (QPainter *, const QPointF &center, double radius) const
 Draw the scale
 
virtual void drawScaleContents (QPainter *painter, const QPointF &center, double radius) const
 Draw the contents inside the scale
 
virtual void drawNeedle (QPainter *, const QPointF &, double radius, double direction, QPalette::ColorGroup) const
 Draw the needle
 
virtual double scrolledTo (const QPoint &) const override
 Determine the value for a new position of the slider handle.
 
virtual bool isScrollPosition (const QPoint &) const override
 Determine what to do when the user presses a mouse button.
 
virtual void sliderChange () override
 Handle slider changes (English only)
 
virtual void scaleChange () override
 Invalidate the internal caches and call QwtAbstractSlider::scaleChange()
 
- Protected 成员函数 继承自 QwtAbstractSlider
virtual void mousePressEvent (QMouseEvent *) override
 Handle mouse press events (English only)
 
virtual void mouseReleaseEvent (QMouseEvent *) override
 Handle mouse release events (English only)
 
virtual void mouseMoveEvent (QMouseEvent *) override
 Handle mouse move events (English only)
 
virtual void keyPressEvent (QKeyEvent *) override
 Handle key press events (English only)
 
void incrementValue (int stepCount)
 Increment the value by a number of steps (English only)
 
double incrementedValue (double value, int stepCount) const
 Calculate incremented value (English only)
 
- Protected 成员函数 继承自 QwtAbstractScale
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)
 

属性

int lineWidth
 
Shadow frameShadow
 
Mode mode
 
double origin
 
double minScaleArc
 
double maxScaleArc
 
- 属性 继承自 QwtAbstractSlider
double value
 
uint totalSteps
 
uint singleSteps
 
uint pageSteps
 
bool stepAlignment
 
bool readOnly
 
bool tracking
 
bool wrapping
 
bool invertedControls
 
- 属性 继承自 QwtAbstractScale
double lowerBound
 
double upperBound
 
int scaleMaxMajor
 
int scaleMaxMinor
 
double scaleStepSize
 

额外继承的成员函数

- Public 槽 继承自 QwtAbstractSlider
void setValue (double value)
 Set the slider value (English only)
 
- 信号 继承自 QwtAbstractSlider
void valueChanged (double value)
 通知值变化
 
void sliderPressed ()
 当用户按下滑块的可移动部分时发出的信号
 
void sliderReleased ()
 当用户释放滑块的可移动部分时发出的信号
 
void sliderMoved (double value)
 当用户用鼠标移动滑块时发出的信号
 

详细描述

QwtDial 类提供圆形范围控件

成员枚举类型说明

◆ Mode

控制指针或刻度是否旋转的模式

枚举值
RotateNeedle 

The needle is rotating

RotateScale 

The needle is fixed, the scales are rotating

◆ Shadow

框架阴影

枚举值
Plain 

QFrame::Plain

Raised 

QFrame::Raised

Sunken 

QFrame::Sunken

构造及析构函数说明

◆ QwtDial()

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

Constructor

构造函数

◆ ~QwtDial()

QwtDial::~QwtDial ( )
virtual

Destructor

析构函数

成员函数说明

◆ boundingRect()

QRect QwtDial::boundingRect ( ) const

Return the bounding rectangle

返回表盘的边界矩形(含框架)

◆ changeEvent()

void QwtDial::changeEvent ( QEvent *  event)
overrideprotectedvirtual

Change Event handler

参数
eventChange event

Invalidates internal paint caches if necessary

重载 QwtAbstractScale .

◆ drawContents()

void QwtDial::drawContents ( QPainter *  painter) const
protectedvirtual

Draw the contents inside the frame

QPalette::Window is the background color outside of the frame. QPalette::Base is the background color inside the frame. QPalette::WindowText is the background color inside the scale.

参数
painterPainter
参见
boundingRect(), innerRect(), scaleInnerRect(), QWidget::setPalette()

◆ drawFocusIndicator()

void QwtDial::drawFocusIndicator ( QPainter *  painter) const
protectedvirtual

Draw the focus indicator

参数
painterPainter

◆ drawFrame()

void QwtDial::drawFrame ( QPainter *  painter)
protectedvirtual

Draw the frame around the dial

参数
painterPainter
参见
lineWidth(), frameShadow()

◆ drawNeedle()

void QwtDial::drawNeedle ( QPainter *  painter,
const QPointF &  center,
double  radius,
double  direction,
QPalette::ColorGroup  colorGroup 
) const
protectedvirtual

Draw the needle

参数
painterPainter
centerCenter of the dial
radiusLength for the needle
directionDirection of the needle in degrees, counter clockwise
colorGroupColorGroup

QwtAnalogClock 重载.

◆ drawScale()

void QwtDial::drawScale ( QPainter *  painter,
const QPointF &  center,
double  radius 
) const
protectedvirtual

Draw the scale

参数
painterPainter
centerCenter of the dial
radiusRadius of the scale

◆ drawScaleContents()

void QwtDial::drawScaleContents ( QPainter *  painter,
const QPointF &  center,
double  radius 
) const
protectedvirtual

Draw the contents inside the scale

Paints nothing.

参数
painterPainter
centerCenter of the contents circle
radiusRadius of the contents circle

QwtCompass 重载.

◆ frameShadow()

QwtDial::Shadow QwtDial::frameShadow ( ) const

Return the frame shadow

返回框架阴影

◆ innerRect()

QRect QwtDial::innerRect ( ) const

Return the inner rectangle

返回框架内圆的边界矩形

◆ invalidateCache()

void QwtDial::invalidateCache ( )
protected

使用于加速重绘的内部缓存失效

◆ isScrollPosition()

bool QwtDial::isScrollPosition ( const QPoint &  pos) const
overrideprotectedvirtual

Determine what to do when the user presses a mouse button.

参数
posMouse position
返回值
True,whenthe inner circle contains pos
参见
scrolledTo()

实现了 QwtAbstractSlider.

◆ lineWidth()

int QwtDial::lineWidth ( ) const

Return the line width

返回框架的线宽

◆ maxScaleArc()

double QwtDial::maxScaleArc ( ) const

Return the maximum scale arc

返回刻度弧的上限

◆ minimumSizeHint()

QSize QwtDial::minimumSizeHint ( ) const
overridevirtual

Return the minimum size hint

返回最小尺寸提示

◆ minScaleArc()

double QwtDial::minScaleArc ( ) const

Return the minimum scale arc

返回刻度弧的下限

◆ mode()

QwtDial::Mode QwtDial::mode ( ) const

Return the mode

返回表盘的模式

◆ needle() [1/2]

QwtDialNeedle * QwtDial::needle ( )

Return the needle

返回指针

◆ needle() [2/2]

const QwtDialNeedle * QwtDial::needle ( ) const

Return the needle (const version)

返回指针

◆ origin()

double QwtDial::origin ( ) const

Return the origin

原点是刻度和指针相对的角度

◆ paintEvent()

void QwtDial::paintEvent ( QPaintEvent *  event)
overrideprotectedvirtual

Paint the dial

参数
eventPaint event

◆ scaleChange()

void QwtDial::scaleChange ( )
overrideprotectedvirtual

Invalidate the internal caches and call QwtAbstractSlider::scaleChange()

重载 QwtAbstractSlider .

◆ scaleDraw() [1/2]

QwtRoundScaleDraw * QwtDial::scaleDraw ( )

Return the scale draw

返回刻度绘制器

◆ scaleDraw() [2/2]

const QwtRoundScaleDraw * QwtDial::scaleDraw ( ) const

Return the scale draw (const version)

返回刻度绘制器

◆ scaleInnerRect()

QRect QwtDial::scaleInnerRect ( ) const
virtual

Return the scale inner rectangle

返回刻度内的矩形

◆ scrolledTo()

double QwtDial::scrolledTo ( const QPoint &  pos) const
overrideprotectedvirtual

Determine the value for a new position of the slider handle.

参数
posMouse position
返回
Value for the mouse position
参见
isScrollPosition()

实现了 QwtAbstractSlider.

◆ setFrameShadow()

void QwtDial::setFrameShadow ( Shadow  shadow)

Set the frame shadow

从框架样式设置框架阴影值

◆ setLineWidth()

void QwtDial::setLineWidth ( int  lineWidth)

Set the line width

设置框架的线宽

◆ setMaxScaleArc()

void QwtDial::setMaxScaleArc ( double  max)

Set the maximum scale arc

设置刻度弧的上限

◆ setMinScaleArc()

void QwtDial::setMinScaleArc ( double  min)

Set the minimum scale arc

设置刻度弧的下限

◆ setMode()

void QwtDial::setMode ( Mode  mode)

Set the mode

更改表盘的模式

◆ setNeedle()

void QwtDial::setNeedle ( QwtDialNeedle needle)

Set the needle

为表盘设置指针

◆ setOrigin()

void QwtDial::setOrigin ( double  origin)
virtual

Set the origin

更改原点

◆ setScaleArc()

void QwtDial::setScaleArc ( double  minArc,
double  maxArc 
)

Set the scale arc range

更改刻度的弧度范围

◆ setScaleDraw()

void QwtDial::setScaleDraw ( QwtRoundScaleDraw scaleDraw)

Set the scale draw

设置单独的刻度绘制器

◆ sizeHint()

QSize QwtDial::sizeHint ( ) const
overridevirtual

Return the size hint

返回尺寸提示

◆ sliderChange()

void QwtDial::sliderChange ( )
overrideprotectedvirtual

Handle slider changes (English only)

处理滑块变化

重载 QwtAbstractSlider .

◆ wheelEvent()

void QwtDial::wheelEvent ( QWheelEvent *  event)
overrideprotectedvirtual

Wheel Event handler

参数
eventWheel event

重载 QwtAbstractSlider .


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