From 5d7088f72756d5896849d996c6cb88d2b7897625 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 8 Feb 2023 12:06:36 +0100 Subject: compositor: Fix QML errors in multi-screen example The output property was not hooked up to the surface item, causing the error "qrc:/qml/main.qml: Setting initial properties failed: Chrome does not have a property called output" In addition, when emulating screens, the model is a ListModel, and thus there is no modelData to access (nor would it make any sense to assign this to the screen property). We just set the screen to be the (only) screen on the system in this case. Task-number: QTBUG-110993 Change-Id: I7f6ec15dd038605bd0d94a34600ecbf22aad9878 Reviewed-by: Paul Olav Tvete (cherry picked from commit c5a253cc87c75640d828407cc85832d9be28cbbc) Reviewed-by: Qt Cherry-pick Bot --- examples/wayland/multi-screen/qml/Chrome.qml | 1 + examples/wayland/multi-screen/qml/main.qml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/wayland/multi-screen/qml/Chrome.qml b/examples/wayland/multi-screen/qml/Chrome.qml index 33e14787..d3485e81 100644 --- a/examples/wayland/multi-screen/qml/Chrome.qml +++ b/examples/wayland/multi-screen/qml/Chrome.qml @@ -10,6 +10,7 @@ Item { property alias shellSurface: surfaceItem.shellSurface property alias surfaceItem: surfaceItem property alias moveItem: surfaceItem.moveItem + property alias output: surfaceItem.output //! [position sync] x: surfaceItem.moveItem.x - surfaceItem.output.geometry.x diff --git a/examples/wayland/multi-screen/qml/main.qml b/examples/wayland/multi-screen/qml/main.qml index fc14d0a7..1180d30b 100644 --- a/examples/wayland/multi-screen/qml/main.qml +++ b/examples/wayland/multi-screen/qml/main.qml @@ -30,7 +30,7 @@ WaylandCompositor { surfaceArea.color: "lightsteelblue" text: name compositor: comp - screen: modelData + screen: emulated ? Qt.application.screens[0] : modelData Component.onCompleted: if (!comp.defaultOutput) comp.defaultOutput = this position: Qt.point(virtualX, virtualY) windowed: emulated -- cgit v1.2.1