From 3ef7a9c34782fbc4e17a4d6448ee8ff1daea32ce Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 25 Sep 2020 08:25:35 +0200 Subject: 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 --- src/quickcontrols2/qquickdummyregistration_p.h | 4 ++++ src/quickcontrols2/qtquickcontrols2global.h | 2 ++ 2 files changed, 6 insertions(+) (limited to 'src/quickcontrols2') 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 +// 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 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 -- cgit v1.2.3