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.
See the application in action on youtube: The media player is loading...
Testing the application
The example is meant to be run either on a symbian device or in the simulator of the Nokia Qt SDK.
Because of the usage of sensors from the QtMobility-APIs, ReadDeviceData-capability is needed on symbian. This capability cannot be granted to a self signed application. Use Symbian signed online to test.
As soon as Nokia publishes an official API to lock the screen orientation and thus disabling auto rotation, the example will be updated and then also work on maemo/maego. Currently there is still a bit of native code to lock screen orientation on Symbian. No such code is provided for Maemo.
|29 March 2010||Initial version that was submitted to the QtMobility-contest. This one was actually not using QtMobility but the so called "Mobile Extensions"|
|1 August 2010||Updated version that now uses the new sensor API from QtMobility|
|19 September 2010||Updated version that no longer uses an own emulator because simulator from Nokia Qt SDK from version 1.0.1 supports setting orientations when using the scripts provided here https://bugreports.qt-project.org/browse/QTSIM-63|