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>
This commit is contained in:
José Millán Soto 2011-07-14 14:25:57 +02:00 committed by Qt by Nokia
parent eeffba2e55
commit 420c4edb8a

View File

@ -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