QAccessibleTextInterface Class

QAccessibleTextInterface 클래스는 텍스트 처리에 대한 지원을 구현합니다. 더 보기...

Header: #include <QAccessibleTextInterface>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui

공용 함수

virtual ~QAccessibleTextInterface()
virtual void addSelection(int startOffset, int endOffset) = 0
virtual QString attributes(int offset, int *startOffset, int *endOffset) const = 0
virtual int characterCount() const = 0
virtual QRect characterRect(int offset) const = 0
virtual int cursorPosition() const = 0
virtual int offsetAtPoint(const QPoint &point) const = 0
virtual void removeSelection(int selectionIndex) = 0
virtual void scrollToSubstring(int startIndex, int endIndex) = 0
virtual void selection(int selectionIndex, int *startOffset, int *endOffset) const = 0
virtual int selectionCount() const = 0
virtual void setCursorPosition(int position) = 0
virtual void setSelection(int selectionIndex, int startOffset, int endOffset) = 0
virtual QString text(int startOffset, int endOffset) const = 0
virtual QString textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const
virtual QString textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const
virtual QString textBeforeOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const

상세 설명

이 인터페이스는 IAccessibleText 인터페이스에 해당합니다. 일반 레이블보다 더 많은 텍스트를 표시하는 위젯에 대해 구현해야 합니다. 레이블은 QAccessibleInterface 로만 표시되어야 하며 텍스트를 이름(QAccessibleInterface::text(), 유형은 QAccessible::Name )으로 반환해야 합니다. QAccessibleTextInterface는 일반적으로 스크린 리더가 한 줄씩 읽으려는 텍스트와 텍스트 선택 및 입력을 지원하는 위젯을 위한 인터페이스입니다. 예를 들어 이 인터페이스는 QLineEdit 에 구현되어 있습니다.

IAccessible2 사양

멤버 함수 문서

[virtual noexcept] QAccessibleTextInterface::~QAccessibleTextInterface()

QAccessibleTextInterface 를 파괴합니다.

[pure virtual] void QAccessibleTextInterface::addSelection(int startOffset, int endOffset)

startOffset 에서 endOffset 까지 텍스트를 선택합니다. startOffset 은 선택될 첫 번째 문자입니다. endOffset 은 선택되지 않을 첫 번째 문자입니다.

객체가 다중 선택을 지원하는 경우(예: 워드 프로세서에서) 새 선택 항목이 추가되고 그렇지 않은 경우 이전 선택 항목이 대체됩니다.

선택 영역의 길이는 endOffset - startOffset 문자가 됩니다.

[pure virtual] QString QAccessibleTextInterface::attributes(int offset, int *startOffset, int *endOffset) const

offset 위치의 텍스트 속성을 반환합니다. 또한 속성의 범위는 startOffsetendOffset 에서 반환됩니다.

[pure virtual] int QAccessibleTextInterface::characterCount() const

텍스트의 길이(공백을 포함한 총 크기)를 반환합니다.

[pure virtual] QRect QAccessibleTextInterface::characterRect(int offset) const

offset 위치에 있는 문자의 위치와 크기를 화면 좌표로 반환합니다.

[pure virtual] int QAccessibleTextInterface::cursorPosition() const

현재 커서 위치를 반환합니다.

setCursorPosition()도 참조하세요 .

[pure virtual] int QAccessibleTextInterface::offsetAtPoint(const QPoint &point) const

화면 좌표에서 point 위치에 있는 문자의 오프셋을 반환합니다.

[pure virtual] void QAccessibleTextInterface::removeSelection(int selectionIndex)

인덱스로 선택 항목을 지웁니다 selectionIndex.

[pure virtual] void QAccessibleTextInterface::scrollToSubstring(int startIndex, int endIndex)

startIndexendIndex 사이의 텍스트가 표시되도록 합니다.

[pure virtual] void QAccessibleTextInterface::selection(int selectionIndex, int *startOffset, int *endOffset) const

선택 영역을 반환합니다. 선택 영역의 크기는 startOffsetendOffset 으로 반환됩니다. 선택 영역이 없는 경우 startOffsetendOffsetnullptr 입니다.

접근성 API는 여러 선택 항목을 지원합니다. 하지만 대부분의 위젯에서는 selectionIndex 이 0인 하나의 선택만 지원됩니다.

setSelection()도 참조하세요 .

