diff options
| author | Ahmad Samir <a.samirh78@gmail.com> | 2025-10-02 18:10:09 +0300 |
|---|---|---|
| committer | Ahmad Samir <a.samirh78@gmail.com> | 2025-10-06 22:12:45 +0300 |
| commit | bd6e3ef2596e6c645f3df49aa514018511d6a9d6 (patch) | |
| tree | 7b394819dc12c606d11265d495588eff891f1932 /src/corelib/kernel/qobject.cpp | |
| parent | 57d507de1c6ff85fab38eee69906cb6709100ec7 (diff) | |
QObject: fix Clang -Wshorten-64-to-32 warnings
Pick-to: 6.10 6.8 6.5
Change-Id: If1bcdc1e99857c8e9b4580d2d49e271eb29238fe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/kernel/qobject.cpp')
| -rw-r--r-- | src/corelib/kernel/qobject.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 41004e6f30e..c530f9ba113 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -1992,7 +1992,7 @@ void QObject::killTimer(Qt::TimerId id) return; } if (id > Qt::TimerId::Invalid) { - int at = d->extraData ? d->extraData->runningTimers.indexOf(id) : -1; + qsizetype at = d->extraData ? d->extraData->runningTimers.indexOf(id) : -1; if (at == -1) { // timer isn't owned by this object qWarning("QObject::killTimer(): Error: timer id %d is not valid for object %p (%s, %ls), timer has not been killed", @@ -2311,7 +2311,7 @@ void QObjectPrivate::setParent_helper(QObject *o) // don't do anything since QObjectPrivate::deleteChildren() already // cleared our entry in parentD->children. } else { - const int index = parentD->children.indexOf(q); + const qsizetype index = parentD->children.indexOf(q); if (index < 0) { // we're probably recursing into setParent() from a ChildRemoved event, don't do anything } else if (parentD->isDeletingChildren) { @@ -3899,7 +3899,7 @@ static QByteArray formatConnectionSignature(const char *className, const QMetaMe { const auto signature = method.methodSignature(); Q_ASSERT(signature.endsWith(')')); - const int openParen = signature.indexOf('('); + const qsizetype openParen = signature.indexOf('('); const bool hasParameters = openParen >= 0 && openParen < signature.size() - 2; QByteArray result; if (hasParameters) { @@ -4021,8 +4021,8 @@ void QMetaObject::connectSlotsByName(QObject *o) ++i; } else if (!(mo->method(i).attributes() & QMetaMethod::Cloned)) { // check if the slot has the following signature: "on_..._...(..." - int iParen = slotSignature.indexOf('('); - int iLastUnderscore = slotSignature.lastIndexOf('_', iParen - 1); + qsizetype iParen = slotSignature.indexOf('('); + qsizetype iLastUnderscore = slotSignature.lastIndexOf('_', iParen - 1); if (iLastUnderscore > 3) qCWarning(lcConnectSlotsByName, "QMetaObject::connectSlotsByName: No matching signal for %s", slot); @@ -4498,7 +4498,7 @@ bool QObject::doSetProperty(const char *name, const QVariant &value, QVariant *r if (id < 0) { d->ensureExtraData(); - const int idx = d->extraData->propertyNames.indexOf(name); + const qsizetype idx = d->extraData->propertyNames.indexOf(name); if (!value.isValid()) { if (idx == -1) @@ -4552,7 +4552,7 @@ QVariant QObject::property(const char *name) const if (id < 0) { if (!d->extraData) return QVariant(); - const int i = d->extraData->propertyNames.indexOf(name); + const qsizetype i = d->extraData->propertyNames.indexOf(name); return d->extraData->propertyValues.value(i); } QMetaProperty p = meta->property(id); |
