Call updateAccessibility on the QGraphicsObject in updateMicroFocus

Since QGraphicsObjects now can be in the a11y hierarchy, we should
treat them just like we treat widgets.
(cherry picked from commit 860745a4713b29857d14571572504da71a2ca077)

Reviewed-by: Frederik Gladhorn
(cherry picked from commit 4687938fd03ed65306039af6b4e5e192ec8bf491)
This commit is contained in:
Jan-Arve Sæther 2011-05-05 16:21:36 +02:00
parent 5e8b377cb7
commit 26acac4052

View File

@ -7395,15 +7395,19 @@ void QGraphicsItem::updateMicroFocus()
if (QWidget *fw = QApplication::focusWidget()) { if (QWidget *fw = QApplication::focusWidget()) {
if (scene()) { if (scene()) {
for (int i = 0 ; i < scene()->views().count() ; ++i) { for (int i = 0 ; i < scene()->views().count() ; ++i) {
if (scene()->views().at(i) == fw) if (scene()->views().at(i) == fw) {
if (QInputContext *inputContext = fw->inputContext()) if (QInputContext *inputContext = fw->inputContext()) {
inputContext->update(); inputContext->update();
#ifndef QT_NO_ACCESSIBILITY
// ##### is this correct
if (toGraphicsObject())
QAccessible::updateAccessibility(toGraphicsObject(), 0, QAccessible::StateChanged);
#endif
break;
}
}
} }
} }
#ifndef QT_NO_ACCESSIBILITY
// ##### is this correct
QAccessible::updateAccessibility(fw, 0, QAccessible::StateChanged);
#endif
} }
#endif #endif
} }