QAccessibleTextUpdateEvent Class
QAccessibleTextUpdateEvent 类用于通知文本更改。该类适用于支持可编辑文本的辅助功能控件,例如行编辑控件。例如,当通过粘贴新文本替换选定文本的一部分,或者在编辑器的覆盖模式下,该事件就会触发。更多内容...
| 头文件: | #include <QAccessibleTextUpdateEvent> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
| qmake: | QT += gui |
| 继承自: | QAccessibleTextCursorEvent |
- 所有成员列表(包括继承的成员)
- QAccessibleTextUpdateEvent 属于辅助功能类。
公共函数
| QAccessibleTextUpdateEvent(QAccessibleInterface *iface, int position, const QString &oldText, const QString &text) | |
| QAccessibleTextUpdateEvent(QObject *object, int position, const QString &oldText, const QString &text) | |
| int | changePosition() const |
| QString | textInserted() const |
| QString | textRemoved() const |
详细说明
该类与QAccessible::updateAccessibility() 配合使用。
成员函数文档
QAccessibleTextUpdateEvent::QAccessibleTextUpdateEvent(QAccessibleInterface *iface, int position, const QString &oldText, const QString &text)
为iface 创建一个新的QAccessibleTextUpdateEvent。文本更改发生在position 处,该处删除了oldText ,并插入text 。
QAccessibleTextUpdateEvent::QAccessibleTextUpdateEvent(QObject *object, int position, const QString &oldText, const QString &text)
为object 构建一个新的QAccessibleTextUpdateEvent。文本更改发生在position 处,该处已将oldText 删除,并插入text 。
int QAccessibleTextUpdateEvent::changePosition() const
返回发生更改的位置。
QString QAccessibleTextUpdateEvent::textInserted() const
返回已插入的文本。
QString QAccessibleTextUpdateEvent::textRemoved() const
返回已删除的文本。
© 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.