From 081670b8400b2e02b0ecb6e85da7868c9893a1df Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 7 Aug 2023 14:19:23 +0200 Subject: [PATCH] tst_QGestureRecognizer: port away from Q_FOREACH The single use of Q_FOREACH in this test is safe to port 1:1 to a ranged for-loop, since we're in a constructor, and the loop body only calls member functions of data members (incl. the base class), so we cannot possibly modify the container passed in as a constructor argument: any connections or event processing that could re-enter our caller hasn't been set up, yet. Task-number: QTBUG-115803 Change-Id: I7095aef1edddbda0d1b0c471192b18acd6fd1793 Reviewed-by: Fabian Kosmale --- .../kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp b/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp index 87e02904732..01148d80a8e 100644 --- a/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp +++ b/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp @@ -71,7 +71,7 @@ TestWidget::TestWidget(const GestureTypeVector &gestureTypes) { setAttribute(Qt::WA_AcceptTouchEvents); - foreach (Qt::GestureType gestureType, gestureTypes) { + for (Qt::GestureType gestureType : gestureTypes) { grabGesture(gestureType); m_receivedGestures.insert(gestureType, false); }