Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
Description
Prototype following idea for new static_qml_type_registration config feature:
QtQuickTemplates2Plugin::QtQuickTemplates2Plugin(QObject *parent)
: QQmlExtensionPlugin(parent)Unknown macro: { #if !QT_CONFIG(static_qml_type_registration) volatile auto registration = &qml_register_types_QtQuick_Templates; #endif volatile auto initialization = &QQuickTemplates_initializeModule; Q_UNUSED(registration) Q_UNUSED(initialization) }
New function into plugin
template <typedef T>
registerPluginQmlType()
{
if ( validId != qMetaTypeId<T>())
Unknown macro: { qmlRegisterTypesAndRevisions<T>("plugin", version); }}
Then in each generated qmlcache file would do following for each used type. This is done during binary load - before aotBuiltFunctions is initialized.
#if QT_CONFIG(jit_qml_type_registration)
registerPluginQmlType<UsedType>()
#endif
This would save around 5KB per type (Atleast with qmlRegisterTypesAndRevisions<QQuickDelayButton>("QtQuick.Templates", 6)
Attachments
Issue Links
- mentioned in
-
Page Loading...