diff options
author | Gatis Paeglis <gatis.paeglis@theqtcompany.com> | 2015-06-29 10:49:42 +0200 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@theqtcompany.com> | 2015-06-29 14:30:56 +0300 |
commit | 79cc843e04c701c5ea7d5593d478820fd6be4a4a (patch) | |
tree | b2fee31aa3e98214652a63654e54126b7bfce020 | |
parent | c7e724e47122f25340ec62e77a34a63819e155cf (diff) |
Wifi: Update qml getting started guide
Change-Id: I633fa8d5ef82b89745bba4cdaa0b4951abe150a3
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-rw-r--r-- | examples/wifi/wifi-qml/WifiScanner.qml | 29 | ||||
-rw-r--r-- | examples/wifi/wifi-qml/doc/images/wifi-qml.jpg | bin | 62077 -> 76197 bytes |
2 files changed, 12 insertions, 17 deletions
diff --git a/examples/wifi/wifi-qml/WifiScanner.qml b/examples/wifi/wifi-qml/WifiScanner.qml index f5ebec2..45fe8e7 100644 --- a/examples/wifi/wifi-qml/WifiScanner.qml +++ b/examples/wifi/wifi-qml/WifiScanner.qml @@ -85,6 +85,7 @@ Item { anchors.topMargin: 30 anchors.left: parent.left anchors.right: parent.right + anchors.bottom: parent.bottom visible: false clip: true @@ -111,6 +112,11 @@ Item { target: WifiManager onNetworkStateChanged: networkView.setNetworkStateText(networkState) } + + Component.onCompleted: { + if (WifiManager.backendState == WifiManager.Running) + networkView.visible = true + } } //! [0] //! [2] @@ -129,7 +135,6 @@ Item { height: expanded ? (connected ? connectedExpandedHeight : expandedHeight) : notExpandedHeight width: parent.width clip: true - color: "#5C5C5C" border.color: "black" border.width: 1 @@ -146,7 +151,6 @@ Item { anchors.leftMargin: 10 font.pixelSize: 26 font.bold: true - color: "#E6E6E6" text: isCurrentNetwork ? ssid + networkView.networkStateText : ssid Component.onCompleted: networkView.setNetworkStateText(WifiManager.networkState) } @@ -158,7 +162,6 @@ Item { anchors.margins: 5 anchors.leftMargin: 30 text: bssid - color: "#E6E6E6" font.pixelSize: ssidLabel.font.pixelSize * 0.8 } @@ -171,28 +174,20 @@ Item { + (supportsWPA ? "WPA " : "") + (supportsWEP ? "WEP " : "") + (supportsWPS ? "WPS " : ""); - color: "#E6E6E6" font.pixelSize: ssidLabel.font.pixelSize * 0.8 font.italic: true } - Rectangle { + ProgressBar { id: signalStrengthBar - height: 15 - radius: 20 - antialiasing: true + height: 20 + width: networkBox.width * 0.5 anchors.margins: 10 anchors.right: parent.right anchors.top: parent.top - color: "#BF8888" - border.color: "#212126" - property int strengthBarWidth: Math.max(100 + signalStrength, 0) / 100 * parent.width - onStrengthBarWidthChanged: { - if (strengthBarWidth > parent.width * 0.55) - signalStrengthBar.width = parent.width * 0.55 - else - signalStrengthBar.width = strengthBarWidth - } + minimumValue: 0 + maximumValue: 100 + value : signalStrength } //! [1] MouseArea { diff --git a/examples/wifi/wifi-qml/doc/images/wifi-qml.jpg b/examples/wifi/wifi-qml/doc/images/wifi-qml.jpg Binary files differindex a0780c2..649707f 100644 --- a/examples/wifi/wifi-qml/doc/images/wifi-qml.jpg +++ b/examples/wifi/wifi-qml/doc/images/wifi-qml.jpg |