From 9ebba7c3a74a42a9c765113c26c986c1497bfac1 Mon Sep 17 00:00:00 2001 From: Pier Luigi Fiorini Date: Thu, 29 Dec 2016 12:03:04 +0100 Subject: Macro for QML items with data property boilerplate This macro gives items the ability to hold children. Use the new macro on various types to let compositors declare children from QML. Change-Id: I291cc69fc11653bc3d677d148e002330a3245173 Reviewed-by: Paul Olav Tvete --- .../compositor/qwaylandquickcompositorplugin.cpp | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src/imports/compositor/qwaylandquickcompositorplugin.cpp') diff --git a/src/imports/compositor/qwaylandquickcompositorplugin.cpp b/src/imports/compositor/qwaylandquickcompositorplugin.cpp index e877f6927..9f3bf5d43 100644 --- a/src/imports/compositor/qwaylandquickcompositorplugin.cpp +++ b/src/imports/compositor/qwaylandquickcompositorplugin.cpp @@ -72,11 +72,19 @@ QT_BEGIN_NAMESPACE Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CONTAINER_CLASS(QWaylandQuickCompositor) +Q_COMPOSITOR_DECLARE_QUICK_PARENT_CLASS(QWaylandQuickOutput) +Q_COMPOSITOR_DECLARE_QUICK_PARENT_CLASS(QWaylandQuickSurface) +Q_COMPOSITOR_DECLARE_QUICK_PARENT_CLASS(QWaylandKeymap) Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandQtWindowManager) Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandIviApplication) +Q_COMPOSITOR_DECLARE_QUICK_PARENT_CLASS(QWaylandIviSurface) Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandWlShell) +Q_COMPOSITOR_DECLARE_QUICK_PARENT_CLASS(QWaylandWlShellSurface) Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandXdgShellV5) +Q_COMPOSITOR_DECLARE_QUICK_PARENT_CLASS(QWaylandXdgSurfaceV5) +Q_COMPOSITOR_DECLARE_QUICK_PARENT_CLASS(QWaylandXdgPopupV5) Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandXdgShellV6) +Q_COMPOSITOR_DECLARE_QUICK_PARENT_CLASS(QWaylandXdgSurfaceV6) Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(QWaylandTextInputManager) class QmlUrlResolver @@ -128,9 +136,9 @@ public: qmlRegisterType(uri, 1, 0, "WaylandQuickItem"); qmlRegisterType(uri, 1, 2, "WaylandHardwareLayer"); qmlRegisterType(uri, 1, 0, "WaylandMouseTracker"); - qmlRegisterType(uri, 1, 0, "WaylandOutput"); - qmlRegisterType(uri, 1, 0, "WaylandSurface"); - qmlRegisterType(uri, 1, 0, "WaylandKeymap"); + qmlRegisterType(uri, 1, 0, "WaylandOutput"); + qmlRegisterType(uri, 1, 0, "WaylandSurface"); + qmlRegisterType(uri, 1, 0, "WaylandKeymap"); qmlRegisterUncreatableType(uri, 1, 0, "WaylandExtension", QObject::tr("Cannot create instance of WaylandExtension")); qmlRegisterUncreatableType(uri, 1, 0, "WaylandClient", QObject::tr("Cannot create instance of WaylandClient")); @@ -148,18 +156,18 @@ public: //This should probably be somewhere else qmlRegisterType(uri, 1, 0, "QtWindowManager"); qmlRegisterType(uri, 1, 0, "IviApplication"); - qmlRegisterType(uri, 1, 0, "IviSurface"); + qmlRegisterType(uri, 1, 0, "IviSurface"); qmlRegisterType(uri, 1, 0, "WlShell"); - qmlRegisterType(uri, 1, 0, "WlShellSurface"); + qmlRegisterType(uri, 1, 0, "WlShellSurface"); qmlRegisterType(uri, 1, 0, "ShellSurfaceItem"); qmlRegisterUncreatableType(uri, 1, 0, "XdgShellV5Base", QObject::tr("Cannot create instance of XdgShellV5Base")); qmlRegisterType(uri, 1, 0, "XdgShellV5"); - qmlRegisterType(uri, 1, 0, "XdgSurfaceV5"); - qmlRegisterType(uri, 1, 0, "XdgPopupV5"); + qmlRegisterType(uri, 1, 0, "XdgSurfaceV5"); + qmlRegisterType(uri, 1, 0, "XdgPopupV5"); qmlRegisterType(uri, 1, 0, "TextInputManager"); qmlRegisterType(uri, 1, 1, "XdgShellV6"); - qmlRegisterType(uri, 1, 1, "XdgSurfaceV6"); + qmlRegisterType(uri, 1, 1, "XdgSurfaceV6"); qmlRegisterUncreatableType(uri, 1, 1, "XdgToplevelV6", QObject::tr("Cannot create instance of XdgShellToplevelV6")); qmlRegisterUncreatableType(uri, 1, 1, "XdgPopupV6", QObject::tr("Cannot create instance of XdgShellPopupV6")); } -- cgit v1.2.3