summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Korpipaa <tomi.korpipaa@qt.io>2023-01-12 10:19:38 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-01-13 10:18:39 +0000
commit0909d2ab08e3d3ec6c824005b3da15c3f66e8719 (patch)
tree4f981277ae7050033f4a4902c55b6440504afe52
parent8500ac262e107bd8b2ae1a0ecb32b87f2f533936 (diff)
Fix qmlbars example for portrait mode
Fixes: QTBUG-110038 Change-Id: I008827e96c7a090568689652a81e32e0bf80f67c Reviewed-by: Amr Elsayed <amr.elsayed@qt.io> Reviewed-by: Kwanghyo Park <kwanghyo.park@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> (cherry picked from commit bca40cd25d71ae5fb322e0248d4f806b885d44de) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--examples/datavisualization/qmlbars/qml/qmlbars/main.qml17
1 files changed, 5 insertions, 12 deletions
diff --git a/examples/datavisualization/qmlbars/qml/qmlbars/main.qml b/examples/datavisualization/qmlbars/qml/qmlbars/main.qml
index 321a5ea9..745104f0 100644
--- a/examples/datavisualization/qmlbars/qml/qmlbars/main.qml
+++ b/examples/datavisualization/qmlbars/qml/qmlbars/main.qml
@@ -37,7 +37,7 @@ Item {
// Set tableView current row to selected bar
var rowRole = series.dataProxy.rowLabels[position.x];
var colRole
- if (barGraph.columnAxis === graphAxes.total)
+ if (barGraph.columnAxis == graphAxes.total)
colRole = "01";
else
colRole = series.dataProxy.columnLabels[position.y];
@@ -57,13 +57,12 @@ Item {
Item {
id: dataView
- anchors.right: mainview.right;
+ anchors.right: mainview.right
anchors.bottom: mainview.bottom
Bars3D {
id: barGraph
- width: dataView.width
- height: dataView.height
+ anchors.fill: parent
shadowQuality: AbstractGraph3D.ShadowQualityMedium
selectionMode: AbstractGraph3D.SelectionItem
theme: Theme3D {
@@ -150,12 +149,9 @@ Item {
}
}
-
-
ColumnLayout {
id: tableViewLayout
-
anchors.top: parent.top
anchors.left: parent.left
@@ -169,7 +165,6 @@ Item {
padding: 3
text: header.columnNames[index]
}
-
}
TableView {
@@ -189,7 +184,6 @@ Item {
rows: graphData.modelAsJsArray
}
-
delegate: Rectangle {
implicitHeight: 30
implicitWidth: tableView.width / 3
@@ -219,7 +213,6 @@ Item {
return display
}
}
-
}
}
}
@@ -232,7 +225,7 @@ Item {
var matches = pattern.exec(timestamp)
var rowIndex = modelProxy.rowCategoryIndex(matches[1])
var colIndex
- if (barGraph.columnAxis === graphAxes.total)
+ if (barGraph.columnAxis == graphAxes.total)
colIndex = 0 // Just one column when showing yearly totals
else
colIndex = modelProxy.columnCategoryIndex(matches[2])
@@ -382,7 +375,7 @@ Item {
name: "portrait"
PropertyChanges {
target: dataView
- width: mainview.height / 4 * 3
+ width: mainview.width
height: mainview.width
}
PropertyChanges {