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.7 6.6 6.5
Change-Id: I2ed33238c2cd9d2d1c39cd29c988a2adfd821897
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
bb10
Marc Mutz 2024-03-19 08:00:27 +01:00
parent eefd8ab1e8
commit a90c3cc3c7
1 changed files with 1 additions and 1 deletions

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]);