[pure virtual] int QAccessibleTextInterface::selectionCount() const

이 텍스트의 선택 개수를 반환합니다.

[pure virtual] void QAccessibleTextInterface::setCursorPosition(int position)

position 로 커서를 이동합니다.

cursorPosition()도 참조하세요 .

[pure virtual] void QAccessibleTextInterface::setSelection(int selectionIndex, int startOffset, int endOffset)

selectionIndexstartOffset ~ endOffset 범위로 설정합니다.

selection(), addSelection() 및 removeSelection()도 참조하세요 .

[pure virtual] QString QAccessibleTextInterface::text(int startOffset, int endOffset) const

startOffset 에서 endOffset 로의 텍스트를 반환합니다. startOffset 은 반환되는 첫 번째 문자입니다. endOffset 은 반환되지 않는 첫 번째 문자입니다.

[virtual] QString QAccessibleTextInterface::textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const

오프셋 offset 바로 뒤에 있는 boundaryType 유형의 텍스트 항목을 반환하고 startOffsetendOffset 값을 해당 항목의 시작 및 끝 위치로 설정하며, 해당 항목이 없는 경우 빈 문자열을 반환합니다. 오류 시 startOffsetendOffset 값을 -1로 설정합니다.

이 기본 구현은 작은 텍스트 편집을 위해 제공됩니다. 워드 프로세서나 텍스트 편집기에서 자체적으로 효율적인 구현을 제공해야 합니다. 이 함수는 단락과 줄을 구분하지 않습니다.

참고: 이 함수는 커서 위치를 고려할 수 없습니다. 규칙에 따라 offset 의 -2는 이 함수가 커서 위치를 오프셋으로 사용해야 함을 의미합니다. 따라서 이 함수를 호출하기 전에 오프셋이 -2이면 커서 위치를 커서 위치로 변환해야 합니다. 오프셋 -1은 텍스트 길이에 사용되며 이 함수의 사용자 정의 구현은 길이가 오프셋으로 전달된 것처럼 결과를 반환해야 합니다.

[virtual] QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const

오프셋 offset 에서 boundaryType 유형의 텍스트 항목을 반환하고 startOffsetendOffset 값을 해당 항목의 시작 및 끝 위치로 설정하며, 해당 항목이 없는 경우 빈 문자열을 반환합니다. 오류 시 startOffsetendOffset 값을 -1로 설정합니다.

이 기본 구현은 작은 텍스트 편집을 위해 제공됩니다. 워드 프로세서나 텍스트 편집기에서 자체적으로 효율적인 구현을 제공해야 합니다. 이 함수는 단락과 줄을 구분하지 않습니다.

참고: 이 함수는 커서 위치를 고려할 수 없습니다. 규칙에 따라 offset 의 -2는 이 함수가 커서 위치를 오프셋으로 사용해야 함을 의미합니다. 따라서 이 함수를 호출하기 전에 오프셋이 -2이면 커서 위치를 커서 위치로 변환해야 합니다. 오프셋 -1은 텍스트 길이에 사용되며 이 함수의 사용자 정의 구현은 길이가 오프셋으로 전달된 것처럼 결과를 반환해야 합니다.

[virtual] QString QAccessibleTextInterface::textBeforeOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const

오프셋 offset 에 가까운 boundaryType 유형의 텍스트 항목을 반환하고 startOffsetendOffset 값을 해당 항목의 시작 및 끝 위치로 설정하며, 해당 항목이 없는 경우 빈 문자열을 반환합니다. 오류 시 startOffsetendOffset 값을 -1로 설정합니다.

이 기본 구현은 작은 텍스트 편집을 위해 제공됩니다. 워드 프로세서나 텍스트 편집기에서 자체적으로 효율적인 구현을 제공해야 합니다. 이 함수는 단락과 줄을 구분하지 않습니다.

참고: 이 함수는 커서 위치를 고려할 수 없습니다. 규칙에 따라 offset 의 -2는 이 함수가 커서 위치를 오프셋으로 사용해야 함을 의미합니다. 따라서 이 함수를 호출하기 전에 오프셋이 -2이면 커서 위치를 커서 위치로 변환해야 합니다. 오프셋 -1은 텍스트 길이에 사용되며 이 함수의 사용자 정의 구현은 길이가 오프셋으로 전달된 것처럼 결과를 반환해야 합니다.

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