Hello:
I was scanning the docs and stack exchange and everywhere and could not find an example of how to lock a screen to Portrait ONLY in Qt Code. I tried to lock my Galaxy S2 smartphone to portrait only by issuing: QScreen* gs = QGuiApplication::primaryScreen() ; gs->setOrientationUpdateMask(Qt::PortraitOrientation | Qt::InvertedPortraitOrientation) ; But the screen still rotates. The only thing that appears to happen is that I do not get any valid landscape orientation information, QScreen::orientation() only returns QT:PortraitOrientation after the setting the mask. And when I wanted to restore the Qt App to allow all orientations: gs->setOrientationUpdateMask(Qt::PortraitOrientation | Qt::LandscapeOrientation | Qt::InvertedPortraitOrientation | Qt::InvertedLandscapeOrientation) ; Now, what will NOT work is setting values and Manifest.xml or Info.plist to universally prevent orientation changes on all IOS/ANDROID devices. I am only looking to lock to portrait on specific types of devices, not all IOS/ANDROID devices. Outside of going to the Native Android: public void setRequestedOrientation (int requestedOrientation) Or Native IOS: supportedInterfaceOrientation Anybody have some ideas? And of course, windows Tablets and smartphones! (That is for later) Thanks for any responses. md
_______________________________________________ Interest mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/interest
