summaryrefslogtreecommitdiff
path: root/src/compositor/compositor_api/qwaylandkeymap.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/compositor_api/qwaylandkeymap.h
parent9875a14daaec12ca65d3cb4a2aaf2c4582e6191d (diff)
downloadqtwayland-ec01fddd6b14fa26d9ae9e9f693c6fd419f5ba2c.tar.gz
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/compositor_api/qwaylandkeymap.h')
-rw-r--r--src/compositor/compositor_api/qwaylandkeymap.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandkeymap.h b/src/compositor/compositor_api/qwaylandkeymap.h
index d96c409b..8058e144 100644
--- a/src/compositor/compositor_api/qwaylandkeymap.h
+++ b/src/compositor/compositor_api/qwaylandkeymap.h
@@ -42,6 +42,7 @@
#include <QtCore/QObject>
#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
+#include <QtWaylandCompositor/qwaylandquickchildren.h>
QT_BEGIN_NAMESPACE
@@ -51,6 +52,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandKeymap : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QWaylandKeymap)
+ Q_WAYLAND_COMPOSITOR_DECLARE_QUICK_CHILDREN(QWaylandKeymap)
Q_PROPERTY(QString layout READ layout WRITE setLayout NOTIFY layoutChanged)
Q_PROPERTY(QString variant READ variant WRITE setVariant NOTIFY variantChanged)
Q_PROPERTY(QString options READ options WRITE setOptions NOTIFY optionsChanged)