diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-08-07 14:19:23 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-08-07 23:56:10 +0200 |
commit | 081670b8400b2e02b0ecb6e85da7868c9893a1df (patch) | |
tree | 91d4a9246f184c9918835ffebef12f37ebfdda78 | |
parent | ddcf716762e5100f56e23b4171f225ed1a97709c (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.cpp | 2 |
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); } |