本页内容

QAccessibleTextSelectionEvent Class

QAccessibleTextSelectionEvent 用于通知对象的文本选择发生变化。更多内容...

标题: #include <QAccessibleTextSelectionEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
继承自: QAccessibleTextCursorEvent

公共函数

QAccessibleTextSelectionEvent(QAccessibleInterface *iface, int start, int end)
QAccessibleTextSelectionEvent(QObject *object, int start, int end)
int selectionEnd() const
int selectionStart() const
void setSelection(int start, int end)

详细说明

该类与QAccessible::updateAccessibility() 配合使用。

成员函数文档

QAccessibleTextSelectionEvent::QAccessibleTextSelectionEvent(QAccessibleInterface *iface, int start, int end)

为iface 构建一个新的QAccessibleTextSelectionEvent。该事件通知的新选区范围为start 至end 。

QAccessibleTextSelectionEvent::QAccessibleTextSelectionEvent(QObject *object, int start, int end)

为object 创建一个新的QAccessibleTextSelectionEvent。该事件通知的新选区范围为start 至end 。

int QAccessibleTextSelectionEvent::selectionEnd() const

返回最后一个选中字符的位置。

int QAccessibleTextSelectionEvent::selectionStart() const

返回第一个选中字符的位置。

void QAccessibleTextSelectionEvent::setSelection(int start, int end)

将此事件的选择范围设置为从位置start 到end 。

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