|
2010-06-20
, 07:19
|
Posts: 180 |
Thanked: 76 times |
Joined on May 2010
|
#2
|
|
2010-06-20
, 18:29
|
Posts: 94 |
Thanked: 253 times |
Joined on Jan 2010
@ Virginia
|
#3
|
|
2010-06-20
, 20:06
|
|
Posts: 1,296 |
Thanked: 1,773 times |
Joined on Aug 2009
@ Budapest, Hungary
|
#4
|
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.
QMaemo5Rotator *rotator = new QMaemo5Rotator(QMaemo5Rotator::AutomaticBehavior, this);
|
2010-06-20
, 20:53
|
Posts: 94 |
Thanked: 253 times |
Joined on Jan 2010
@ Virginia
|
#5
|
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.
You can change its behaviour in runtime.Code:QMaemo5Rotator *rotator = new QMaemo5Rotator(QMaemo5Rotator::AutomaticBehavior, this);
|
2010-07-20
, 17:53
|
Posts: 2 |
Thanked: 0 times |
Joined on Jul 2010
|
#6
|
rotator = new QMaemo5Rotator(QMaemo5Rotator::AutomaticBehavior, this);
rotator->setCurrentBehavior(QMaemo5Rotator::PortraitBehavior);
if(_currentBehavior != QMaemo5Rotator::AutomaticBehavior) return;
|
2011-11-05
, 12:24
|
Posts: 1,100 |
Thanked: 2,797 times |
Joined on Apr 2011
@ Netherlands
|
#7
|
osso_context_t *osso; osso = osso_initialize("appname", "", TRUE, NULL); osso_cp_plugin_execute(osso, "libcpdatetime.so", this, TRUE);
Following the concept in this example for qt4
http://doc.trolltech.com/qt-maemo-4....-rotation.html
I have implemented a widget that has auto-rotation. That works and performs fine but when I create a dialog window the rotation is almost random.
When the dialog pops up sometimes it rotates back into landscape and after a small period of time if you re-rotate the n900 it rotates the dialog back to portrait. I have tried getting around this but the only workaround would be me implementing the sensors api in qt mobility.
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.
Last edited by Dotblank; 2010-06-20 at 21:23.