From 75487a011fb8b8de1e22c25425f024dfb97dc192 Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Fri, 11 Apr 2014 12:08:08 +0200 Subject: accelbubble: avoid updating position if NaN. Invalid sensor data is NaN, and should be ignored. Change-Id: I6436bdd494b3d167121bd8ee80f81c031e60743e Reviewed-by: Alex Blasche --- examples/sensors/accelbubble/accelbubble.qml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'examples') diff --git a/examples/sensors/accelbubble/accelbubble.qml b/examples/sensors/accelbubble/accelbubble.qml index 8f676dc..033e66a 100644 --- a/examples/sensors/accelbubble/accelbubble.qml +++ b/examples/sensors/accelbubble/accelbubble.qml @@ -69,6 +69,9 @@ ApplicationWindow { var newX = (bubble.x + calcRoll(accel.reading.x, accel.reading.y, accel.reading.z) * .1) var newY = (bubble.y - calcPitch(accel.reading.x, accel.reading.y, accel.reading.z) * .1) + if (isNaN(newX) || isNaN(newY)) + return; + if (newX < 0) newX = 0 -- cgit v1.2.1 From da27dc09c45a236744c482107a7d9f709069381c Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Fri, 11 Apr 2014 14:13:04 +0200 Subject: accelbubble: disable rotation on iOS Change-Id: Ia3f6bdd494b3d167121bd8ee80f81c031a81f45a Reviewed-by: Alex Blasche --- examples/sensors/accelbubble/Info.plist | 35 ++++++++++++++++++++++++++++ examples/sensors/accelbubble/accelbubble.pro | 7 ++++++ 2 files changed, 42 insertions(+) create mode 100644 examples/sensors/accelbubble/Info.plist (limited to 'examples') diff --git a/examples/sensors/accelbubble/Info.plist b/examples/sensors/accelbubble/Info.plist new file mode 100644 index 0000000..82e9bff --- /dev/null +++ b/examples/sensors/accelbubble/Info.plist @@ -0,0 +1,35 @@ + + + + + CFBundleDisplayName + accelbubble + CFBundleExecutable + accelbubble + CFBundleGetInfoString + Created by Qt/QMake + CFBundleIdentifier + com.digia.accelbubble + CFBundleName + accelbubble + CFBundlePackageType + APPL + CFBundleResourceSpecification + ResourceRules.plist + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + UIDeviceFamily + + 1 + 2 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/examples/sensors/accelbubble/accelbubble.pro b/examples/sensors/accelbubble/accelbubble.pro index cdb6ab7..4204f15 100644 --- a/examples/sensors/accelbubble/accelbubble.pro +++ b/examples/sensors/accelbubble/accelbubble.pro @@ -15,4 +15,11 @@ OTHER_FILES = \ target.path = $$[QT_INSTALL_EXAMPLES]/sensors/accelbubble INSTALLS += target +ios { +QMAKE_INFO_PLIST = Info.plist + +# manual plugin loading needed with older Qt +# QTPLUGIN += qsvg qtsensors_ios qtsensors_generic +} + ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android -- cgit v1.2.1