##// END OF EJS Templates
Improve QML Weather example layout...
Titta Heikkala -
r2761:c19e8d5c88d9
parent child
Show More
@@ -32,8 +32,8 Rectangle {
32 id: chartView
32 id: chartView
33 title: "Weather forecast"
33 title: "Weather forecast"
34 //![1]
34 //![1]
35 height: parent.height / 4 * 3
35 anchors.top: parent.top
36 anchors.top: parent.top
36 anchors.bottom: weatherImageRow.top
37 anchors.left: parent.left
37 anchors.left: parent.left
38 anchors.right: parent.right
38 anchors.right: parent.right
39 legend.alignment: Qt.AlignTop
39 legend.alignment: Qt.AlignTop
@@ -126,12 +126,12 Rectangle {
126
126
127 Row {
127 Row {
128 id: weatherImageRow
128 id: weatherImageRow
129 anchors.top: chartView.bottom
130 anchors.topMargin: 5
129 anchors.bottom: poweredByText.top
131 anchors.bottom: poweredByText.top
130 anchors.bottomMargin: 10
132 anchors.bottomMargin: 5
131 anchors.left: parent.left
133 anchors.horizontalCenter: parent.horizontalCenter
132 anchors.leftMargin: 25
134 height: parent.height - chartView.height - anchors.topMargin
133 anchors.right: parent.right
134 anchors.rightMargin: 25
135
135
136 ListModel {
136 ListModel {
137 id: weatherImageModel
137 id: weatherImageModel
@@ -142,7 +142,7 Rectangle {
142 model: weatherImageModel
142 model: weatherImageModel
143 delegate: Image {
143 delegate: Image {
144 source: imageSource
144 source: imageSource
145 width: weatherImageRow.width / weatherImageModel.count
145 width: weatherImageRow.height
146 height: width
146 height: width
147 fillMode: Image.PreserveAspectCrop
147 fillMode: Image.PreserveAspectCrop
148 }
148 }
@@ -152,9 +152,10 Rectangle {
152 Text {
152 Text {
153 id: poweredByText
153 id: poweredByText
154 anchors.bottom: parent.bottom
154 anchors.bottom: parent.bottom
155 anchors.bottomMargin: 10
155 anchors.bottomMargin: 5
156 anchors.left: parent.left
156 anchors.left: parent.left
157 anchors.leftMargin: 25
157 anchors.leftMargin: 25
158 height: parent.height / 25
158 text: "Powered by World Weather Online"
159 text: "Powered by World Weather Online"
159 }
160 }
160
161
General Comments 0
You need to be logged in to leave comments. Login now