From 260294346b60a7abab0a30106dd7c3a2ccc31a6e Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sat, 15 Jan 2022 17:06:38 +0100 Subject: [PATCH] qmetatype: Fix incorrect more than one typedef warning The names are the keys of a hash so they can come in any order. That means the loop above, which stops before the end if it finds a name that is not the official one, may not have seen the official yet. If it has reached the end, then there is no typedef alias. Fixes: QTBUG-99620 Pick-to: 6.2 6.3 Change-Id: I3bd638766c494b32c665190d01db15c4cbc587b5 Reviewed-by: Thiago Macieira Reviewed-by: Marc Mutz --- src/corelib/kernel/qmetatype.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index c380cda0dbd..4828ba0764e 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -207,7 +207,7 @@ const char *QtMetaTypePrivate::typedefNameForType(const QtPrivate::QMetaTypeInte #ifndef QT_NO_DEBUG QByteArrayList otherNames; for ( ; it != end; ++it) { - if (it.value() == type_d) + if (it.value() == type_d && it.key() != officialName) otherNames << it.key(); } if (!otherNames.isEmpty())