View Single Post
Venemo's Avatar
Posts: 1,296 | Thanked: 1,773 times | Joined on Aug 2009 @ Budapest, Hungary
#4
Originally Posted by Dotblank View Post
I seem to be having an issue with auto-rotation not affecting dialogs or other widgets immediately.

Following the concept in this example for qt4
http://doc.trolltech.com/qt-maemo-4....-rotation.html

[...]

I have to set the dialog widget attribute to WA_Maemo5AutoOrientation otherwise it is always landscape mode.

I think the issue is that when a widget gets the auto rotation flag set it re-initializes the accelerometer taking time and defaults to landscape when it doesn't have any data from the sensor yet.
Hi!

Actually, the auto rotation in Qt has a bug (QtBug 11190) that makes it work incorrectly.

For a working auto-rotation sample, check out the QMaemo5Rotator class in my repo. (header, cpp)

Just copy-paste the code files. It is dead easy to use.

Code:
QMaemo5Rotator *rotator = new QMaemo5Rotator(QMaemo5Rotator::AutomaticBehavior, this);
You can change its behaviour in runtime.

Last edited by Venemo; 2010-06-20 at 20:09.
 

The Following 2 Users Say Thank You to Venemo For This Useful Post: