summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJosé Millán Soto <fid@gpul.org>2011-07-14 12:25:57 (GMT)
committerFrederik Gladhorn <frederik.gladhorn@nokia.com>2011-07-14 12:25:57 (GMT)
commita1f2b68e97477440cf508e6d497eb5f5d9971971 (patch)
tree25e072b24d533c7b0143044cbb7b3062074f7fbc /src
parentd29876008fad400bca8d6b37e5d5f61dd1bcb39d (diff)
downloadQt-a1f2b68e97477440cf508e6d497eb5f5d9971971.zip
Qt-a1f2b68e97477440cf508e6d497eb5f5d9971971.tar.gz
Qt-a1f2b68e97477440cf508e6d497eb5f5d9971971.tar.bz2
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>
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/qlabel.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp
index 26dd0e1..dcf35aa 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
/*!
@@ -370,6 +374,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