|
QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
|
轮式控件 更多...
#include <qwt_wheel.h>
类 | |
| class | PrivateData |
Public 槽 | |
| void | setValue (double) |
| 设置新值而不调整到步栅格 | |
| void | setTotalAngle (double) |
| void | setViewAngle (double) |
| 指定轮的可见部分 | |
| void | setMass (double) |
| 设置滑块的质量以实现飞轮效果 | |
信号 | |
| void | valueChanged (double value) |
| 通知值变化 | |
| void | wheelPressed () |
| 当用户用鼠标按下轮时发出此信号 | |
| void | wheelReleased () |
| 当用户释放鼠标时发出此信号 | |
| void | wheelMoved (double value) |
| 当用户用鼠标移动轮时发出此信号 | |
Public 成员函数 | |
| QwtWheel (QWidget *parent=nullptr) | |
| Constructor | |
| virtual | ~QwtWheel () |
| Destructor | |
| double | value () const |
| Return the current value | |
| void | setOrientation (Qt::Orientation) |
| Set the wheel orientation | |
| Qt::Orientation | orientation () const |
| Return the orientation | |
| double | totalAngle () const |
| Return the total angle | |
| double | viewAngle () const |
| Return the view angle | |
| void | setTickCount (int) |
| Set the number of ticks | |
| int | tickCount () const |
| Return the number of ticks | |
| void | setWheelWidth (int) |
| Set the wheel width | |
| int | wheelWidth () const |
| Return the wheel width | |
| void | setWheelBorderWidth (int) |
| Set the wheel border width | |
| int | wheelBorderWidth () const |
| Return the wheel border width | |
| void | setBorderWidth (int) |
| Set the outer border width | |
| int | borderWidth () const |
| Return the outer border width | |
| void | setInverted (bool) |
| Set inverted appearance | |
| bool | isInverted () const |
| Return whether the wheel is inverted | |
| void | setWrapping (bool) |
| Set wrapping mode | |
| bool | wrapping () const |
| Return whether wrapping is enabled | |
| void | setSingleStep (double) |
| Set single step size | |
| double | singleStep () const |
| Return single step size | |
| void | setPageStepCount (int) |
| Set page step count | |
| int | pageStepCount () const |
| Return page step count | |
| void | setStepAlignment (bool on) |
| Set step alignment | |
| bool | stepAlignment () const |
| Return whether step alignment is enabled | |
| void | setRange (double min, double max) |
| Set value range | |
| void | setMinimum (double) |
| Set minimum value | |
| double | minimum () const |
| Return minimum value | |
| void | setMaximum (double) |
| Set maximum value | |
| double | maximum () const |
| Return maximum value | |
| void | setUpdateInterval (int) |
| Set update interval | |
| int | updateInterval () const |
| Return update interval | |
| void | setTracking (bool) |
| Set tracking mode | |
| bool | isTracking () const |
| Return whether tracking is enabled | |
| double | mass () const |
| Return mass for flywheel effect | |
Protected 成员函数 | |
| virtual void | paintEvent (QPaintEvent *) override |
| virtual void | mousePressEvent (QMouseEvent *) override |
| virtual void | mouseReleaseEvent (QMouseEvent *) override |
| virtual void | mouseMoveEvent (QMouseEvent *) override |
| virtual void | keyPressEvent (QKeyEvent *) override |
| 处理键盘事件 | |
| virtual void | wheelEvent (QWheelEvent *) override |
| virtual void | timerEvent (QTimerEvent *) override |
| void | stopFlying () |
| QRect | wheelRect () const |
| virtual QSize | sizeHint () const override |
| 返回大小提示 | |
| virtual QSize | minimumSizeHint () const override |
| 返回最小大小提示 | |
| virtual void | drawTicks (QPainter *, const QRectF &) |
| Draw the Wheel's ticks | |
| virtual void | drawWheelBackground (QPainter *, const QRectF &) |
| Draw the Wheel's background gradient | |
| virtual double | valueAt (const QPoint &) const |
| Determine the value corresponding to a specified point | |
轮式控件
| int QwtWheel::borderWidth | ( | ) | const |
|
protectedvirtual |
Draw the Wheel's ticks
| painter | Painter |
| rect | Geometry for the wheel |
|
protectedvirtual |
Draw the Wheel's background gradient
| painter | Painter |
| rect | Geometry for the wheel |
| bool QwtWheel::isInverted | ( | ) | const |
Return whether the wheel is inverted
返回轮是否反转
| bool QwtWheel::isTracking | ( | ) | const |
|
overrideprotectedvirtual |
处理键盘事件
| event | 键盘事件 |
| double QwtWheel::mass | ( | ) | const |
Return mass for flywheel effect
返回飞轮效果的质量
| double QwtWheel::maximum | ( | ) | const |
Return maximum value
返回范围的最大值
| double QwtWheel::minimum | ( | ) | const |
Return minimum value
返回范围的最小值
|
overrideprotectedvirtual |
返回最小大小提示
|
overrideprotectedvirtual |
鼠标移动事件处理程序
根据鼠标位置转动轮
| event | 鼠标事件 |
|
overrideprotectedvirtual |
鼠标按下事件处理程序
开始轮的移动。
| event | 鼠标事件 |
|
overrideprotectedvirtual |
鼠标释放事件处理程序
当轮没有质量时,轮的移动停止,否则开始飞行。
| event | 鼠标事件 |
| Qt::Orientation QwtWheel::orientation | ( | ) | const |
Return the orientation
返回方向
| int QwtWheel::pageStepCount | ( | ) | const |
Return page step count
返回页步数
|
overrideprotectedvirtual |
Qt 绘制事件
| event | 绘制事件 |
| void QwtWheel::setBorderWidth | ( | int | width | ) |
Set the outer border width
设置边框宽度
边框默认为 2。
| width | 边框宽度 |
| void QwtWheel::setInverted | ( | bool | on | ) |
Set inverted appearance
启用/禁用反转外观
|
slot |
设置滑块的质量以实现飞轮效果
| void QwtWheel::setMaximum | ( | double | value | ) |
Set maximum value
设置范围的最大值
| void QwtWheel::setMinimum | ( | double | value | ) |
Set minimum value
设置范围的最小值
| void QwtWheel::setOrientation | ( | Qt::Orientation | orientation | ) |
Set the wheel orientation
设置轮的方向
| void QwtWheel::setPageStepCount | ( | int | count | ) |
Set page step count
设置页步数
| void QwtWheel::setRange | ( | double | min, |
| double | max | ||
| ) |
Set value range
设置最小值和最大值
| void QwtWheel::setSingleStep | ( | double | stepSize | ) |
Set single step size
设置计数器的步长
| void QwtWheel::setStepAlignment | ( | bool | on | ) |
Set step alignment
启用/禁用步对齐
| void QwtWheel::setTickCount | ( | int | count | ) |
Set the number of ticks
调整轮表面凹槽的数量。
凹槽数量限制为 6 <= count <= 50。 超出此范围的值将被裁剪。 默认值为 10。
| count | 每 360 度的凹槽数 |
|
slot |
设置轮可以转动的总角度。
轮的一整圈对应 360 度。 n*360 度的总角度意味着轮必须绕其轴转动 n 圈 才能从最小值到最大值。
总角度的默认设置是 360 度。
| angle | 总角度(度) |
| void QwtWheel::setTracking | ( | bool | enable | ) |
Set tracking mode
启用/禁用跟踪
如果启用了跟踪(默认),轮在移动时会发出 valueChanged() 信号。 如果禁用了跟踪,轮只在移动终止时才发出 valueChanged() 信号。
wheelMoved() 信号无论是否启用跟踪都会发出。
| enable | 开/关 |
| void QwtWheel::setUpdateInterval | ( | int | interval | ) |
Set update interval
指定轮飞行时的更新间隔
默认值和最小值是 50 毫秒。
| interval | 间隔(毫秒) |
|
slot |
设置新值而不调整到步栅格
|
slot |
指定轮的可见部分
| void QwtWheel::setWheelBorderWidth | ( | int | borderWidth | ) |
Set the wheel border width
设置轮的边框宽度。
轮边框不能小于 1, 并且根据轮的大小有限制。 超出允许范围的值将被裁剪。
轮边框默认为 2。
| borderWidth | 边框宽度 |
| void QwtWheel::setWheelWidth | ( | int | width | ) |
Set the wheel width
设置轮的宽度
| void QwtWheel::setWrapping | ( | bool | on | ) |
Set wrapping mode
启用/禁用环绕
| double QwtWheel::singleStep | ( | ) | const |
Return single step size
返回单步大小
|
overrideprotectedvirtual |
返回大小提示
| bool QwtWheel::stepAlignment | ( | ) | const |
Return whether step alignment is enabled
返回是否启用了步对齐
|
protected |
停止轮的飞行移动
| int QwtWheel::tickCount | ( | ) | const |
Return the number of ticks
|
overrideprotectedvirtual |
Qt 定时器事件
飞轮效果使用定时器实现
| event | 定时器事件 |
| double QwtWheel::totalAngle | ( | ) | const |
| int QwtWheel::updateInterval | ( | ) | const |
| double QwtWheel::value | ( | ) | const |
Return the current value
返回轮的当前值
|
protectedvirtual |
Determine the value corresponding to a specified point
| pos | Position |
|
signal |
通知值变化
| double QwtWheel::viewAngle | ( | ) | const |
Return the view angle
返回轮的可见部分
| int QwtWheel::wheelBorderWidth | ( | ) | const |
|
overrideprotectedvirtual |
处理轮事件
增加/减少值
| event | 轮事件 |
|
signal |
当用户用鼠标移动轮时发出此信号
|
signal |
当用户用鼠标按下轮时发出此信号
|
protected |
|
signal |
当用户释放鼠标时发出此信号
| int QwtWheel::wheelWidth | ( | ) | const |
Return the wheel width
返回轮的宽度
| bool QwtWheel::wrapping | ( | ) | const |
Return whether wrapping is enabled
返回是否启用了环绕