Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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// Qt-Security score:significant reason:default
4
5#include <QtQml/qqmlextensionplugin.h>
6#include <QtQml/qqmlengine.h>
7
9
10/*!
11 \internal
12 \qmlmodule QtWayland.Client.TextureSharing 1
13 \title Qt Wayland Shared Texture Provider
14 \ingroup qmlmodules
15 \brief Adds an image provider which utilizes shared GPU memory
16
17 \section2 Summary
18
19 This module allows Qt Wayland clients to use graphical resources exported
20 by the compositor, without allocating any graphics memory in the client.
21
22 \note The texture sharing functionality is considered experimental and
23 currently unsupported in Qt 6.
24
25 \section2 Usage
26
27 To use this module, import it like this:
28 \code
29 import QtWayland.Client.TextureSharing 1.0
30 \endcode
31
32 The sharing functionality is provided through a QQuickImageProvider. Use
33 the "image:" scheme for the URL source of the image, followed by the
34 identifier \e wlshared, followed by the image file path. For example:
35
36 \code
37 Image { source: "image://wlshared/wallpapers/mybackground.jpg" }
38 \endcode
39
40 The shared texture module does not provide any directly usable QML types.
41*/
42
44
46{
47 Q_OBJECT
48 Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
49public:
51
52 void registerTypes(const char *uri) override
53 {
54 Q_ASSERT(uri == QStringLiteral("QtWayland.Client.TextureSharing"));
55 }
56
58 {
61 }
62};
63
64QT_END_NAMESPACE
65
66#include "plugin.moc"
Adds an image provider which utilizes shared GPU memory.
Definition plugin.cpp:46
Combined button and popup list for selecting options.