Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qaccessiblequicktextedit.cpp
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
6QT_BEGIN_NAMESPACE
7
8#if QT_CONFIG(accessibility)
9
10QAccessibleQuickTextEdit::QAccessibleQuickTextEdit(QQuickTextEdit *textEdit)
11 : QAccessibleQuickItem(textEdit)
12{
13}
14
15void QAccessibleQuickTextEdit::removeSelection(int selectionIndex)
16{
17 if (selectionCount() == 1 && selectionIndex == 0) {
18 const int cursorPos = textEdit()->cursorPosition();
19 textEdit()->select(cursorPos, cursorPos);
20 }
21}
22
23void QAccessibleQuickTextEdit::setSelection(int selectionIndex, int startOffset, int endOffset)
24{
25 if (selectionIndex == 0)
26 textEdit()->select(startOffset, endOffset);
27}
28
29#endif // accessibility
30
31QT_END_NAMESPACE