summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2023-02-08 12:06:36 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-02-10 11:36:23 +0000
commit5d7088f72756d5896849d996c6cb88d2b7897625 (patch)
tree16d649b1019c28c264f4b9673d565ad2f0937055
parentd77b67fec853c331c47da796e5d0c568f64f4ed5 (diff)
downloadqtwayland-5d7088f72756d5896849d996c6cb88d2b7897625.tar.gz
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 <paul.tvete@qt.io> (cherry picked from commit c5a253cc87c75640d828407cc85832d9be28cbbc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--examples/wayland/multi-screen/qml/Chrome.qml1
-rw-r--r--examples/wayland/multi-screen/qml/main.qml2
2 files changed, 2 insertions, 1 deletions
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