|
QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
|
计数器控件 更多...
#include <qwt_counter.h>
类 | |
| class | PrivateData |
Public 类型 | |
| enum | Button { Button1 , Button2 , Button3 , ButtonCnt } |
| 按钮索引 更多... | |
Public 槽 | |
| void | setValue (double) |
| 设置新值,不调整到步长网格 | |
信号 | |
| void | buttonReleased (double value) |
| 当按钮释放时发出的信号 | |
| void | valueChanged (double value) |
| 当计数器值改变时发出的信号 | |
Public 成员函数 | |
| QwtCounter (QWidget *parent=nullptr) | |
| Constructor | |
| virtual | ~QwtCounter () |
| Destructor | |
| void | setValid (bool) |
| Set the counter to be in valid/invalid state | |
| bool | isValid () const |
| Return true if the value is valid | |
| void | setWrapping (bool) |
| Enable or disable wrapping | |
| bool | wrapping () const |
| Return true if wrapping is enabled | |
| bool | isReadOnly () const |
| Return true if the counter is read only | |
| void | setReadOnly (bool) |
| Set the counter to read only mode | |
| void | setNumButtons (int) |
| Set the number of buttons on each side | |
| int | numButtons () const |
| Return the number of buttons | |
| void | setIncSteps (QwtCounter::Button, int numSteps) |
| Set the number of increment steps for a button | |
| int | incSteps (QwtCounter::Button) const |
| Return the number of increment steps for a button | |
| virtual QSize | sizeHint () const override |
| Return a size hint | |
| double | singleStep () const |
| Return the single step size | |
| void | setSingleStep (double stepSize) |
| Set the single step size | |
| void | setRange (double min, double max) |
| Set the range of the counter | |
| double | minimum () const |
| Return the minimum value | |
| void | setMinimum (double) |
| Set the minimum value | |
| double | maximum () const |
| Return the maximum value | |
| void | setMaximum (double) |
| Set the maximum value | |
| void | setStepButton1 (int nSteps) |
| Set the number of increment steps for button 1 | |
| int | stepButton1 () const |
| Return the number of increment steps for button 1 | |
| void | setStepButton2 (int nSteps) |
| Set the number of increment steps for button 2 | |
| int | stepButton2 () const |
| Return the number of increment steps for button 2 | |
| void | setStepButton3 (int nSteps) |
| Set the number of increment steps for button 3 | |
| int | stepButton3 () const |
| Return the number of increment steps for button 3 | |
| double | value () const |
| Return the current value | |
Protected 成员函数 | |
| virtual bool | event (QEvent *) override |
| Handle QEvent::PolishRequest events | |
| virtual void | wheelEvent (QWheelEvent *) override |
| Handle wheel events | |
| virtual void | keyPressEvent (QKeyEvent *) override |
| Handle key events | |
属性 | |
| double | value |
| double | minimum |
| double | maximum |
| double | singleStep |
| int | numButtons |
| int | stepButton1 |
| int | stepButton2 |
| int | stepButton3 |
| bool | readOnly |
| bool | wrapping |
计数器控件
| enum QwtCounter::Button |
|
explicit |
Constructor
构造函数
|
virtual |
Destructor
析构函数
|
signal |
当按钮释放时发出的信号
|
overrideprotectedvirtual |
Handle QEvent::PolishRequest events
| event | Event |
| int QwtCounter::incSteps | ( | QwtCounter::Button | button | ) | const |
Return the number of increment steps for a button
返回指定按钮增加值的步数,如果按钮无效则返回 0
| bool QwtCounter::isReadOnly | ( | ) | const |
Return true if the counter is read only
当行编辑器为只读时返回 true
| bool QwtCounter::isValid | ( | ) | const |
Return true if the value is valid
如果值有效则返回 true
|
overrideprotectedvirtual |
Handle key events
| event | Key event |
| double QwtCounter::maximum | ( | ) | const |
Return the maximum value
返回范围的最大值
| double QwtCounter::minimum | ( | ) | const |
Return the minimum value
返回范围的最小值
| int QwtCounter::numButtons | ( | ) | const |
Return the number of buttons
返回控件两侧的按钮数量
| void QwtCounter::setIncSteps | ( | QwtCounter::Button | button, |
| int | numSteps | ||
| ) |
Set the number of increment steps for a button
指定按下特定按钮时值增加或减少的步数
| void QwtCounter::setMaximum | ( | double | value | ) |
Set the maximum value
设置范围的最大值
| void QwtCounter::setMinimum | ( | double | value | ) |
Set the minimum value
设置范围的最小值
| void QwtCounter::setNumButtons | ( | int | numButtons | ) |
Set the number of buttons on each side
指定标签两侧的按钮数量
| void QwtCounter::setRange | ( | double | min, |
| double | max | ||
| ) |
Set the range of the counter
设置最小值和最大值
| void QwtCounter::setReadOnly | ( | bool | on | ) |
Set the counter to read only mode
允许/禁止用户手动编辑值
| void QwtCounter::setSingleStep | ( | double | stepSize | ) |
Set the single step size
设置计数器的步长
| void QwtCounter::setStepButton1 | ( | int | nSteps | ) |
Set the number of increment steps for button 1
设置按钮 1 的增加步数
| void QwtCounter::setStepButton2 | ( | int | nSteps | ) |
Set the number of increment steps for button 2
设置按钮 2 的增加步数
| void QwtCounter::setStepButton3 | ( | int | nSteps | ) |
Set the number of increment steps for button 3
设置按钮 3 的增加步数
| void QwtCounter::setValid | ( | bool | on | ) |
Set the counter to be in valid/invalid state
设置计数器的有效/无效状态
|
slot |
设置新值,不调整到步长网格
| void QwtCounter::setWrapping | ( | bool | on | ) |
Enable or disable wrapping
启用/禁用循环
| double QwtCounter::singleStep | ( | ) | const |
Return the single step size
返回单步大小
|
overridevirtual |
Return a size hint
返回尺寸提示
| int QwtCounter::stepButton1 | ( | ) | const |
Return the number of increment steps for button 1
返回按钮 1 的增加步数
| int QwtCounter::stepButton2 | ( | ) | const |
Return the number of increment steps for button 2
返回按钮 2 的增加步数
| int QwtCounter::stepButton3 | ( | ) | const |
Return the number of increment steps for button 3
返回按钮 3 的增加步数
| double QwtCounter::value | ( | ) | const |
Return the current value
返回计数器的当前值
|
signal |
当计数器值改变时发出的信号
|
overrideprotectedvirtual |
Handle wheel events
| event | Wheel event |
| bool QwtCounter::wrapping | ( | ) | const |
Return true if wrapping is enabled
当设置了循环时返回 true