summaryrefslogtreecommitdiffstats
path: root/src/plugins/accessible/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/accessible/widgets')
-rw-r--r--src/plugins/accessible/widgets/qaccessiblewidgets.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
index 91bdc02..61cbacf 100644
--- a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
+++ b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
@@ -1645,12 +1645,17 @@ static QTextCursor cursorForRange(QTextEdit *textEdit, int startOffset, int endO
void QAccessibleTextEdit::copyText(int startOffset, int endOffset)
{
+#ifndef QT_NO_CLIPBOARD
+ QTextCursor previousCursor = textEdit()->textCursor();
QTextCursor cursor = cursorForRange(textEdit(), startOffset, endOffset);
if (!cursor.hasSelection())
return;
-// QApplication::clipboard()->setMimeData(new QTextEditMimeData(cursor.selection()));
+ textEdit()->setTextCursor(cursor);
+ textEdit()->copy();
+ textEdit()->setTextCursor(previousCursor);
+#endif
}
void QAccessibleTextEdit::deleteText(int startOffset, int endOffset)
@@ -1670,13 +1675,15 @@ void QAccessibleTextEdit::insertText(int offset, const QString &text)
void QAccessibleTextEdit::cutText(int startOffset, int endOffset)
{
+#ifndef QT_NO_CLIPBOARD
QTextCursor cursor = cursorForRange(textEdit(), startOffset, endOffset);
if (!cursor.hasSelection())
return;
-// QApplication::clipboard()->setMimeData(new QTextEditMimeData(cursor.selection()));
- cursor.removeSelectedText();
+ textEdit()->setTextCursor(cursor);
+ textEdit()->cut();
+#endif
}
void QAccessibleTextEdit::pasteText(int offset)