Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
None
-
5.3.0, 5.4.0 RC
Description
when trying to use qml plugins in a statically linked application, i figured that i need to registerTypes/initializeEngine explicitly on osx when not using namespaces.
as a workaround, i currently have the following code in my application:
#if defined(QT_STATIC) && !defined(Q_OS_MAC) && !defined(QT_NAMESPACE) qobject_cast<QQmlExtensionPlugin*>(qt_static_plugin_QtQuick2Plugin().instance()) ->registerTypes("QtQuick"); qobject_cast<QQmlExtensionPlugin*>(qt_static_plugin_QtQuickControlsPlugin().instance())->registerTypes("QtQuick.Controls"); qobject_cast<QQmlExtensionPlugin*>(qt_static_plugin_QtQuickControlsPlugin().instance())->registerTypes("QtQuick.Controls.Private"); qobject_cast<QQmlExtensionPlugin*>(qt_static_plugin_QtQuickControlsPlugin().instance())->registerTypes("QtQuick.Controls.Styles"); qobject_cast<QQmlExtensionPlugin*>(qt_static_plugin_QtQuickLayoutsPlugin().instance()) ->registerTypes("QtQuick.Layouts"); [...] qobject_cast<QQmlExtensionPlugin*>(qt_static_plugin_QtQuick2Plugin().instance()) ->initializeEngine(engine, "QtQuick"); qobject_cast<QQmlExtensionPlugin*>(qt_static_plugin_QtQuickControlsPlugin().instance())->initializeEngine(engine, "QtQuick.Controls"); qobject_cast<QQmlExtensionPlugin*>(qt_static_plugin_QtQuickLayoutsPlugin().instance()) ->initializeEngine(engine, "QtQuick.Layouts"); #endif
would be great if it could be fixed so that Q_IMPORT_PLUGIN is enough on all platforms/namespace configurations