Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.0, 6.1, 6.2
-
None
-
33a2bd9ca9ee3dc05e5f7cb48aa8f1d55f5368b2 (qt/qtbase/dev)
Description
Q_DECLARE_METATYPE still expands to a struct containing a qt_metatype_id function. That one is called as the legacy register operation the first time we're trying to access the id of the metatype.
qt_metatype_id will in turn normalize the name it was provided with, and afterwards call qRegisterNormalizedMetatype. This is arguably still necessary to support the case where the user provided name does not match the "real" name due to namespaces. In most cases, the normalized name however does equal the type name, and in those cases we register the type as a typedef of itself (via QMetaType::registerNormalizedType).
As type normalization is a rather costly operation, and registering those typedefs is wasteful, we should skip that work.
Attachments
For Gerrit Dashboard: QTBUG-93841 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
349964,2 | QML_DECLARE_TYPE: Do register type with normalized name | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
349981,5 | Q_DECLARE_METATYPE: Do not re-register types | dev | qt/qtbase | Status: MERGED | +2 | 0 |