QSignalSpy: fix indexed loop (int instead of qsizetype)

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<int>.

Pick-to: 6.6 6.5
Change-Id: I2ed33238c2cd9d2d1c39cd29c988a2adfd821897
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit a90c3cc3c7ed24c83b9ffa4020cb3652678b36bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2024-03-19 08:00:27 +01:00 committed by Qt Cherry-pick Bot
parent beabcc5436
commit 2ec659b175

View File

@ -193,7 +193,7 @@ private:
QMutexLocker locker(&m_mutex);
QList<QVariant> 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<QMetaType::Type>(args.at(i));
if (type == QMetaType::QVariant)
list << *reinterpret_cast<QVariant *>(a[i + 1]);