Details
-
Task
-
Resolution: Done
-
P1: Critical
-
None
-
None
-
None
-
e0489b905d6a31c7a904ca2b62a1e60cd12dba4f
Description
right now, Maemo5 and Symbian have different approaches to handle auto-rotation:
For Maemo5, see http://doc.qt.nokia.com/qt-maemo-4.6/maemo5-rotation.html. The auto-rotation must be requested explicitly, by means of setting WA_Maemo5AutoOrientation, or WA_Maemo5LandscapeOrientation and WA_Maemo5PortraitOrientation respectively. Default is landscape mode.
For Symbian, there is no such API at all. Instead, the device does auto-rotation, which can only be disabled by means of native code. The following is from http://discussion.forum.nokia.com/forum/showthread.php?196776-moved-Disable-auto-rotate-of-a-Qt-C-S60-application&p=719047 :
#ifdef Q_OS_SYMBIAN // For "lock orientation" below #include <AknAppUi.h> // Need libs avkon cone eiksrv #endif int main(int argc, char *argv[]) { QApplication a(argc, argv); #ifdef Q_OS_SYMBIAN // lock orientation CAknAppUi* appUi = dynamic_cast<CAknAppUi*>(CEikonEnv::Static()->AppUi()); if(appUi){ QT_TRAP_THROWING(appUi ->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape)); } #endif ...
Using native code however is not an option with the Nokia Qt SDK, which does not gurantee native APIs to be available to the developers. Therefore, I propose the following fix to be introduced asap:
- Alias WA_Maemo5AutoOrientation, etc to WA_AutoOrientation, etc (without "Maemo5") and deprecate the former.
- Make the flags work on Symbian using the native API.
Attachments
Issue Links
- is required for
-
QTCREATORBUG-3598 Wizard templates: use new Qt api of rotation lock. (Avoid Avkon)
- Closed
-
QTBUG-16972 Make widget orientation work reasonably on Symbian
- Closed