Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-11785

Fix chasm between Symbian and Maemo (auto)-rotation handing

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • P1: Critical
    • 4.7.2
    • 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:

      1. Alias WA_Maemo5AutoOrientation, etc to WA_AutoOrientation, etc (without "Maemo5") and deprecate the former.
      2. Make the flags work on Symbian using the native API.

      Attachments

        1. orient.diff
          4 kB
          Murray Read

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              mread Murray Read
              dmolkent Daniel Molkentin (Inactive Nokia Account!) (Inactive)
              Votes:
              9 Vote for this issue
              Watchers:
              20 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes