summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-08-08 10:59:36 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-08-09 21:57:45 +0000
commitb1d28854f2e05dedb7f82ddfa8a4010d0b879956 (patch)
tree70741df3229328a4cd39777a5b42c0e145bb4749
parent5d9c7c9e3571a39609fca82a5d61f5cdcaec6594 (diff)
tst_QAccessibilityLinux: port away from Q_FOREACH
The single Q_FOREACH use here is simple, as it's over a local variable that just isn't marked as const due to the way it's constructed, and the loop body clearly doesn't modify the container, so the protective copy that Q_FOREACH performs is not needed. But std::as_const() is, to prevent a detach() (attempt). Add that. Task-number: QTBUG-115839 Change-Id: If228f649efd87388f6e312078b24a5b46ac8dc36 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit 5a8464b1f8fc88a47697012590dd4a8bb2201a61) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp b/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp
index d07258417f..6a537b5825 100644
--- a/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp
+++ b/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp
@@ -103,7 +103,7 @@ QStringList tst_QAccessibilityLinux::getChildren(QDBusInterface *interface)
Q_ASSERT(interface->property("ChildCount").toInt() == list.count());
QStringList children;
- Q_FOREACH (const QSpiObjectReference &ref, list)
+ for (const QSpiObjectReference &ref : std::as_const(list))
children << ref.path.path();
return children;