From 76ffd8b08c90e953dc9e7a6a6006e6f50396822d Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 19 Mar 2024 08:00:27 +0100 Subject: QSignalSpy: fix indexed loop (int instead of qsizetype) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While a signal with more than 2Gi arguments is only a theoretical possibility, still use the correct index variable for the indexed loop over this QList. Pick-to: 6.5 Change-Id: I2ed33238c2cd9d2d1c39cd29c988a2adfd821897 Reviewed-by: MÃ¥rten Nordheim (cherry picked from commit a90c3cc3c7ed24c83b9ffa4020cb3652678b36bf) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit 2ec659b1758c76502b1914baaeeb01beeaade4e4) --- src/testlib/qsignalspy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/testlib/qsignalspy.h b/src/testlib/qsignalspy.h index 117d485899..a60ae05e18 100644 --- a/src/testlib/qsignalspy.h +++ b/src/testlib/qsignalspy.h @@ -193,7 +193,7 @@ private: QMutexLocker locker(&m_mutex); QList list; list.reserve(args.size()); - for (int i = 0; i < args.size(); ++i) { + for (qsizetype i = 0; i < args.size(); ++i) { const QMetaType::Type type = static_cast(args.at(i)); if (type == QMetaType::QVariant) list << *reinterpret_cast(a[i + 1]); -- cgit v1.2.3