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

旋钮控件 更多...

#include <qwt_knob.h>

类 QwtKnob 继承关系图:
QwtAbstractSlider QwtAbstractScale

class  PrivateData
 

Public 类型

enum  KnobStyle { Flat , Raised , Sunken , Styled }
 旋钮表面样式 更多...
 
enum  MarkerStyle {
  NoMarker = -1 , Tick , Triangle , Dot ,
  Nub , Notch
}
 标记类型 更多...
 

Public 成员函数

 QwtKnob (QWidget *parent=nullptr)
 Constructor
 
virtual ~QwtKnob ()
 Destructor
 
void setAlignment (Qt::Alignment)
 Set alignment of the knob inside contentsRect()
 
Qt::Alignment alignment () const
 Return alignment of the knob
 
void setKnobWidth (int)
 Set the knob's width (diameter)
 
int knobWidth () const
 Return the knob's width
 
void setNumTurns (int)
 Set the number of turns for the knob
 
int numTurns () const
 Return the number of turns
 
void setTotalAngle (double angle)
 Set the total angle which the knob can be turned
 
double totalAngle () const
 Return the total angle
 
void setKnobStyle (KnobStyle)
 Set the knob style
 
KnobStyle knobStyle () const
 Return the knob style
 
void setBorderWidth (int)
 Set the border width
 
int borderWidth () const
 Return the border width
 
void setMarkerStyle (MarkerStyle)
 Set the marker style
 
MarkerStyle markerStyle () const
 Return the marker style
 
void setMarkerSize (int)
 Set the marker size
 
int markerSize () const
 Return the marker size
 
virtual QSize sizeHint () const override
 Return size hint
 
virtual QSize minimumSizeHint () const override
 Return minimum size hint
 
void setScaleDraw (QwtRoundScaleDraw *)
 Set the scale draw
 
const QwtRoundScaleDrawscaleDraw () const
 Return the scale draw (const version)
 
QwtRoundScaleDrawscaleDraw ()
 Return the scale draw (non-const version)
 
QRect knobRect () const
 Return the bounding rectangle of the knob
 
- 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 paintEvent (QPaintEvent *) override
 Repaint the knob
 
virtual void changeEvent (QEvent *) override
 Handle QEvent::StyleChange and QEvent::FontChange;
 
virtual void drawKnob (QPainter *, const QRectF &) const
 Draw the knob
 
virtual void drawFocusIndicator (QPainter *) const
 Draw the focus indicator
 
virtual void drawMarker (QPainter *, const QRectF &, double angle) const
 Draw the marker at the knob's front
 
virtual double scrolledTo (const QPoint &) const override
 Determine the value for a new position of the mouse
 
virtual bool isScrollPosition (const QPoint &) const override
 Determine what to do when the user presses a mouse button.
 
- 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)
 
virtual void wheelEvent (QWheelEvent *) override
 Handle wheel events (English only)
 
void incrementValue (int stepCount)
 Increment the value by a number of steps (English only)
 
virtual void scaleChange () override
 Handle scale changes (English only)
 
virtual void sliderChange ()
 Handle slider changes (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)
 

属性

KnobStyle knobStyle
 
int knobWidth
 
Qt::Alignment alignment
 
double totalAngle
 
int numTurns
 
MarkerStyle markerStyle
 
int markerSize
 
int borderWidth
 
- 属性 继承自 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)
 当用户用鼠标移动滑块时发出的信号
 

详细描述

旋钮控件

成员枚举类型说明

◆ KnobStyle

旋钮表面样式

枚举值
Flat 

Fill the knob with a brush from QPalette::Button

Raised 

Build a gradient from QPalette::Midlight and QPalette::Button

Sunken 

Build a gradient from QPalette::Midlight, QPalette::Button and QPalette::Midlight

Styled 

Build a radial gradient from QPalette::Button like QDial in various Qt styles

◆ MarkerStyle

标记类型

枚举值
NoMarker 

Don't paint any marker

Tick 

Paint a single tick in QPalette::ButtonText color

Triangle 

Paint a triangle in QPalette::ButtonText color

Dot 

Paint a circle in QPalette::ButtonText color

Nub 

Draw a raised ellipse with a gradient from QPalette::Light and QPalette::Mid

Notch 

Draw a sunken ellipse with a gradient from QPalette::Light and QPalette::Mid

构造及析构函数说明

◆ QwtKnob()

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

Constructor

构造函数

成员函数说明

◆ alignment()

