QAccessibleTextUpdateEvent Class

QAccessibleTextUpdateEvent 类通知文本更改。这适用于支持可编辑文本(如行编辑)的可访问性。例如,当粘贴新文本或在编辑器的覆盖模式下替换部分选定文本时,就会发生该事件。更多

页眉: #include <QAccessibleTextUpdateEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
继承: QAccessibleTextCursorEvent

公共函数

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

返回删除的文本。

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