QAccessibleValueInterface Class

QAccessibleValueInterface 类实现了对操作值的对象的支持。更多

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

公共函数

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 规范

成员函数文档

[virtual noexcept] QAccessibleValueInterface::~QAccessibleValueInterface()

摧毁QAccessibleValueInterface.

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

返回 widget 的当前值。通常是一个 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()。

© 2025 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.