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
8
43
45{
48public:
50
51 void registerTypes(const char *uri) override
52 {
53 Q_ASSERT(uri == QStringLiteral("QtWayland.Client.TextureSharing"));
54 qmlRegisterModule(uri, 1, 0);
55 }
56
57 void initializeEngine(QQmlEngine *engine, const char *uri) override
58 {
59 Q_UNUSED(uri);
60 engine->addImageProvider("wlshared", new SharedTextureProvider);
61 }
62};
63
65
66#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 an image provider which utilizes shared GPU memory.
Definition plugin.cpp:45
QWaylandTextureSharingPlugin(QObject *parent=nullptr)
Definition plugin.cpp:49
void initializeEngine(QQmlEngine *engine, const char *uri) override
Initializes the extension from the uri using the engine.
Definition plugin.cpp:57
void registerTypes(const char *uri) override
Registers the QML types in the given uri.
Definition plugin.cpp:51
Combined button and popup list for selecting options.
void qmlRegisterModule(const char *uri, int versionMajor, int versionMinor)
Definition qqml.cpp:245
#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]