diff options
| author | Fabian Kosmale <fabian.kosmale@qt.io> | 2025-02-11 12:18:05 +0100 |
|---|---|---|
| committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2025-02-12 05:36:23 +0100 |
| commit | 6e75f506342202e8bbd1ecb70e940bb4290b29f9 (patch) | |
| tree | 0534a8a344b94f9a3f9a3912c080d43f689802cd /tools | |
| parent | 6e327f28c7cd05d90881998696da4561507d6a50 (diff) | |
qml tool: Explictily register types
We are sporadically seeing weird failures on macOs that the types from
the module are not available. This could not be reproduced reliably, but
we suspect that the linker might discard the (static ctor invoking the)
registration function.
Avoid this by calling it explictily.
Change-Id: Ic405dd5f226af3580efe7dd5d8202a6a263a367e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/qml/main.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index da544c5563..79d75fb940 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -48,6 +48,8 @@ #define FILE_OPEN_EVENT_WAIT_TIME 3000 // ms +extern void qml_register_types_QmlRuntime_Config(); + Q_LOGGING_CATEGORY(lcDeprecated, "qt.tools.qml.deprecated") enum QmlApplicationType { @@ -383,6 +385,9 @@ static void loadDummyDataFiles(QQmlEngine &engine, const QString& directory) int main(int argc, char *argv[]) { getAppFlags(argc, argv); + // We know we need the module in any case, so we might as well call the registration + // function at this point; this might also help with the linker discarding it + qml_register_types_QmlRuntime_Config(); // Must set the default QSurfaceFormat before creating the app object if // AA_ShareOpenGLContexts is going to be set. |
