Namespaces
Variants
Actions
(Difference between revisions)

QtOrientationTest

Jump to: navigation, search
(Finalize)
(Updated to reflect changes in package: Now uses QtMobility)
Line 12: Line 12:
 
The QtOrientationTest shows shows how to obtain the device orientation and adopt the user interface accordingly. An arrow is shown on the display that is pointing "upwards". If the device is flat on the table or face down, either a circle with a dot or a cross is shown, meaning you look to the pointy end of the arrow or from the back to the fletchings.
 
The QtOrientationTest shows shows how to obtain the device orientation and adopt the user interface accordingly. An arrow is shown on the display that is pointing "upwards". If the device is flat on the table or face down, either a circle with a dot or a cross is shown, meaning you look to the pointy end of the arrow or from the back to the fletchings.
  
The example currently uses the deprecated so called  "[[Mobile_Extensions|Qt Mobile Extensions]]" and should be ported to the new sensor-API of the "QtMobility-APIs".  
+
The original version of this example used the deprecated so called  "[[Mobile_Extensions|Qt Mobile Extensions]]" but has been updated now to the new Qt Mobility-APIs. As soon as the emulator of the new Nokia Qt SDK is capable of simulating all orientations of QOrientationSensor, the example will be updated again and will no longer bring its own simulator.
  
 
=In action=
 
=In action=
Line 23: Line 23:
 
When compiled as a desktop application, a stub implementation of the sensor API is used that shows a window with 6 buttons to set the orientation.
 
When compiled as a desktop application, a stub implementation of the sensor API is used that shows a window with 6 buttons to set the orientation.
  
Because of the usage of XQDeviceOrienation-class from the mobile extensions, ReadDeviceData-capability is needed. This capability cannot be granted to a self signed application. Use symbian signed online to test.
+
Because of the usage of sensors from the QtMobility-APIs, ReadDeviceData-capability is needed. This capability cannot be granted to a self signed application. Use symbian signed online to test.
  
 
==Download Code Example==
 
==Download Code Example==

Revision as of 01:54, 2 August 2010

Article Metadata

Tested with
Devices(s): Nokia 5800 XpressMusic, Nokia N97 mini

Compatibility
Platform(s): S60 5th Edition

Article
Keywords: Orientation, Sensor, Accelerometer
Created: (29 Mar 2010)
Last edited: axeljaeger (02 Aug 2010)

Contents

Overview

The QtOrientationTest shows shows how to obtain the device orientation and adopt the user interface accordingly. An arrow is shown on the display that is pointing "upwards". If the device is flat on the table or face down, either a circle with a dot or a cross is shown, meaning you look to the pointy end of the arrow or from the back to the fletchings.

The original version of this example used the deprecated so called "Qt Mobile Extensions" but has been updated now to the new Qt Mobility-APIs. As soon as the emulator of the new Nokia Qt SDK is capable of simulating all orientations of QOrientationSensor, the example will be updated again and will no longer bring its own simulator.

In action

See the application in action on youtube:


Testing the application

The example is either be meant to be compiled directly for the device or as a desktop application. When compiled for the device, the real sensor API is used. When compiled as a desktop application, a stub implementation of the sensor API is used that shows a window with 6 buttons to set the orientation.

Because of the usage of sensors from the QtMobility-APIs, ReadDeviceData-capability is needed. This capability cannot be granted to a self signed application. Use symbian signed online to test.

Download Code Example

File:Orientationtest.zip

165 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved