Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.5
- import Sailfish.Silica 1.0
- import QtSensors 5.2
- Page {
- Accelerometer {
- id: accelerometer
- active: true
- }
- Switch {
- scale: Math.min(parent.width, parent.height) /
- Theme.iconSizeSmall
- anchors.top: parent.top
- anchors.horizontalCenter: parent.horizontalCenter
- enabled: accelerometer.reading.y < -1
- }
- Switch {
- scale: Math.min(parent.width, parent.height) /
- Theme.iconSizeSmall
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- enabled: accelerometer.reading.y > 1
- }
- Switch {
- scale: Math.min(parent.width, parent.height) /
- Theme.iconSizeSmall
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- enabled: accelerometer.reading.x > 1
- }
- Switch {
- scale: Math.min(parent.width, parent.height) /
- Theme.iconSizeSmall
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- enabled: accelerometer.reading.x < -1
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement