summaryrefslogtreecommitdiffstats
path: root/app/example/Example.qml
diff options
context:
space:
mode:
authorTasuku Suzuki <tasuku.suzuki@qt.io>2016-12-20 19:18:49 +0900
committerTasuku Suzuki <tasuku.suzuki@qt.io>2016-12-20 19:22:58 +0900
commitc70f97efea9b58490362692833104a6a5f23da89 (patch)
treeca43bb1d61fb2fdf16e6e814dd32870cb1f5bf7c /app/example/Example.qml
parent2f77037147a7609418c570c28ed02f0c1d31733f (diff)
Add changing status icon in example
to test this, you need to add a conf file under /etc/dbus-1/session.d/ <?xml version="1.0"?> <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> <busconfig> <policy context="default"> <allow send_destination="org.agl.homescreen"/> </policy> </busconfig> Change-Id: I82c4b01db86ee54de87fad1db2ebf3f743b7c020 Signed-off-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
Diffstat (limited to 'app/example/Example.qml')
-rw-r--r--app/example/Example.qml24
1 files changed, 21 insertions, 3 deletions
diff --git a/app/example/Example.qml b/app/example/Example.qml
index 18e3efc..283b76b 100644
--- a/app/example/Example.qml
+++ b/app/example/Example.qml
@@ -32,14 +32,32 @@ SettingPage {
RowLayout {
spacing: 20
Button {
- text: 'Sushi'
+ text: 'Wifi'
highlighted: true
+ property int index: 0
+ property var icons: ['HMI_Status_Wifi_NoBars-01', 'HMI_Status_Wifi_1Bar-01', 'HMI_Status_Wifi_2Bars-01', 'HMI_Status_Wifi_3Bars-01', 'HMI_Status_Wifi_Full-01']
+ onClicked: {
+ index = (index + 1) % icons.length
+ setStatusIcon(0, 'qrc:/images/Status/%1.png'.arg(icons[index]))
+ }
}
Button {
- text: 'Sashimi'
+ text: 'Bluetooth'
+ property int index: 0
+ property var icons: ['HMI_Status_Bluetooth_Inactive-01', 'HMI_Status_Bluetooth_On-01']
+ onClicked: {
+ index = (index + 1) % icons.length
+ setStatusIcon(1, 'qrc:/images/Status/%1.png'.arg(icons[index]))
+ }
}
Button {
- text: 'Ramen'
+ text: 'Signal'
+ property int index: 0
+ property var icons: ['HMI_Status_Signal_NoBars-01', 'HMI_Status_Signal_1Bars-01', 'HMI_Status_Signal_2Bars-01', 'HMI_Status_Signal_3Bars-01', 'HMI_Status_Signal_4Bars-01', 'HMI_Status_Signal_Full-01']
+ onClicked: {
+ index = (index + 1) % icons.length
+ setStatusIcon(2, 'qrc:/images/Status/%1.png'.arg(icons[index]))
+ }
}
}