summaryrefslogtreecommitdiffstats
path: root/src/compositor/extensions/qwaylandwlshell.h
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-08-21 16:31:38 +0200
committerJohan Helsing <johan.helsing@qt.io>2018-08-29 06:36:17 +0000
commitec01fddd6b14fa26d9ae9e9f693c6fd419f5ba2c (patch)
treea0c8a3a76f61df7e24c29cdc6e7686eaa884f553 /src/compositor/extensions/qwaylandwlshell.h
parent9875a14daaec12ca65d3cb4a2aaf2c4582e6191d (diff)
Fix incompatibility between QML and C++ instantiated objects
This fixes a source incompatibility introduced in 9ebba7c3a. In Qt 5.11 it was possible to have the following code: XdgShellV6 { property XdgToplevelV6 top onToplevelCreated: top = toplevel } After, 9ebba7c3a, however, this would fail because XdgToplevel refers to QWaylandXdgToplevelV6ParentClass, while QWaylandXdgShellV6::toplevelCreated emits a QWaylandXdgToplevelV6. It would also break instanceof, i.e.: onToplevelCreated: console.log(toplevel instanceof XdgToplevelV6) This patch reverts to C++ and QML using the same type (no subclassing for QML types), but still lets the items have children in QML by putting the macro inside each class instead. Task-number: QTBUG-70090 Change-Id: I8efa8f68ebc4dc2289b4a9b96402b0c00d45547d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/compositor/extensions/qwaylandwlshell.h')
-rw-r--r--src/compositor/extensions/qwaylandwlshell.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compositor/extensions/qwaylandwlshell.h b/src/compositor/extensions/qwaylandwlshell.h
index 4923b4fb0..421888000 100644
--- a/src/compositor/extensions/qwaylandwlshell.h
+++ b/src/compositor/extensions/qwaylandwlshell.h
@@ -44,6 +44,7 @@
#include <QtWaylandCompositor/QWaylandResource>
#include <QtWaylandCompositor/QWaylandShell>
#include <QtWaylandCompositor/QWaylandShellSurface>
+#include <QtWaylandCompositor/qwaylandquickchildren.h>
#include <QtCore/QSize>
@@ -87,6 +88,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandWlShellSurface : public QWaylandShellS
{
Q_OBJECT
Q_DECLARE_PRIVATE(QWaylandWlShellSurface)
+ Q_WAYLAND_COMPOSITOR_DECLARE_QUICK_CHILDREN(QWaylandWlShellSurface)
Q_PROPERTY(QWaylandSurface *surface READ surface NOTIFY surfaceChanged)
Q_PROPERTY(QWaylandWlShell *shell READ shell NOTIFY shellChanged)
Q_PROPERTY(QString title READ title NOTIFY titleChanged)