if (useAlternateBackgrounds()) {
updateAlternateBackgrounds();
}
-#ifndef QT_NO_ACCESSIBILITY
- if (QAccessible::isActive()) { // Announce that the count of items has changed.
- static_cast<KItemListViewAccessible *>(QAccessible::queryAccessibleInterface(this))->announceDescriptionChange();
- }
-#endif
}
void KItemListView::slotItemsRemoved(const KItemRangeList &itemRanges)
if (useAlternateBackgrounds()) {
updateAlternateBackgrounds();
}
-#ifndef QT_NO_ACCESSIBILITY
- if (QAccessible::isActive()) { // Announce that the count of items has changed.
- static_cast<KItemListViewAccessible *>(QAccessible::queryAccessibleInterface(this))->announceDescriptionChange();
- }
-#endif
}
void KItemListView::slotItemsMoved(const KItemRange &itemRange, const QList<int> &movedToIndexes)
updateVisibleGroupHeaders();
doLayout(NoAnimation);
}
-
-#ifndef QT_NO_ACCESSIBILITY
- QAccessibleTableModelChangeEvent ev(this, QAccessibleTableModelChangeEvent::DataChanged);
- ev.setFirstRow(itemRange.index);
- ev.setLastRow(itemRange.index + itemRange.count);
- QAccessible::updateAccessibility(&ev);
-#endif
}
-
doLayout(NoAnimation);
}
KItemListWidget *currentWidget = m_visibleItems.value(current, nullptr);
if (currentWidget) {
currentWidget->setCurrent(true);
- if (hasFocus() || (previousWidget && previousWidget->hasFocus())) {
- currentWidget->setFocus(); // Mostly for accessibility, because keyboard events are handled correctly either way.
- }
}
}
#ifndef QT_NO_ACCESSIBILITY
- if (QAccessible::isActive()) {
- if (current >= 0) {
- QAccessibleEvent accessibleFocusCurrentItemEvent(this, QAccessible::Focus);
- accessibleFocusCurrentItemEvent.setChild(current);
- QAccessible::updateAccessibility(&accessibleFocusCurrentItemEvent);
- }
- static_cast<KItemListViewAccessible *>(QAccessible::queryAccessibleInterface(this))->announceDescriptionChange();
+ if (current != previous && QAccessible::isActive()) {
+ static_cast<KItemListViewAccessible *>(QAccessible::queryAccessibleInterface(this))->announceCurrentItem();
}
#endif
}
// Let the screen reader announce "selected" or "not selected" for the active item.
const bool wasSelected(previous.contains(index));
if (isSelected != wasSelected) {
- QAccessibleEvent accessibleSelectionChangedEvent(this, QAccessible::Selection);
+ QAccessibleEvent accessibleSelectionChangedEvent(this, QAccessible::SelectionAdd);
accessibleSelectionChangedEvent.setChild(index);
QAccessible::updateAccessibility(&accessibleSelectionChangedEvent);
}
}
- // Usually the below does not have an effect because the view will not have focus at this moment but one of its list items. Still we announce the
- // change of the accessibility description just in case the user manually moved focus up by one.
- static_cast<KItemListViewAccessible *>(QAccessible::queryAccessibleInterface(this))->announceDescriptionChange();
#else
}
Q_UNUSED(previous)