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
Attachments
For Gerrit Dashboard: QTBUG-39462 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
111866,5 | Ensure that the resource is loaded when using static imports | 5.4 | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
111870,1 | Ensure that the resources are loaded when the imports are static | 5.4 | qt/qtquickcontrols | Status: ABANDONED | 0 | 0 |