summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextcontrol.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>2012-01-20 19:07:54 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-08 13:12:03 +0100
commitd5649547d641b9c5af3c3f814caf8e1ab5bf9f47 (patch)
treeb05596aa817fd859ed49fc1c07cac150b6e2be2b /src/gui/text/qtextcontrol.cpp
parent9c97217e3bedb2708bba6f23cbc6dd603569e077 (diff)
Update accessibility selections in QTextControl.
Change-Id: Iae0c2792b64b8ec2736a9ff621cf7c313a394093 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
Diffstat (limited to 'src/gui/text/qtextcontrol.cpp')
-rw-r--r--src/gui/text/qtextcontrol.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index 1462095d3a..1f81463254 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -79,6 +79,7 @@
#include <qtooltip.h>
#include <qstyleoption.h>
#include <QtGui/qlineedit.h>
+#include <QtGui/qaccessible.h>
#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();
}