aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols2
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-03-13 08:47:36 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-03-13 09:31:43 +0000
commit70f43db915a2ae728533b3602b9713503478a4f7 (patch)
tree0066038d66b3cd1e442f2c83da7c46c096a829c8 /examples/quickcontrols2
parentb2f0c3ff02e2eab13f5204f027edf6a7f1e58bdb (diff)
Wearable: set the application background in the window
ApplicationWindow comes with built-in support for custom backgrounds. Change-Id: I524d346a39f28e916d87bef738ad0492ee686c0c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'examples/quickcontrols2')
-rw-r--r--examples/quickcontrols2/wearable/qml/LauncherMain.qml8
-rw-r--r--examples/quickcontrols2/wearable/qml/MainContainer.qml6
-rw-r--r--examples/quickcontrols2/wearable/wearable.qml12
3 files changed, 7 insertions, 19 deletions
diff --git a/examples/quickcontrols2/wearable/qml/LauncherMain.qml b/examples/quickcontrols2/wearable/qml/LauncherMain.qml
index 148701ec..f1fd02d1 100644
--- a/examples/quickcontrols2/wearable/qml/LauncherMain.qml
+++ b/examples/quickcontrols2/wearable/qml/LauncherMain.qml
@@ -68,43 +68,36 @@ Item {
title: qsTr("World Clock")
icon: "../images/watchface/watch.png"
page: "WatchFace/WatchFaceMain.qml"
- background: "../images/background/HomeBackground.png"
}
ListElement { // 1
title: qsTr("Navigation")
icon: "../images/navigation/route.png"
page: "Navigation/NavigationMain.qml"
- background: "../images/background/HomeBackground.png"
}
ListElement { // 2
title: qsTr("Weather")
icon: "../images/weather/weather.png"
page: "Weather/WeatherMain.qml"
- background: "../images/background/HomeBackground.png"
}
ListElement { // 3
title: qsTr("Fitness")
icon: "../images/fitness/fitness.png"
page: "Fitness/FitnessMain.qml"
- background: "../images/background/HomeBackground.png"
}
ListElement { // 4
title: qsTr("Notifications")
icon: "../images/notifications/notifications.png"
page: "Notifications/NotificationsMain.qml"
- background: "../images/background/HomeBackground.png"
}
ListElement { // 5
title: qsTr("Alarm")
icon: "../images/alarms/alarms.png"
page: "Alarms/AlarmsMain.qml"
- background: "../images/background/HomeBackground.png"
}
ListElement { // 6
title: qsTr("Settings")
icon: "../images/settings/settings.png"
page: "Settings/SettingsMain.qml"
- background: "../images/background/HomeBackground.png"
}
}
@@ -221,7 +214,6 @@ Item {
}
}
function loadPage() {
- appBackgroundImg.source = background
stackView.push(Qt.resolvedUrl(page))
}
}
diff --git a/examples/quickcontrols2/wearable/qml/MainContainer.qml b/examples/quickcontrols2/wearable/qml/MainContainer.qml
index fc3a9a39..497de921 100644
--- a/examples/quickcontrols2/wearable/qml/MainContainer.qml
+++ b/examples/quickcontrols2/wearable/qml/MainContainer.qml
@@ -58,12 +58,6 @@ import "Navigation"
import "Style"
Item {
- Image {
- id: appBackgroundImg
- anchors.fill: parent
- source: "../images/background/HomeBackground.png"
- }
-
Item {
id: homeCntrl
diff --git a/examples/quickcontrols2/wearable/wearable.qml b/examples/quickcontrols2/wearable/wearable.qml
index b1ba2c2a..8d596665 100644
--- a/examples/quickcontrols2/wearable/wearable.qml
+++ b/examples/quickcontrols2/wearable/wearable.qml
@@ -49,22 +49,24 @@
****************************************************************************/
import QtQuick 2.7
-import QtQuick.Window 2.0
+import QtQuick.Controls 2.0
import "qml"
import "qml/Style"
-Window {
- id: rootWindow
+ApplicationWindow {
+ id: window
visible: true
width: UIStyle.displayWidth
height: UIStyle.displayHeight
- color: UIStyle.colorQtGray1
-
title: qsTr("Wearable")
+ background: Image {
+ source: "images/background/HomeBackground.png"
+ }
+
MainContainer {
anchors.fill: parent
}