diff options
author | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-12-02 14:00:44 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-12-02 14:01:08 +0100 |
commit | 05bf419b206f3cd078364cf67af2df4e4d1477c0 (patch) | |
tree | c942e884e8f75a29bd9f281c993fbc85a0b832ed /examples/wayland/qwindow-compositor/main.cpp | |
parent | dd5e1ffd3e9e379574325193c8546d453c11303e (diff) | |
parent | 3698b116a1973146b76319673cdb6787f13f2de6 (diff) |
Merge branch 'wip-compositor-api' into dev
This introduces the new compositor API, removing the
old API (which was never officially supported).
Change-Id: I1dc01f0fb4edc749e34ed8356e56ad87d7d64913
Diffstat (limited to 'examples/wayland/qwindow-compositor/main.cpp')
-rw-r--r-- | examples/wayland/qwindow-compositor/main.cpp | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/examples/wayland/qwindow-compositor/main.cpp b/examples/wayland/qwindow-compositor/main.cpp index b4be143b5..c4fa43256 100644 --- a/examples/wayland/qwindow-compositor/main.cpp +++ b/examples/wayland/qwindow-compositor/main.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Compositor. +** This file is part of the examples of the Qt Wayland module ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: @@ -38,36 +38,19 @@ ** ****************************************************************************/ -#include "compositorwindow.h" -#include "qwindowcompositor.h" - #include <QGuiApplication> -#include <QStringList> -#include <QScreen> -#include <QSurfaceFormat> +#include "compositorwindow.h" +#include "windowcompositor.h" int main(int argc, char *argv[]) { - // Enable the following to have touch events generated from mouse events. - // Very handy for testing touch event delivery without a real touch device. - // QGuiApplication::setAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents, true); - QGuiApplication app(argc, argv); - QScreen *screen = QGuiApplication::primaryScreen(); - QRect screenGeometry = screen->availableGeometry(); - - QSurfaceFormat format; - format.setDepthBufferSize(16); - format.setStencilBufferSize(8); - - QRect geom = screenGeometry; - if (QCoreApplication::arguments().contains(QLatin1String("-nofullscreen"))) - geom = QRect(screenGeometry.width() / 4, screenGeometry.height() / 4, - screenGeometry.width() / 2, screenGeometry.height() / 2); - - CompositorWindow window(format, geom); - QWindowCompositor compositor(&window); + CompositorWindow window; + WindowCompositor compositor(&window); + window.setCompositor(&compositor); + compositor.create(); + window.resize(800,600); window.show(); return app.exec(); |