Qt::Alignment QwtKnob::alignment ( ) const

Return alignment of the knob

返回旋钮在 contentsRect() 内的对齐方式

◆ changeEvent()

void QwtKnob::changeEvent ( QEvent *  event)
overrideprotectedvirtual

Handle QEvent::StyleChange and QEvent::FontChange;

参数
eventChange event

重载 QwtAbstractScale .

◆ drawFocusIndicator()

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

Draw the focus indicator

参数
painterPainter

◆ drawKnob()

void QwtKnob::drawKnob ( QPainter *  painter,
const QRectF &  knobRect 
) const
protectedvirtual

Draw the knob

参数
painterpainter
knobRectBounding rectangle of the knob (without scale)

◆ drawMarker()

void QwtKnob::drawMarker ( QPainter *  painter,
const QRectF &  rect,
double  angle 
) const
protectedvirtual

Draw the marker at the knob's front

参数
painterPainter
rectBounding rectangle of the knob without scale
angleAngle of the marker in degrees ( clockwise, 0 at the 12 o'clock position )

◆ isScrollPosition()

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

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

参数
posMouse position
返回值
True,whenpos is inside the circle of the knob.
参见
scrolledTo()

实现了 QwtAbstractSlider.

◆ knobRect()

QRect QwtKnob::knobRect ( ) const

Return the bounding rectangle of the knob

计算不含刻度的旋钮边界矩形

◆ knobStyle()

QwtKnob::KnobStyle QwtKnob::knobStyle ( ) const

Return the knob style

返回旋钮样式

◆ knobWidth()

int QwtKnob::knobWidth ( ) const

Return the knob's width

Return the width of the knob

◆ markerSize()

int QwtKnob::markerSize ( ) const

Return the marker size

返回标记大小

◆ markerStyle()

QwtKnob::MarkerStyle QwtKnob::markerStyle ( ) const

Return the marker style

返回标记样式

◆ minimumSizeHint()

QSize QwtKnob::minimumSizeHint ( ) const
overridevirtual

Return minimum size hint

返回最小大小提示

◆ numTurns()

int QwtKnob::numTurns ( ) const

Return the number of turns

返回圈数

◆ paintEvent()

void QwtKnob::paintEvent ( QPaintEvent *  event)
overrideprotectedvirtual

Repaint the knob

参数
eventPaint event

◆ scaleDraw() [1/2]

QwtRoundScaleDraw * QwtKnob::scaleDraw ( )

Return the scale draw (non-const version)

返回旋钮的刻度绘制器 (非 const 版本)

◆ scaleDraw() [2/2]

const QwtRoundScaleDraw * QwtKnob::scaleDraw ( ) const

Return the scale draw (const version)

返回旋钮的刻度绘制器 (const 版本)

◆ scrolledTo()

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

Determine the value for a new position of the mouse

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

实现了 QwtAbstractSlider.

◆ setAlignment()

void QwtKnob::setAlignment ( Qt::Alignment  alignment)

Set alignment of the knob inside contentsRect()

设置旋钮的对齐方式

◆ setBorderWidth()

void QwtKnob::setBorderWidth ( int  borderWidth)

Set the border width

设置旋钮边框宽度

◆ setKnobStyle()

void QwtKnob::setKnobStyle ( KnobStyle  knobStyle)

Set the knob style

设置旋钮类型

◆ setKnobWidth()

void QwtKnob::setKnobWidth ( int  width)

Set the knob's width (diameter)

更改旋钮宽度

◆ setMarkerSize()

void QwtKnob::setMarkerSize ( int  size)

Set the marker size

设置标记大小

◆ setMarkerStyle()

void QwtKnob::setMarkerStyle ( MarkerStyle  markerStyle)

Set the marker style

设置旋钮的标记类型

◆ setNumTurns()

void QwtKnob::setNumTurns ( int  numTurns)

Set the number of turns for the knob

设置圈数

◆ setScaleDraw()

void QwtKnob::setScaleDraw ( QwtRoundScaleDraw scaleDraw)

Set the scale draw

更改旋钮的刻度绘制器

◆ setTotalAngle()

void QwtKnob::setTotalAngle ( double  angle)

Set the total angle which the knob can be turned

设置旋钮可转动的总角度

◆ sizeHint()

QSize QwtKnob::sizeHint ( ) const
overridevirtual

Return size hint

返回大小提示

◆ totalAngle()

double QwtKnob::totalAngle ( ) const

Return the total angle

返回总角度


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