summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>2012-01-20 18:07:54 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-02-08 12:12:03 (GMT)
commitd5649547d641b9c5af3c3f814caf8e1ab5bf9f47 (patch)
treeb05596aa817fd859ed49fc1c07cac150b6e2be2b /src/gui/text
parent9c97217e3bedb2708bba6f23cbc6dd603569e077 (diff)
downloadQt-d5649547d641b9c5af3c3f814caf8e1ab5bf9f47.zip
Qt-d5649547d641b9c5af3c3f814caf8e1ab5bf9f47.tar.gz
Qt-d5649547d641b9c5af3c3f814caf8e1ab5bf9f47.tar.bz2
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')
-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 1462095..1f81463 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();
}