diff options
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextcontrol.cpp | 15 |
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(); } |