本页内容

QAccessibleValueInterface Class

QAccessibleValueInterface 类为操作值的对象提供了支持。更多内容...

头文件: #include <QAccessibleValueInterface>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui

公共函数

QAccessibleValueInterface()
virtual ~QAccessibleValueInterface()
virtual QVariant currentValue() const = 0
virtual QVariant maximumValue() const = 0
virtual QVariant minimumStepSize() const = 0
virtual QVariant minimumValue() const = 0
virtual void setCurrentValue(const QVariant &value) = 0

详细说明

此接口应由代表某个值的辅助功能对象实现。例如:旋转控件、滑块、拨盘和滚动条。

该接口提供了一种更简便的方法来处理其所代表的小部件类型,而无需强制用户处理小部件的各个部分。

通常,实现此接口的类也会实现QAccessibleInterface 。

IAccessible2 规范

成员函数文档

[constexpr noexcept default] QAccessibleValueInterface::QAccessibleValueInterface()

默认——构造一个QAccessibleValueInterface 的实例。

[virtual noexcept] QAccessibleValueInterface::~QAccessibleValueInterface()

销毁QAccessibleValueInterface 。

[pure virtual] QVariant QAccessibleValueInterface::currentValue() const

返回控件的当前值。该值通常为 double 或 int 类型。

另请参阅 setCurrentValue()。

[pure virtual] QVariant QAccessibleValueInterface::maximumValue() const

返回该对象接受的最大值。

另请参阅 minimumValue() 和currentValue()。

[pure virtual] QVariant QAccessibleValueInterface::minimumStepSize() const

返回该可访问对象的最小步长。这是更改该值时最小的合理增量。通过编程方式更改该值时,其增量应始终为最小步长的倍数。

即使setCurrentValue 未执行任何操作,某些工具也会使用此值。例如,进度条虽为只读控件,但应返回其范围除以100的结果。

[pure virtual] QVariant QAccessibleValueInterface::minimumValue() const

返回该对象接受的最小值。

另请参阅 maximumValue() 和currentValue()。

[pure virtual] void QAccessibleValueInterface::setCurrentValue(const QVariant &value)

设置value 。如果所需的value 超出了允许值的范围,则该调用将被忽略。

另请参阅 currentValue()、minimumValue() 和maximumValue()。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.