summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-08-07 14:19:23 +0200
committerMarc Mutz <marc.mutz@qt.io>2023-08-07 23:56:10 +0200
commit081670b8400b2e02b0ecb6e85da7868c9893a1df (patch)
tree91d4a9246f184c9918835ffebef12f37ebfdda78
parentddcf716762e5100f56e23b4171f225ed1a97709c (diff)
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 <fabian.kosmale@qt.io>
-rw-r--r--tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp b/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp
index 87e0290473..01148d80a8 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);
}