Fix off by one in updateAccessibility.
Now that indexOfChild is 0-based, the update notifications should follow. Change-Id: I5e0303516d503d5e23061df5894b2428c00da2ce Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
This commit is contained in:
parent
53bbea2328
commit
1c438f1048
@ -844,14 +844,12 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accChild(VARIANT varChildID, I
|
||||
QPair<QObject*, int> ref = qAccessibleRecentSentEvents()->value(entry);
|
||||
if (ref.first) {
|
||||
acc = QAccessible::queryAccessibleInterface(ref.first);
|
||||
if (acc && ref.second) {
|
||||
if (ref.second) {
|
||||
QAccessibleInterface *res = acc->child(ref.second - 1);
|
||||
delete acc;
|
||||
if (!res)
|
||||
return E_INVALIDARG;
|
||||
acc = res;
|
||||
}
|
||||
if (acc && ref.second >= 0) {
|
||||
QAccessibleInterface *res = acc->child(ref.second);
|
||||
delete acc;
|
||||
if (!res)
|
||||
return E_INVALIDARG;
|
||||
acc = res;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -1075,7 +1075,7 @@ void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e
|
||||
if (action_e == QAction::Hover) {
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
if (QAccessible::isActive()) {
|
||||
int actionIndex = indexOf(action) + 1;
|
||||
int actionIndex = indexOf(action);
|
||||
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, q, actionIndex));
|
||||
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Selection, q, actionIndex));
|
||||
}
|
||||
|
@ -531,7 +531,6 @@ void QMenuBarPrivate::_q_actionHovered()
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
if (QAccessible::isActive()) {
|
||||
int actionIndex = actions.indexOf(action);
|
||||
++actionIndex;
|
||||
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, q, actionIndex));
|
||||
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Selection, q, actionIndex));
|
||||
}
|
||||
|
@ -1183,8 +1183,8 @@ void QTabBar::setCurrentIndex(int index)
|
||||
d->layoutTab(index);
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
if (QAccessible::isActive()) {
|
||||
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, this, index + 1));
|
||||
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Selection, this, index + 1));
|
||||
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, this, index));
|
||||
QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Selection, this, index));
|
||||
}
|
||||
#endif
|
||||
emit currentChanged(index);
|
||||
|
Loading…
Reference in New Issue
Block a user