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
qwaylandcompositorxdgshellplugin.cpp
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#include <QtQml/qqmlextensionplugin.h>
5#include <QtQml/qqml.h>
6
7#include <QtWaylandCompositor/QWaylandQuickExtension>
8#include <QtWaylandCompositor/QWaylandXdgShell>
9#include <QtWaylandCompositor/QWaylandXdgDecorationManagerV1>
10#include <QtWaylandCompositor/QWaylandQuickXdgOutputV1>
11
13
17
18
38{
41public:
42 void registerTypes(const char *uri) override
43 {
44 Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWayland.Compositor.XdgShell"));
45 defineModule(uri);
46 }
47
48 static void defineModule(const char *uri)
49 {
50 qmlRegisterModule(uri, QT_VERSION_MAJOR, QT_VERSION_MINOR);
51
52 qmlRegisterType<QWaylandXdgShellQuickExtension>(uri, 1, 3, "XdgShell");
53 qmlRegisterType<QWaylandXdgSurface>(uri, 1, 3, "XdgSurface");
54 qmlRegisterUncreatableType<QWaylandXdgToplevel>(uri, 1, 3, "XdgToplevel", QObject::tr("Cannot create instance of XdgShellToplevel"));
55 qmlRegisterUncreatableType<QWaylandXdgPopup>(uri, 1, 3, "XdgPopup", QObject::tr("Cannot create instance of XdgShellPopup"));
56
57 qmlRegisterType<QWaylandXdgDecorationManagerV1QuickExtension>(uri, 1, 3, "XdgDecorationManagerV1");
58 qmlRegisterType<QWaylandXdgOutputManagerV1QuickExtension>(uri, 1, 14, "XdgOutputManagerV1");
59 qmlRegisterType<QWaylandQuickXdgOutputV1>(uri, 1, 14, "XdgOutputV1");
60 }
61};
62
64
65#include "qwaylandcompositorxdgshellplugin.moc"
The QQmlExtensionPlugin class provides an abstract base for custom QML extension plugins with custom ...
\qmlmodule QtWayland.Compositor.XdgShell \title Qt Wayland XdgShell Extension
void registerTypes(const char *uri) override
Registers the QML types in the given uri.
\inmodule QtWaylandCompositor
\qmltype XdgOutputManagerV1 \instantiates QWaylandXdgOutputManagerV1 \inqmlmodule QtWayland....
\qmltype XdgShell \instantiates QWaylandXdgShell \inqmlmodule QtWayland.Compositor....
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
QLatin1StringView QLatin1String
Definition qstringfwd.h:31
#define Q_OBJECT
#define Q_PLUGIN_METADATA(x)
#define Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(className)