summaryrefslogtreecommitdiffstats
path: root/examples/wayland/minimal-qml/main.qml
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2021-04-30 08:53:10 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2021-06-03 09:23:54 +0200
commitb4282a4c54cef4873ec35da2706c7a0b0d843d1c (patch)
tree3569f53584a0aaf599b87fb2617d6b4cc71b7b42 /examples/wayland/minimal-qml/main.qml
parentbce833cf5aef6d3cda696f174355de2ad0541037 (diff)
doc: Expand the Minimal QML example
Include screenshots, code snippets and justification. Task-number: QTBUG-91674 Change-Id: I4de54439e34f49dc5d361d1cdd86be75a3fa06eb Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'examples/wayland/minimal-qml/main.qml')
-rw-r--r--examples/wayland/minimal-qml/main.qml15
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/wayland/minimal-qml/main.qml b/examples/wayland/minimal-qml/main.qml
index 152e0c93a..199ba3008 100644
--- a/examples/wayland/minimal-qml/main.qml
+++ b/examples/wayland/minimal-qml/main.qml
@@ -55,14 +55,21 @@ import QtWayland.Compositor.XdgShell
import QtWayland.Compositor.WlShell
import QtWayland.Compositor.IviApplication
+//! [compositor]
WaylandCompositor {
+//! [compositor]
// The output defines the screen.
+
+ //! [output]
WaylandOutput {
sizeFollowsWindow: true
window: Window {
width: 1024
height: 768
visible: true
+ //! [output]
+
+ //! [shell surface item]
Repeater {
model: shellSurfaces
// ShellSurfaceItem handles displaying a shell surface.
@@ -74,13 +81,17 @@ WaylandCompositor {
onSurfaceDestroyed: shellSurfaces.remove(index)
}
}
+ //! [shell surface item]
}
}
+
// Extensions are additions to the core Wayland
// protocol. We choose to support three different
// shells (window management protocols). When the
// client creates a new shell surface (i.e. a window)
// we append it to our list of shellSurfaces.
+
+ //! [shells]
WlShell {
onWlShellSurfaceCreated:
shellSurfaces.append({shellSurface: shellSurface});
@@ -94,5 +105,9 @@ WaylandCompositor {
shellSurfaces.append({shellSurface: iviSurface});
}
}
+ //! [shells]
+
+ //! [model]
ListModel { id: shellSurfaces }
+ //! [model]
}