×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    9

    Lock screen to landscape using Qt

    Hello,

    i am wondering is it possible to lock screen to landscape mode using only Qt without additional Symbian C code?

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Lock screen to landscape using Qt

    Normally you do it trough QWidget::setAttribute
    http://doc.qt.nokia.com/qt-maemo-4.6...-rotation.html
    But I'm pretty sure it won't work on Symbian.

  3. #3
    Registered User
    Join Date
    Dec 2007
    Location
    Oslo
    Posts
    12

    Re: Lock screen to landscape using Qt

    There is currently no cross-platform API to do this in Qt so have to use the same code that you would use for Avkon.

  4. #4
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: Lock screen to landscape using Qt

    Must use native. Sample like this:
    Code:
    QtBallZ::QtBallZ(QWidget *parent)
        : QMainWindow(parent)
    {
    	ui.setupUi(this);
    	
    	myForm=this;
    	myMovingMouse=false;
    	
        // lock orientation
        #ifdef TMGN_SYMBIAN_5
        CAknAppUi* appUi = dynamic_cast<CAknAppUi*>(CEikonEnv::Static()->AppUi());
        if(appUi){
            QT_TRAP_THROWING(appUi ->SetOrientationL( CAknAppUi::EAppUiOrientationLandscape));
        }
        #endif
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  5. #5
    Registered User
    Join Date
    Mar 2010
    Posts
    9

    Re: Lock screen to landscape using Qt

    Well this example is quite easy to google the question was is it possible to do it. If, for example, sombody wishes code working on Symbian4 and MeeGo.

    So as i get it currently it is impossible?

  6. #6
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Lock screen to landscape using Qt

    Then you should be using conditionally compiled code
    Code:
     #ifdef Q_OS_SYMBIAN
        ...
     #else
       ...
     #endif

  7. #7
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Lock screen to landscape using Qt

    And build under Carbide.

  8. #8
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: Lock screen to landscape using Qt

    Hi,
    nope, there is no generic way for now. I am sorry...
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  9. #9
    Registered User
    Join Date
    Nov 2009
    Posts
    4

    Re: Lock screen to landscape using Qt

    Hi,
    does anybody know if there is a way to lock the orientation on Windows Mobile?
    I'm working on an application that has a fixed layout and cannot be rotated.

    It works for Symbian because I used
    #ifdef Q_OS_SYMBIAN
    CAknAppUi* appUi = dynamic_cast<CAknAppUi*>(CEikonEnv::Static()->AppUi());
    if(appUi){
    QT_TRAP_THROWING(appUi ->SetOrientationL( CAknAppUi::EAppUiOrientationPortrait));
    }
    #else
    ... ??
    #endif

    How can I lock the orientation

  10. #10
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Lock screen to landscape using Qt

    I'd suggest you ask on a Windows Mobile forum.

Similar Threads

  1. Splash Screen Landscape on N97 fails to display
    By hclement2 in forum Mobile Java General
    Replies: 10
    Last Post: 2010-04-18, 07:34
  2. Replies: 2
    Last Post: 2009-05-12, 05:24
  3. Replies: 16
    Last Post: 2009-04-13, 11:31
  4. Screen Mode from portrait to landscape
    By rami75lu in forum Symbian User Interface
    Replies: 0
    Last Post: 2008-10-15, 04:57
  5. How to find screen layout(landscape/potrait)
    By TheLittleBird in forum Symbian
    Replies: 1
    Last Post: 2006-12-15, 13:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×