×

Discussion Board

Results 1 to 2 of 2

Hybrid View

  1. #1
    Regular Contributor
    Join Date
    Feb 2012
    Posts
    124

    QML - Change orientation lock dynamically

    Please tell me how to dynamically change the orientation lock in a QML file!

    I have an app with a portrait lock, but whenever I call the in app purchase API my portrait lock gets gets overridden for the entire app.
    Can someone please tell me how to re-lock my app to portrait?

    Currently I set the portrait lock 2 ways.
    in main.cpp I do this to ensure that my splash screen is portrait locked:
    view.setAttribute(Qt::WA_LockPortraitOrientation);

    In each QML file I have a page and I do this:
    Page {
    id: iapPurchasePage
    orientationLock: PageOrientation.LockPortrait
    .....
    Last edited by CLTSchwarz; 2013-02-12 at 13:05.

  2. #2
    Regular Contributor
    Join Date
    Feb 2012
    Posts
    124

    Re: QML - Change orientation lock dynamically

    The pages orientation is still set to portrait even after the orientation lock is destroyed. Now I am using the "screen" element to tell if the phone has been rotated but it won't tell me until the second rotate attempt. QML seems completely oblivious to the rotation when it happens the first time.
    I'm going to have to experiment with detecting the rotation with C++. Any pointers? Anyone solved this problem before? Thanks.

Similar Threads

  1. 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
  2. Lock Orientation
    By Joe_Nokia in forum Nokia Asha Web Apps
    Replies: 1
    Last Post: 2011-06-20, 05:16
  3. Lock orientation change in N97
    By darshan.gandhi in forum Symbian User Interface
    Replies: 7
    Last Post: 2010-08-09, 04:50

Posting Permissions

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