diff options
author | Jørgen Lind <jorgen.lind@theqtcompany.com> | 2015-01-12 12:57:53 +0100 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@theqtcompany.com> | 2015-08-28 13:09:41 +0200 |
commit | e17588ea0e107d5d97dbd8cb8a4fae5bfc8ff1a1 (patch) | |
tree | 883f8307ea5935754c7cb21e48c87f1bd4c030a3 /src/compositor/compositor_api/qwaylandquickcompositor.cpp | |
parent | 2cead7f46e8f956b4e211d305c55dd79198b7bfb (diff) |
Make it possible to add the default shell from qml
Change-Id: I00f01a42b98dbe76851800b87a725fcca16f824e
Diffstat (limited to 'src/compositor/compositor_api/qwaylandquickcompositor.cpp')
-rw-r--r-- | src/compositor/compositor_api/qwaylandquickcompositor.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickcompositor.cpp b/src/compositor/compositor_api/qwaylandquickcompositor.cpp index 13c32fae7..977b8a4a5 100644 --- a/src/compositor/compositor_api/qwaylandquickcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandquickcompositor.cpp @@ -49,6 +49,7 @@ QT_BEGIN_NAMESPACE QWaylandQuickCompositor::QWaylandQuickCompositor(QObject *parent) : QWaylandCompositor(parent) , m_initializeLegazyQmlNames(true) + , m_exposeDefaultShell(false) { } @@ -79,9 +80,23 @@ bool QWaylandQuickCompositor::initializeLegazyQmlNames() const void QWaylandQuickCompositor::setInitializeLegazyQmlNames(bool init) { + if (isCreated()) + qWarning() << Q_FUNC_INFO << "modifying initializeLegazyQmlNames after the compositor is created is not supported"; m_initializeLegazyQmlNames = init; } +bool QWaylandQuickCompositor::exposeDefaultShell() const +{ + return m_exposeDefaultShell; +} + +void QWaylandQuickCompositor::setExposeDefaultShell(bool defaultShell) +{ + if (isCreated()) + qWarning() << Q_FUNC_INFO << "modifying exposeDefaultShell after the compositor is created is not supported"; + m_exposeDefaultShell = defaultShell; +} + QWaylandSurfaceView *QWaylandQuickCompositor::createView(QWaylandSurface *surf) { return new QWaylandSurfaceItem(static_cast<QWaylandQuickSurface *>(surf)); @@ -103,4 +118,15 @@ QWaylandSurface *QWaylandQuickCompositor::createSurface(QWaylandClient *client, return new QWaylandQuickSurface(client->client(), id, version, this); } +void QWaylandQuickCompositor::classBegin() +{ +} + +void QWaylandQuickCompositor::componentComplete() +{ + if (m_exposeDefaultShell) + addDefaultShell(); + +} + QT_END_NAMESPACE |