summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Korpipaa <tomi.korpipaa@qt.io>2023-01-12 11:01:31 +0200
committerTomi Korpipaa <tomi.korpipaa@qt.io>2023-01-13 09:41:39 +0200
commit48ed1e71fada95944b51c35e83e45d4e40faa1d8 (patch)
tree4b37d5f1cf5f2e0aec71d320c54c3fe9bcc389da
parentafa9d9fca6eff7ecceecda6eb6bf324c0f9e8140 (diff)
Fix qmlmultigraph example for portrait mode
Pick-to: 6.2 6.4 6.5 Fixes: QTBUG-110041 Change-Id: I5b85b5eb57bd4b368ff678073c0d64d08987d0cf Reviewed-by: Kwanghyo Park <kwanghyo.park@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r--examples/datavisualization/qmlmultigraph/qml/qmlmultigraph/main.qml8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/datavisualization/qmlmultigraph/qml/qmlmultigraph/main.qml b/examples/datavisualization/qmlmultigraph/qml/qmlmultigraph/main.qml
index 98e19a53..07273190 100644
--- a/examples/datavisualization/qmlmultigraph/qml/qmlmultigraph/main.qml
+++ b/examples/datavisualization/qmlmultigraph/qml/qmlmultigraph/main.qml
@@ -12,6 +12,8 @@ Item {
width: 800
height: 600
+ property bool portratiMode: width < height
+
Data {
id: data
}
@@ -76,7 +78,7 @@ Item {
Layout.minimumWidth: parent.width / 2
Layout.fillHeight: true
Layout.fillWidth: true
- text: "Clear Selections"
+ text: portratiMode ? "Clear\nSelections" : "Clear Selections"
onClicked: clearSelections() // call a helper function to keep button itself simpler
}
@@ -91,14 +93,14 @@ Item {
Button {
Layout.fillHeight: true
Layout.fillWidth: true
- text: "Reset Cameras"
+ text: portratiMode ? "Reset\nCameras" : "Reset Cameras"
onClicked: resetCameras() // call a helper function to keep button itself simpler
}
Button {
Layout.fillHeight: true
Layout.fillWidth: true
- text: "Toggle Mesh Styles"
+ text: portratiMode ? "Toggle\nMesh\nStyles" : "Toggle Mesh Styles"
onClicked: toggleMeshStyle() // call a helper function to keep button itself simpler
}
}