summaryrefslogtreecommitdiff
path: root/src/compositor/extensions
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-07-08 14:28:54 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-08-20 09:57:06 +0200
commitf3d40b02558f5eca54ddb33b132d350b958cac1e (patch)
treeca6fdbdd8525b75810feaccf62aa0d1c1de05002 /src/compositor/extensions
parenteca2eb2c19fdbb4ed5003d636d935fbf83968d70 (diff)
downloadqtwayland-f3d40b02558f5eca54ddb33b132d350b958cac1e.tar.gz
Port QtWayland.Compositor to new QML extension API
In order to add new properties and types in Qt 6, we need to port everything over to the new extension API in QML. This is generally more type safe and needs less manual maintenance, but there is some work involved in porting. The previous version exposed some types from the QtWaylandCompositor C++ library, extended a few of them with Qt Quick-specific subclass, added one additional C++-implemented type (QWaylandMouseTracker) and two additional QML-implemented types. We need all types to be defined in the same place for the automatic generation of plugins.qmltypes to work. Therefore all the additional types are moved from the plugin into the library, but still not exposed through public API. The plugin still exposes the types, so for the user this change will be transparent. Fixes: QTBUG-85512 Change-Id: I46e9e80424c9299c3eaee92773d233b1ec29cf2c Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/compositor/extensions')
-rw-r--r--src/compositor/extensions/qwaylandquickshellsurfaceitem.h2
-rw-r--r--src/compositor/extensions/qwaylandshell.h4
-rw-r--r--src/compositor/extensions/qwaylandshellsurface.h3
3 files changed, 9 insertions, 0 deletions
diff --git a/src/compositor/extensions/qwaylandquickshellsurfaceitem.h b/src/compositor/extensions/qwaylandquickshellsurfaceitem.h
index 38af5645..9307909e 100644
--- a/src/compositor/extensions/qwaylandquickshellsurfaceitem.h
+++ b/src/compositor/extensions/qwaylandquickshellsurfaceitem.h
@@ -46,6 +46,8 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandQuickShellSurfaceItem : public QWaylan
Q_PROPERTY(QQuickItem *moveItem READ moveItem WRITE setMoveItem NOTIFY moveItemChanged)
Q_PROPERTY(bool autoCreatePopupItems READ autoCreatePopupItems WRITE setAutoCreatePopupItems NOTIFY autoCreatePopupItemsChanged)
Q_MOC_INCLUDE("qwaylandshellsurface.h")
+ QML_NAMED_ELEMENT(ShellSurfaceItem)
+ QML_ADDED_IN_VERSION(1, 0)
public:
QWaylandQuickShellSurfaceItem(QQuickItem *parent = nullptr);
~QWaylandQuickShellSurfaceItem() override;
diff --git a/src/compositor/extensions/qwaylandshell.h b/src/compositor/extensions/qwaylandshell.h
index bb7c73c1..739fd8f2 100644
--- a/src/compositor/extensions/qwaylandshell.h
+++ b/src/compositor/extensions/qwaylandshell.h
@@ -41,6 +41,10 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandShell : public QWaylandCompositorExten
Q_OBJECT
Q_DECLARE_PRIVATE(QWaylandShell)
Q_PROPERTY(FocusPolicy focusPolicy READ focusPolicy WRITE setFocusPolicy NOTIFY focusPolicyChanged)
+
+ QML_NAMED_ELEMENT(Shell)
+ QML_UNCREATABLE("")
+ QML_ADDED_IN_VERSION(1, 0)
public:
enum FocusPolicy {
AutomaticFocus,
diff --git a/src/compositor/extensions/qwaylandshellsurface.h b/src/compositor/extensions/qwaylandshellsurface.h
index bcc93122..67450e54 100644
--- a/src/compositor/extensions/qwaylandshellsurface.h
+++ b/src/compositor/extensions/qwaylandshellsurface.h
@@ -43,6 +43,9 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandShellSurface : public QWaylandComposit
{
Q_OBJECT
Q_PROPERTY(Qt::WindowType windowType READ windowType NOTIFY windowTypeChanged)
+ QML_NAMED_ELEMENT(ShellSurface)
+ QML_UNCREATABLE("")
+ QML_ADDED_IN_VERSION(1, 0)
public:
#if QT_CONFIG(wayland_compositor_quick)
virtual QWaylandQuickShellIntegration *createIntegration(QWaylandQuickShellSurfaceItem *item) = 0;