Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qqmlextensionplugin.h
Go to the documentation of this file.
1// Copyright (C) 2016 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#ifndef QQMLEXTENSIONPLUGIN_H
5#define QQMLEXTENSIONPLUGIN_H
6
7#include <QtCore/qplugin.h>
8#include <QtCore/QUrl>
9#include <QtQml/qqmlextensioninterface.h>
10
11#if defined(Q_CC_GHS)
12# define Q_GHS_KEEP_REFERENCE(S) QT_DO_PRAGMA(ghs reference S ##__Fv)
13#else
14# define Q_GHS_KEEP_REFERENCE(S)
15#endif
16
17#define Q_IMPORT_QML_PLUGIN(PLUGIN) \
18 Q_IMPORT_PLUGIN(PLUGIN)
19
21
22class QQmlEngine;
23class QQmlExtensionPluginPrivate;
24
25class Q_QML_EXPORT QQmlExtensionPlugin
26 : public QObject
28{
30 Q_DECLARE_PRIVATE(QQmlExtensionPlugin)
33public:
34 explicit QQmlExtensionPlugin(QObject *parent = nullptr);
36
37#if QT_DEPRECATED_SINCE(6, 3)
38 QT_DEPRECATED_VERSION_X_6_3("Provide a qmldir file to remove the need for calling baseUrl")
39 QUrl baseUrl() const;
40#endif
41
42 void registerTypes(const char *uri) override = 0;
43 virtual void unregisterTypes();
44 void initializeEngine(QQmlEngine *engine, const char *uri) override;
45
46private:
47 Q_DISABLE_COPY(QQmlExtensionPlugin)
48};
49
50class Q_QML_EXPORT QQmlEngineExtensionPlugin
51 : public QObject
53{
55 Q_DISABLE_COPY_MOVE(QQmlEngineExtensionPlugin)
57public:
58 explicit QQmlEngineExtensionPlugin(QObject *parent = nullptr);
60 void initializeEngine(QQmlEngine *engine, const char *uri) override;
61};
62
64
65#endif // QQMLEXTENSIONPLUGIN_H
\inmodule QtCore
Definition qobject.h:103
The QQmlEngineExtensionPlugin class provides an abstract base for custom QML extension plugins.
~QQmlEngineExtensionPlugin() override
The QQmlEngine class provides an environment for instantiating QML components.
Definition qqmlengine.h:57
The QQmlExtensionPlugin class provides an abstract base for custom QML extension plugins with custom ...
~QQmlExtensionPlugin() override
void registerTypes(const char *uri) override=0
Registers the QML types in the given uri.
\inmodule QtCore
Definition qurl.h:94
Combined button and popup list for selecting options.
#define QT_DEPRECATED_VERSION_X_6_3(text)
#define Q_OBJECT
#define Q_INTERFACES(x)
QUrl baseUrl
QJSEngine engine
[0]