summaryrefslogtreecommitdiffstats
path: root/examples/sensors/qmlqtsensors5
diff options
context:
space:
mode:
Diffstat (limited to 'examples/sensors/qmlqtsensors5')
-rw-r--r--examples/sensors/qmlqtsensors5/Button.qml74
-rw-r--r--examples/sensors/qmlqtsensors5/SelectionButton.qml77
-rw-r--r--examples/sensors/qmlqtsensors5/checked.gifbin246 -> 0 bytes
-rwxr-xr-xexamples/sensors/qmlqtsensors5/icon.pngbin2030 -> 0 bytes
-rw-r--r--examples/sensors/qmlqtsensors5/info.json14
-rw-r--r--examples/sensors/qmlqtsensors5/main.qml370
-rw-r--r--examples/sensors/qmlqtsensors5/qmlqtsensors5.qmlproject18
-rw-r--r--examples/sensors/qmlqtsensors5/unchecked.gifbin170 -> 0 bytes
8 files changed, 0 insertions, 553 deletions
diff --git a/examples/sensors/qmlqtsensors5/Button.qml b/examples/sensors/qmlqtsensors5/Button.qml
deleted file mode 100644
index 390dd1c4..00000000
--- a/examples/sensors/qmlqtsensors5/Button.qml
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtSensors module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle {
- id: button
- width: 100
- height: 20
- property alias text: t.text
- property bool checked
- signal clicked
- property color checkColor;
- property color unCheckColor;
- border.width: 1
- radius: 2
-
- Text{
- x: 0
- id: t
- anchors.fill: button
- }
-
- MouseArea{
- anchors.fill: button
- onClicked: {
- setCheck(!button.checked);
- button.clicked();
- }
- }
-
- function setCheck(val)
- {
- checked = val;
- button.color = (button.checked == true ? checkColor : unCheckColor);
- }
-}
diff --git a/examples/sensors/qmlqtsensors5/SelectionButton.qml b/examples/sensors/qmlqtsensors5/SelectionButton.qml
deleted file mode 100644
index 014f965e..00000000
--- a/examples/sensors/qmlqtsensors5/SelectionButton.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtSensors module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle {
- id: button
- width: 100
- height: 25
- property alias text: t.text
- property bool checked
- signal clicked
-
- Image{
- id: image
- x: 0
- width: 15
- height: 15
- source: (button.checked == true ? "checked.gif" : "unchecked.gif")
- }
-
- Text{
- x: image.x + image.width + 10
- id: t
- }
-
- MouseArea{
- anchors.fill: button
- onClicked: {
- setCheck(true);
- button.clicked();
- }
- }
-
- function setCheck(val)
- {
- checked = val;
- image.source = (button.checked == true ? "checked.gif" : "unchecked.gif");
- }
-}
diff --git a/examples/sensors/qmlqtsensors5/checked.gif b/examples/sensors/qmlqtsensors5/checked.gif
deleted file mode 100644
index a4216f2c..00000000
--- a/examples/sensors/qmlqtsensors5/checked.gif
+++ /dev/null
Binary files differ
diff --git a/examples/sensors/qmlqtsensors5/icon.png b/examples/sensors/qmlqtsensors5/icon.png
deleted file mode 100755
index 27657129..00000000
--- a/examples/sensors/qmlqtsensors5/icon.png
+++ /dev/null
Binary files differ
diff --git a/examples/sensors/qmlqtsensors5/info.json b/examples/sensors/qmlqtsensors5/info.json
deleted file mode 100644
index 4061fcd2..00000000
--- a/examples/sensors/qmlqtsensors5/info.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "info-version": "1.0",
- "dict": {
- "Category": "application",
- "Runtime": "qml",
- "DisplayName": "Sensors2",
- "Subcategory": "utility",
- "MainQML": "main.qml",
- "Version": "1.0",
- "Identifier": "com.nokia.mt.qmlsensors2.demo",
- "Summary": "QML Sensors2 demo",
- "Author": "Qt"
- }
-}
diff --git a/examples/sensors/qmlqtsensors5/main.qml b/examples/sensors/qmlqtsensors5/main.qml
deleted file mode 100644
index 5da5b939..00000000
--- a/examples/sensors/qmlqtsensors5/main.qml
+++ /dev/null
@@ -1,370 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtSensors module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-//Import the declarative plugins
-import QtQuick 2.0
-
-//! [0]
-import QtSensors 5.0
-//! [0]
-
-/* Layout
- tiltrect
- /
-----------------------------------------------------------------------------/
-| Accuracy <----- textAccuracy
-| @ 0 Degree <- selButton0DegreeAccuracy @ Slow <- selButtonSlowSpeed
-| O 1 Degree <- selButton1DegreeAccuracy O Medium <- selButtonMediumSpeed
-| O 5 Degree <- selButton5DegreeAccuracy O Fast <- selButtonFastSpeed
-| -----------
-| |calibrate| <------------------ calibrate
-| -----------
-| ---------
-| |degree | <-------------------- useRadian
-| ---------
-| X Rotation: 0 <------------------ xrottext
-| Y Rotation: 0 <------------------ yrottext
-| ---------
-| |start | <-------------------- tiltStart
-| --------- ablrect
------------------------------- /
-------------------------------/
-| Ambient light: - <--------------- abltext
-| ---------
-| |start | <-------------------- ablStart
-| --------- proxirect
------------------------------- /
-------------------------------/
-| Proximity: false <--------------- proxitext
-| ---------
-| |start | <-------------------- proxiStart
-| ---------
-------------------------------------------------------------------------------
-
-*/
-
-Rectangle {
- width: 320
- height: 480
-
- Rectangle {
- id: tiltrect
- x: 2
- y: 22
- width: 315
- height: 270
- border.width: 1
-
-//! [1]
- TiltSensor {
- id: tilt
- unit: TiltSensor.Degrees
- enabled: false
- accuracy: 1.0
- }
-//! [1]
-
- Text{
- id: textAccuracy
- x: 5
- y: 20
- text: "Accuracy"
- }
-
- Text{
- id: textSpeed
- x: 150
- y: 20
- text: "Speed"
- }
-
- SelectionButton{
- id: selButton0DegreeAccuracy
- x: 5
- y: 45
- checked: true
- text: "0 Degree"
- onClicked:{
- selButton1DegreeAccuracy.setCheck(false);
- selButton5DegreeAccuracy.setCheck(false);
- tilt.accuracy = 0.0;
- }
- }
- SelectionButton{
- id: selButtonSlowSpeed
- x: 150
- y: 45
- checked: true
- text: "Slow"
- onClicked:{
- selButtonMediumSpeed.setCheck(false);
- selButtonFastSpeed.setCheck(false);
- tilt.speed = TiltSensor.Slow;
- }
- }
-
- SelectionButton{
- id: selButton1DegreeAccuracy
- x: 5
- y: 70
- checked: false
- text: "1 Degree"
- onClicked:{
- selButton0DegreeAccuracy.setCheck(false);
- selButton5DegreeAccuracy.setCheck(false);
- tilt.accuracy = (tilt.unit == TiltSensor.Degrees ? 1.0 : (3.14 / 180.0));
- }
- }
- SelectionButton{
- id: selButtonMediumSpeed
- x: 150
- y: 70
- checked: false
- text: "Medium"
- onClicked:{
- selButtonSlowSpeed.setCheck(false);
- selButtonFastSpeed.setCheck(false);
- tilt.speed = TiltSensor.Medium;
- }
- }
-
- SelectionButton{
- id: selButton5DegreeAccuracy
- x: 5
- y: 95
- checked: false
- text: "5 Degree"
- onClicked:{
- selButton0DegreeAccuracy.setCheck(false);
- selButton1DegreeAccuracy.setCheck(false);
- tilt.accuracy = (tilt.unit == TiltSensor.Degrees ? 5.0 : (5.0 * 3.14 / 180.0));
- }
- }
-
- SelectionButton{
- id: selButtonFastSpeed
- x: 150
- y: 95
- checked: false
- text: "Fast"
- onClicked:{
- selButtonSlowSpeed.setCheck(false);
- selButtonMediumSpeed.setCheck(false);
- tilt.speed = TiltSensor.Fast;
- }
- }
-
- Button{
- id: calibrate
- x: 5
- y: 145
- text: "calibrate"
- checkColor: "lightblue"
- unCheckColor: "lightyellow"
- checked: false
- color: "lightyellow"
-
- onClicked:{
- tilt.calibrate();
- unchecktimer.running = true;
- }
- Timer {
- id: unchecktimer
- interval: 1000; running: false; repeat: false
- onTriggered: {
- calibrate.checked = false;
- calibrate.color = "lightyellow";
- }
- }
- }
-
- Button{
- id: useRadian
- x: 5
- y: 170
- text: "degree"
- checkColor: "lightblue"
- unCheckColor: "lightyellow"
- checked: (tilt.unit == TiltSensor.Radians ? true : false)
- color: "lightyellow"
-
- onClicked:{
- tilt.unit = (useRadian.checked ? TiltSensor.Radians : TiltSensor.Degrees);
- if (useRadian.checked)
- useRadian.text = "radian";
- else
- useRadian.text = "degree";
- }
- }
-
- Text {
- id: xrottext
- x:5
- y:195
-//! [3]
- text: "X Rotation: " + tilt.xRotation
-//! [3]
- }
- Text {
- id: yrottext
- x:5
- y:220
-//! [4]
- text: "Y Rotation: " + tilt.yRotation
-//! [4]
- }
- Button{
- id: tiltStart
- x: 5
- y: 245
- text: tilt.enabled ? "running" : "start"
- checkColor: "lightblue"
- unCheckColor: "lightyellow"
- color: tilt.enabled ? checkColor : unCheckColor
- checked: tilt.enabled
-
- onClicked:{
-//! [2]
- tilt.enabled = tiltStart.checked;
-//! [2]
- if (tiltStart.checked)
- tiltStart.text = "running";
- else
- tiltStart.text = "stopped";
- }
- }
- }
-
- Rectangle {
- id: ambientlightrect
- x: 2
- y: tiltrect.y + tiltrect.height + 10
- width: 315
- height: 70
- border.width: 1
-
- AmbientLightSensor {
- id: ambientlight
- enabled: false
- onLightLevelChanged:{
-//! [5]
- if (ambientlight.lightLevel == AmbientLightSensor.Unknown)
- ambientlighttext.text = "Ambient light: Unknown";
-//! [5]
- else if (ambientlight.lightLevel == AmbientLightSensor.Dark)
- ambientlighttext.text = "Ambient light: Dark";
- else if (ambientlight.lightLevel == AmbientLightSensor.Twilight)
- ambientlighttext.text = "Ambient light: Twilight";
- else if (ambientlight.lightLevel == AmbientLightSensor.Light)
- ambientlighttext.text = "Ambient light: Light";
- else if (ambientlight.lightLevel == AmbientLightSensor.Bright)
- ambientlighttext.text = "Ambient light: Bright";
- else if (ambientlight.lightLevel == AmbientLightSensor.Sunny)
- ambientlighttext.text = "Ambient light: Sunny";
- }
- }
-
- Text {
- id: ambientlighttext
- x: 5
- y: 10
- text: "Ambient light: -"
- }
- Button{
- id: ambientlightStart
- x: 5
- y: 35
- text: ambientlight.enabled ? "running" : "start"
- checkColor: "lightblue"
- unCheckColor: "lightyellow"
- color: ambientlight.enabled ? checkColor : unCheckColor
- checked: ambientlight.enabled
-
- onClicked:{
- ambientlight.enabled = ambientlightStart.checked;
- if (ambientlightStart.checked)
- ambientlightStart.text = "running";
- else
- ambientlightStart.text = "stopped";
- }
- }
- }
-
- Rectangle {
- id: proxirect
- x: 2
- y: ambientlightrect.y + ambientlightrect.height + 10
- width: 315
- height: 70
- border.width: 1
-
- ProximitySensor {
- id: proxi
- enabled: false
- }
-
- Text {
- id: proxitext
- x: 5
- y: 10
- text: "Proximity: " + proxi.near
- }
- Button{
- id: proxiStart
- x: 5
- y: 35
-//! [6]
- text: proxi.enabled ? "running" : "start"
-//! [6]
- checkColor: "lightblue"
- unCheckColor: "lightyellow"
- color: proxi.enabled ? checkColor : unCheckColor
- checked: proxi.enabled
-
- onClicked:{
- proxi.enabled = proxiStart.checked;
- if (proxiStart.checked)
- proxiStart.text = "running";
- else
- proxiStart.text = "stopped";
- }
- }
- }
-}
diff --git a/examples/sensors/qmlqtsensors5/qmlqtsensors5.qmlproject b/examples/sensors/qmlqtsensors5/qmlqtsensors5.qmlproject
deleted file mode 100644
index 4d32f758..00000000
--- a/examples/sensors/qmlqtsensors5/qmlqtsensors5.qmlproject
+++ /dev/null
@@ -1,18 +0,0 @@
-import QmlProject 1.1
-
-Project {
- mainFile: "main.qml"
-
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
- /* List of plugin directories passed to QML runtime */
- // importPaths: [ "../exampleplugin" ]
-}
diff --git a/examples/sensors/qmlqtsensors5/unchecked.gif b/examples/sensors/qmlqtsensors5/unchecked.gif
deleted file mode 100644
index ffb651df..00000000
--- a/examples/sensors/qmlqtsensors5/unchecked.gif
+++ /dev/null
Binary files differ