diff options
| author | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-06-01 11:43:29 +0200 |
|---|---|---|
| committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-06-07 14:17:46 +0200 |
| commit | f6f7d22c6cb6a6e3b4ab280fc1b2ed534bbbde09 (patch) | |
| tree | 7ac4ad3ac0ad98172965abb592cf2961a4aaf092 /src/testlib/doc/snippets/code | |
| parent | cafdb8d3ee1195b8ace5556e52bb992d95d788ab (diff) | |
QMetaType: Avoid instantiating QMetaType in Q_DECLARE_METATYPE
Having a call to QMetaType::fromType in struct QMetaTypeId causes issues
if Q_DECLARE_TYPEINFO is used later, as it will already cause an
instantiation of QTypeInfo. Instead, use QtPrivate::typenameHelper to
obtain the name. We cannot use QMetaTypeForType::getName, as that would
cause similarissues with QMetaTypeId2. However, QMetaTypeId2 is only
used for builtin metatypes, which do not use Q_DECLARE_METATYPE. And
even if a user would use Q_DECLARE_METATYPE with them, the worst that
happens is a superfluous type normalization.
Fixes: QTBUG-94124
Change-Id: Ie4a993411214fd009a604de44306131c647095eb
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/testlib/doc/snippets/code')
0 files changed, 0 insertions, 0 deletions
