From 3e12951c0b35041920989d6089ddb6c2f5c2d3d1 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 24 Mar 2020 13:15:54 +0000 Subject: Remove QScreen::orientationUpdateMask It simplifies the API and reduces surprise to have rotation working by default. On Android, the manifest specifies which orientations the application has been designed to support; on iOS, it is controlled via the UISupportedInterfaceOrientations property list key. In addition, QWindow::contentOrientation() is another way to give a hint to the window manager, or on iOS to directly control whether the window's rotation is locked or not. Task-number: QTBUG-35427 Task-number: QTBUG-38576 Task-number: QTBUG-44569 Task-number: QTBUG-51012 Task-number: QTBUG-83055 Change-Id: Ieed818497f686399db23813269af322bfdd237af Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/qiosscreen.h | 1 - src/plugins/platforms/ios/qiosscreen.mm | 13 ++----------- 2 files changed, 2 insertions(+), 12 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/ios/qiosscreen.h b/src/plugins/platforms/ios/qiosscreen.h index d5a253461d..4f494815a9 100644 --- a/src/plugins/platforms/ios/qiosscreen.h +++ b/src/plugins/platforms/ios/qiosscreen.h @@ -73,7 +73,6 @@ public: Qt::ScreenOrientation nativeOrientation() const override; Qt::ScreenOrientation orientation() const override; - void setOrientationUpdateMask(Qt::ScreenOrientations mask) override; QPixmap grabWindow(WId window, int x, int y, int width, int height) const override; diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index 4dbb0a4cdf..406470ef8e 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -300,6 +300,8 @@ QIOSScreen::QIOSScreen(UIScreen *screen) } } + m_orientationListener = [[QIOSOrientationListener alloc] initWithQIOSScreen:this]; + updateProperties(); m_displayLink = [m_uiScreen displayLinkWithBlock:^(CADisplayLink *) { deliverUpdateRequests(); }]; @@ -520,17 +522,6 @@ Qt::ScreenOrientation QIOSScreen::orientation() const #endif } -void QIOSScreen::setOrientationUpdateMask(Qt::ScreenOrientations mask) -{ - if (m_orientationListener && mask == Qt::PrimaryOrientation) { - [m_orientationListener release]; - m_orientationListener = 0; - } else if (!m_orientationListener) { - m_orientationListener = [[QIOSOrientationListener alloc] initWithQIOSScreen:this]; - updateProperties(); - } -} - QPixmap QIOSScreen::grabWindow(WId window, int x, int y, int width, int height) const { if (window && ![reinterpret_cast(window) isKindOfClass:[UIView class]]) -- cgit v1.2.3