Call QAccessible::updateAccessibility when changing accessible name.

Reviewed-by: Jan-Arve
(cherry picked from commit e783275cfb71e7325472b3aea54e109a7a854bf7)
This commit is contained in:
Frederik Gladhorn 2011-02-17 19:56:30 +01:00 committed by Olivier Goffart
parent 74060f05d1
commit 8f5b2faaac
2 changed files with 7 additions and 0 deletions

View File

@ -11206,6 +11206,7 @@ void QWidget::setAccessibleName(const QString &name)
{
Q_D(QWidget);
d->accessibleName = name;
QAccessible::updateAccessibility(this, 0, QAccessible::NameChanged);
}
QString QWidget::accessibleName() const
@ -11227,6 +11228,7 @@ void QWidget::setAccessibleDescription(const QString &description)
{
Q_D(QWidget);
d->accessibleDescription = description;
QAccessible::updateAccessibility(this, 0, QAccessible::DescriptionChanged);
}
QString QWidget::accessibleDescription() const

View File

@ -479,6 +479,11 @@ void tst_QAccessibility::eventTest()
QVERIFY_EVENT(button, 0, QAccessible::StateChanged);
QVERIFY_EVENT(button, 0, QAccessible::StateChanged);
button->setAccessibleName("Olaf the second");
QVERIFY_EVENT(button, 0, QAccessible::NameChanged);
button->setAccessibleDescription("This is a button labeled Olaf");
QVERIFY_EVENT(button, 0, QAccessible::DescriptionChanged);
button->hide();
QVERIFY_EVENT(button, 0, QAccessible::ObjectHide);