×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    56

    How to lock the app's orientation in Meego(use QT,not QML)

    I use QT 4.7.4,not QML
    I want to lock the orientation,but I don't know how to do.
    in Symbian, use setOrientation,but in Meego it doesn't work.

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: How to lock the app's orientation in Meego(use QT,not QML)

    Read this thread carefully. You might get some clue to implement it.

  3. #3
    Registered User
    Join Date
    Jan 2011
    Posts
    56

    Re: How to lock the app's orientation in Meego(use QT,not QML)

    I did this in main.cpp

    QApplication app(argc, argv);

    MainWindow mainWindow;
    Qt::WidgetAttribute symbianMaemoMeegoAttribute = Qt::WA_LockPortraitOrientation;
    mainWindow.setAttribute(symbianMaemoMeegoAttribute,true);
    mainWindow.showFullScreen();

    but the app is LandscapeOrientation and can't turn the orientation.

  4. #4
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Location
    Finland
    Posts
    327

    Re: How to lock the app's orientation in Meego(use QT,not QML)

    To repeat - QWidgets (and thus orientation handling through them) are not supported in MeeGo Harmattan. If you really want to make your life hard, you could use a workaround, like https://gitorious.org/harmattanwidge...tanwidgetproxy but QML the proper way to do it.

  5. #5
    Registered User
    Join Date
    Feb 2011
    Posts
    15

    Re: How to lock the app's orientation in Meego(use QT,not QML)

    Quote Originally Posted by achipa View Post
    To repeat - QWidgets (and thus orientation handling through them) are not supported in MeeGo Harmattan. If you really want to make your life hard, you could use a workaround, like https://gitorious.org/harmattanwidge...tanwidgetproxy but QML the proper way to do it.
    I downloaded that code and tested it in simulator -without replacing the default widget app with my own- and even if it's suppossed to have auto-rotation it doesn't work, it's in landscape mode only.

    I also modified this line in main.cpp:

    Code:
    viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    to

    Code:
    viewer->setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
    and again it only works in landscape mode. Am I missing something?

  6. #6
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: How to lock the app's orientation in Meego(use QT,not QML)

    Hi,
    Just for reference the article about that code is here:
    http://www.developer.nokia.com/Commu...d_applications

    It doesn't work on simulator because the screen is "fake" and there are no geometry changed events.
    It's a limitation which could be fixed. BTW it works fine on the device.

  7. #7
    Registered User
    Join Date
    Feb 2011
    Posts
    15

    Re: How to lock the app's orientation in Meego(use QT,not QML)

    Quote Originally Posted by gnuton View Post
    Hi,
    Just for reference the article about that code is here:
    http://www.developer.nokia.com/Commu...d_applications

    It doesn't work on simulator because the screen is "fake" and there are no geometry changed events.
    It's a limitation which could be fixed. BTW it works fine on the device.
    Thanks. Definetely, making a port for N9 is a little bizarre

Similar Threads

  1. Orientation problem in MeeGo Device
    By narendar_discover in forum Nokia N9
    Replies: 15
    Last Post: 2011-12-21, 12:42
  2. How to lock orientation in QML
    By nobody_gao@sina.com in forum [Archived] Qt Quick
    Replies: 3
    Last Post: 2011-07-28, 22:03
  3. how to lock orientation in meego with QT
    By linlin_0 in forum Nokia N9
    Replies: 3
    Last Post: 2010-11-16, 08:57

Posting Permissions

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