1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qqmlmetadependencies_p.h"
5#include <private/qtqmlglobal_p.h>
6#include <QtQml/qqmlextensionplugin.h>
7
8QT_BEGIN_NAMESPACE
9
10// Prevent the linker from removing those dependencies, so that we don't have to load
11// them from plugins.
12
13void qml_register_types_QtQml_Models();
14Q_GHS_KEEP_REFERENCE(qml_register_types_QtQml_Models);
15#if QT_CONFIG(qml_worker_script)
16void qml_register_types_QtQml_WorkerScript();
17Q_GHS_KEEP_REFERENCE(qml_register_types_QtQml_WorkerScript);
18#endif
19
20bool QQmlMetaDependencies::collect() {
21 volatile auto models = &qml_register_types_QtQml_Models;
22#if QT_CONFIG(qml_worker_script)
23 volatile auto workerScript = &qml_register_types_QtQml_WorkerScript;
24 return models && workerScript;
25#else
26 return models;
27#endif
28}
29
30QT_END_NAMESPACE
31

Provided by KDAB

Privacy Policy
Learn Advanced QML with KDAB
Find out more

source code of qtdeclarative/src/qmlmeta/types/qqmlmetadependencies.cpp