summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-05-19 08:42:20 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2021-06-08 15:37:38 +0200
commitf6fa4b39ee32ba4a5c6a3db5581dd50b3afc7a47 (patch)
treec4e6adb7448b84240daa521a15f77d69ec9cd969 /src/corelib
parentc76a2d7c9cfc5e2edd45a30681df51b37125bc01 (diff)
QMetaType: Don't normalize name which should already be normalized
The name stored in a QMetaTypeInterface should already be normalized, as a static metatype uses typenameHelper, which takes care of normalization via QTypeNormalizer. For dynamic metatypes, we don't have that guarantee, but those can only be created by Qt, as there is no public API for it. We can thus ensure that we only create normalized typenames (which we currently do anyway), and skip the normalization in registerCustomType. Change-Id: I18728031825cd39fdbe17cad0fbc6e3b5fd03c93 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qmetatype.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 65745bf06a..e8c631f2d1 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -120,11 +120,10 @@ struct QMetaTypeCustomRegistry
QWriteLocker l(&lock);
if (ti->typeId)
return ti->typeId;
- QByteArray name =
+ QByteArray name = ti->name;
#ifndef QT_NO_QOBJECT
- QMetaObject::normalizedType
+ Q_ASSERT(name == QMetaObject::normalizedType(ti->name));
#endif
- (ti->name);
if (auto ti2 = aliases.value(name)) {
ti->typeId.storeRelaxed(ti2->typeId.loadRelaxed());
return ti2->typeId;