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
.....
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.