diff options
Diffstat (limited to 'basicsuite/Sensors/Light.qml')
-rw-r--r-- | basicsuite/Sensors/Light.qml | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/basicsuite/Sensors/Light.qml b/basicsuite/Sensors/Light.qml deleted file mode 100644 index fceecb7..0000000 --- a/basicsuite/Sensors/Light.qml +++ /dev/null @@ -1,50 +0,0 @@ -import QtQuick 2.0 -import QtSensors 5.0 - -Item { - rotation: 180 - Rectangle { - id: bg - width: parent.width - height: parent.height - Text { - id: illuminanceLevel - anchors.horizontalCenter: parent.horizontalCenter - font.pointSize: 26 - anchors.top: parent.top - } - Image { - id: avatar - anchors.top: illuminanceLevel.bottom - anchors.topMargin: 30 - anchors.centerIn: parent - } - - AmbientLightSensor { - active: true - onReadingChanged: { - if (reading.lightLevel === AmbientLightReading.Dark) { - avatar.source = "3.png" - bg.color = "midnightblue" - } else if (reading.lightLevel === AmbientLightReading.Twilight - || reading.lightLevel === AmbientLightReading.Light) { - avatar.source = "2.png" - bg.color = "steelblue" - } else if (reading.lightLevel === AmbientLightReading.Bright - || reading.lightLevel === AmbientLightReading.Sunny) { - avatar.source = "1.png" - bg.color = "yellow" - } else { - avatar.text = "Unknown light level" - } - } - } - - LightSensor { - active: true - onReadingChanged: { - illuminanceLevel.text = "Illuminance: " + reading.illuminance - } - } - } -} |