diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-09-25 08:25:35 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2020-10-09 11:05:56 +0200 |
commit | 3ef7a9c34782fbc4e17a4d6448ee8ff1daea32ce (patch) | |
tree | 1ca19cf5ce56a2935b1aa4a96f48e6393e1a61af /src/quickcontrols2 | |
parent | d709f779c77b67f8f6c8ef76f108d0bceb459e6e (diff) |
Fix static build
The register_types() function was optimized away by the linker and the
imports would not be found.
Change-Id: I3d98602daf78996399630b7b1296cc5dc0d3da05
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/quickcontrols2')
-rw-r--r-- | src/quickcontrols2/qquickdummyregistration_p.h | 4 | ||||
-rw-r--r-- | src/quickcontrols2/qtquickcontrols2global.h | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/quickcontrols2/qquickdummyregistration_p.h b/src/quickcontrols2/qquickdummyregistration_p.h index 4d7fe5e4..0d3b34a8 100644 --- a/src/quickcontrols2/qquickdummyregistration_p.h +++ b/src/quickcontrols2/qquickdummyregistration_p.h @@ -49,6 +49,10 @@ // #include <QtQml/qqml.h> +// Ensure that the generated qmltyperegistrations .cpp file includes this header +// by including it here. Otherwise, the qtquickcontrols2plugin will fail to load +// due to the type registration function's symbol being undefined. +#include <QtQuickControls2/qtquickcontrols2global.h> QT_BEGIN_NAMESPACE diff --git a/src/quickcontrols2/qtquickcontrols2global.h b/src/quickcontrols2/qtquickcontrols2global.h index 813cdbbb..e5f050ce 100644 --- a/src/quickcontrols2/qtquickcontrols2global.h +++ b/src/quickcontrols2/qtquickcontrols2global.h @@ -53,4 +53,6 @@ QT_BEGIN_NAMESPACE QT_END_NAMESPACE +Q_QUICKCONTROLS2_EXPORT void qml_register_types_QtQuick_Controls(); + #endif // QTQUICKCONTROLS2GLOBAL_H |