Android: use non index for loop syntax

Task-number: QTBUG-118077
Change-Id: Ifd09d0a2aeeee4e7dcb0c80391ba0e3c08f0fe13
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
This commit is contained in:
Assam Boudjelthia 2023-11-11 03:04:33 +02:00
parent 4162a46378
commit fdc2036640

View File

@ -332,9 +332,9 @@ public class QtAccessibilityDelegate extends View.AccessibilityDelegate
Log.i(TAG, " desc: " + QtNativeAccessibility.descriptionForAccessibleObject(parentId) + " rect: " + QtNativeAccessibility.screenRect(parentId));
Log.i(TAG, " NODE: " + getNodeForVirtualViewId(parentId));
int[] ids = QtNativeAccessibility.childIdListForAccessibleObject(parentId);
for (int i = 0; i < ids.length; ++i) {
Log.i(TAG, parentId + " has child: " + ids[i]);
dumpNodes(ids[i]);
for (int id : ids) {
Log.i(TAG, parentId + " has child: " + id);
dumpNodes(id);
}
}
@ -376,8 +376,8 @@ public class QtAccessibilityDelegate extends View.AccessibilityDelegate
if (m_activityDelegate.getSurfaceCount() != 0) {
int[] ids = QtNativeAccessibility.childIdListForAccessibleObject(-1);
for (int i = 0; i < ids.length; ++i)
result.addChild(m_view, ids[i]);
for (int id : ids)
result.addChild(m_view, id);
}
// The offset values have changed, so we need to re-focus the
@ -439,8 +439,8 @@ public class QtAccessibilityDelegate extends View.AccessibilityDelegate
}
int[] ids = QtNativeAccessibility.childIdListForAccessibleObject(virtualViewId);
for (int i = 0; i < ids.length; ++i)
node.addChild(m_view, ids[i]);
for (int id : ids)
node.addChild(m_view, id);
if (node.isScrollable()) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
node.setCollectionInfo(new CollectionInfo(ids.length, 1, false));