Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Set iOS device orientation programmatically. How?
Is there any way in QT set the device orientation programmatically or by force?
Gerhard last edited by
add the following entry in the .plist file
(sorry for my english)
@Gerhard The key word in my message PROGRAMMATICALLY OR BY FORCE. It's mean from code, not from application settings.
@bogong you'll need to call objective c code, but it should be possible
UIInterfaceOrientation currentOrientation = [UIApplication sharedApplication].statusBarOrientation; NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationPortrait]; [[UIDevice currentDevice] setValue:value forKey:@"orientation"]; [UIViewController attemptRotationToDeviceOrientation];
bogong last edited by bogong
@J-Hilk I know it. I've tried it. The orientation after this code detecting like you set. But QML interface not redrawing. It's working perfectly when I am using it in native Objective-C/Swift but QML interface not redrawing even appeared signal about changed orientation. Only after phisical changing orientation it's wrking. I've already spent 2 weeks for finding cause of it.
@J-Hilk but never the less - thx for reply. If, not if, when I get success with it - will publish example. Going to get next iteration of this issue tomorrow.