diff options
author | José Millán Soto <fid@gpul.org> | 2011-07-14 14:25:57 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-26 22:42:10 +0200 |
commit | 420c4edb8aa8317afef864353a6fb5353d00ad60 (patch) | |
tree | 1de8321c678f3619608eb121a0a38c529fdb2047 | |
parent | eeffba2e55707912599b1258c8fda1684c7ef53b (diff) |
Call QAccessible::updateAccessibility when setText is called on QLabel
The method is called when the text of a label is changed and setAccessibleName has
not been called on the label, as the text of the label acts as the accessible name
of the label.
Merge-request: 1301
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
(cherry picked from commit a1f2b68e97477440cf508e6d497eb5f5d9971971)
Change-Id: Ic10f75e72ac3faa84777c444177b287b720a1dc2
Reviewed-on: http://codereview.qt.nokia.com/3040
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
-rw-r--r-- | src/gui/widgets/qlabel.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp index 7a94f42125..ab88f38bbb 100644 --- a/src/gui/widgets/qlabel.cpp +++ b/src/gui/widgets/qlabel.cpp @@ -55,6 +55,10 @@ #include "private/qstylesheetstyle_p.h" #include <qmath.h> +#ifndef QT_NO_ACCESSIBILITY +#include <qaccessible.h> +#endif + QT_BEGIN_NAMESPACE /*! @@ -377,6 +381,11 @@ void QLabel::setText(const QString &text) #endif d->updateLabel(); + +#ifndef QT_NO_ACCESSIBILITY + if (accessibleName().isEmpty()) + QAccessible::updateAccessibility(this, 0, QAccessible::NameChanged); +#endif } QString QLabel::text() const |