Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 1.13 KB | None | 0 0
  1. import QtQuick 2.5
  2. import Sailfish.Silica 1.0
  3. import QtSensors 5.2
  4.  
  5. Page {
  6.     Accelerometer {
  7.         id: accelerometer
  8.         active: true
  9.     }
  10.     Switch {
  11.         scale: Math.min(parent.width, parent.height) /
  12.             Theme.iconSizeSmall
  13.         anchors.top: parent.top
  14.         anchors.horizontalCenter: parent.horizontalCenter
  15.         enabled: accelerometer.reading.y < -1
  16.     }
  17.     Switch {
  18.         scale: Math.min(parent.width, parent.height) /
  19.             Theme.iconSizeSmall
  20.         anchors.bottom: parent.bottom
  21.         anchors.horizontalCenter: parent.horizontalCenter
  22.         enabled: accelerometer.reading.y > 1
  23.     }
  24.     Switch {
  25.         scale: Math.min(parent.width, parent.height) /
  26.             Theme.iconSizeSmall
  27.         anchors.left: parent.left
  28.         anchors.verticalCenter: parent.verticalCenter
  29.         enabled: accelerometer.reading.x > 1
  30.     }
  31.     Switch {
  32.         scale: Math.min(parent.width, parent.height) /
  33.             Theme.iconSizeSmall
  34.         anchors.right: parent.right
  35.         anchors.verticalCenter: parent.verticalCenter
  36.         enabled: accelerometer.reading.x < -1
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement