From d5649547d641b9c5af3c3f814caf8e1ab5bf9f47 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Fri, 20 Jan 2012 19:07:54 +0100 Subject: Update accessibility selections in QTextControl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iae0c2792b64b8ec2736a9ff621cf7c313a394093 Reviewed-by: Jan-Arve Sæther Reviewed-by: Frederik Gladhorn --- src/gui/text/qtextcontrol.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index 1462095..1f81463 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -79,6 +79,7 @@ #include #include #include +#include #ifndef QT_NO_SHORTCUT #include "private/qapplication_p.h" @@ -573,8 +574,13 @@ void QTextControlPrivate::repaintOldAndNewSelection(const QTextCursor &oldSelect void QTextControlPrivate::selectionChanged(bool forceEmitSelectionChanged /*=false*/) { Q_Q(QTextControl); - if (forceEmitSelectionChanged) + if (forceEmitSelectionChanged) { emit q->selectionChanged(); +#ifndef QT_NO_ACCESSIBILITY + if (q->parent()) + QAccessible::updateAccessibility(q->parent(), 0, QAccessible::TextSelectionChanged); +#endif + } bool current = cursor.hasSelection(); if (current == lastSelectionState) @@ -582,8 +588,13 @@ void QTextControlPrivate::selectionChanged(bool forceEmitSelectionChanged /*=fal lastSelectionState = current; emit q->copyAvailable(current); - if (!forceEmitSelectionChanged) + if (!forceEmitSelectionChanged) { emit q->selectionChanged(); +#ifndef QT_NO_ACCESSIBILITY + if (q->parent()) + QAccessible::updateAccessibility(q->parent(), 0, QAccessible::TextSelectionChanged); +#endif + } emit q->microFocusChanged(); } -- cgit v0.12