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
plugin.cpp
Go to the documentation of this file.
1// Copyright (C) 2019 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 <QtQml/qqmlextensionplugin.h>
5#include <QtQml/qqmlengine.h>
6
7#include "QtWaylandCompositor/private/qwltexturesharingextension_p.h"
8
54
56{
59public:
61
62 void registerTypes(const char *uri) override
63 {
64 Q_ASSERT(uri == QStringLiteral("QtWayland.Compositor.TextureSharingExtension"));
65 qmlRegisterType<QWaylandTextureSharingExtensionQuickExtension>("QtWayland.Compositor.TextureSharingExtension", 1, 0, "TextureSharingExtension");
66 }
67
68 void initializeEngine(QQmlEngine *engine, const char *uri) override
69 {
70 Q_UNUSED(uri);
71 engine->addImageProvider("wlshared", new QWaylandSharedTextureProvider);
72 }
73};
74
76
77#include "plugin.moc"
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
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 ...
Adds a mechanism to share GPU memory.
Definition plugin.cpp:56
QWaylandTextureSharingExtensionPlugin(QObject *parent=nullptr)
Definition plugin.cpp:60
void initializeEngine(QQmlEngine *engine, const char *uri) override
Initializes the extension from the uri using the engine.
Definition plugin.cpp:68
void registerTypes(const char *uri) override
Registers the QML types in the given uri.
Definition plugin.cpp:62
Combined button and popup list for selecting options.
#define QQmlExtensionInterface_iid
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
#define QStringLiteral(str)
#define Q_OBJECT
#define Q_PLUGIN_METADATA(x)
#define Q_UNUSED(x)
QJSEngine engine
[0]