2 * Copyright (C) 2016 The Qt Company Ltd.
3 * Copyright (C) 2016, 2017 Mentor Graphics Development (Deutschland) GmbH
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 import QtQuick.Layouts 1.1
27 property date now: new Date
29 interval: 100; running: true; repeat: true;
30 onTriggered: root.now = new Date
39 if (condition.indexOf("clouds") != -1) {
40 icon = "WeatherIcons_Cloudy-01.png"
41 } else if (condition.indexOf("thunderstorm") != -1) {
42 icon = "WeatherIcons_Thunderstorm-01.png"
43 } else if (condition.indexOf("snow") != -1) {
44 icon = "WeatherIcons_Snow-01.png"
45 } else if (condition.indexOf("rain") != -1) {
46 icon = "WeatherIcons_Rain-01.png"
49 condition_item.source = icon ? './images/Weather/' + icon : ''
52 onTemperatureChanged: {
53 temperature_item.text = temperature.split(".")[0] + '°F'
61 Layout.fillWidth: true
62 Layout.fillHeight: true
63 Layout.preferredWidth: 295 - 76
69 Layout.fillWidth: true
70 Layout.fillHeight: true
71 text: Qt.formatDate(now, 'dddd').toUpperCase()
75 verticalAlignment: Text.AlignVCenter
77 // anchors.fill: parent
80 // border.color: 'blue'
86 Layout.fillWidth: true
87 Layout.fillHeight: true
88 text: Qt.formatTime(now, 'h:mm ap').toUpperCase()
92 horizontalAlignment: Text.AlignHCenter
93 verticalAlignment: Text.AlignVCenter
96 Layout.fillWidth: true
97 Layout.fillHeight: true
98 Layout.preferredHeight: 20
101 source: './images/Weather/WeatherIcons_Rain-01.png'
107 font.family: 'Helvetica'
115 Layout.fillWidth: true
116 Layout.fillHeight: true
117 Layout.preferredWidth: 76
120 model: StatusBarModel {}
122 Layout.preferredWidth: 77
123 Layout.preferredHeight: 73
124 source: model.modelData
125 fillMode: Image.PreserveAspectFit