diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-03-24 13:15:54 +0000 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-05-07 13:48:08 +0000 |
commit | 3e12951c0b35041920989d6089ddb6c2f5c2d3d1 (patch) | |
tree | 6e4d691d4382fbc0b311fdbaf46ccec04ecdfe70 /src/gui/kernel/qscreen.cpp | |
parent | 5dcaa11cc26fabc4f4f1336681ac19217a9e0e91 (diff) |
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 <richard.gustavsen@qt.io>
Diffstat (limited to 'src/gui/kernel/qscreen.cpp')
-rw-r--r-- | src/gui/kernel/qscreen.cpp | 56 |
1 files changed, 9 insertions, 47 deletions
diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp index df628fcc73..3fd1548d04 100644 --- a/src/gui/kernel/qscreen.cpp +++ b/src/gui/kernel/qscreen.cpp @@ -113,11 +113,6 @@ void QScreenPrivate::setPlatformScreen(QPlatformScreen *screen) refreshRate = 60.0; updatePrimaryOrientation(); - - filteredOrientation = orientation; - if (filteredOrientation == Qt::PrimaryOrientation) - filteredOrientation = primaryOrientation; - updateHighDpi(); } @@ -511,57 +506,24 @@ QRect QScreen::availableVirtualGeometry() const } /*! - Sets the orientations that the application is interested in receiving - updates for in conjunction with this screen. - - For example, to receive orientation() updates and thus have - orientationChanged() signals being emitted for LandscapeOrientation and - InvertedLandscapeOrientation, call setOrientationUpdateMask() with - \a{mask} set to Qt::LandscapeOrientation | Qt::InvertedLandscapeOrientation. - - The default, 0, means no orientationChanged() signals are fired. -*/ -void QScreen::setOrientationUpdateMask(Qt::ScreenOrientations mask) -{ - Q_D(QScreen); - d->orientationUpdateMask = mask; - d->platformScreen->setOrientationUpdateMask(mask); - QGuiApplicationPrivate::updateFilteredScreenOrientation(this); -} - -/*! - Returns the currently set orientation update mask. - - \sa setOrientationUpdateMask() -*/ -Qt::ScreenOrientations QScreen::orientationUpdateMask() const -{ - Q_D(const QScreen); - return d->orientationUpdateMask; -} - -/*! \property QScreen::orientation \brief the screen orientation - The screen orientation represents the physical orientation - of the display. For example, the screen orientation of a mobile device - will change based on how it is being held. A change to the orientation - might or might not trigger a change to the primary orientation of the screen. + The \c orientation property tells the orientation of the screen from the + window system perspective. - Changes to this property will be filtered by orientationUpdateMask(), - so in order to receive orientation updates the application must first - call setOrientationUpdateMask() with a mask of the orientations it wants - to receive. + Most mobile devices and tablet computers contain accelerometer sensors. + The Qt Sensors module provides the ability to read this sensor directly. + However, the windowing system may rotate the entire screen automatically + based on how it is being held; in that case, this \c orientation property + will change. - Qt::PrimaryOrientation is never returned. - - \sa primaryOrientation() + \sa primaryOrientation(), QWindow::contentOrientation(), QOrientationSensor */ Qt::ScreenOrientation QScreen::orientation() const { Q_D(const QScreen); - return d->filteredOrientation; + return d->orientation; } /*! |