diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-03-25 00:19:42 +0000 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-05-08 11:08:40 +0100 |
commit | b97a2de222c8d51430b3e9281ff181361cb7ea14 (patch) | |
tree | facb34889a24c1a133185c2ba469b36540b14b0d /src/quick/items/qquickscreen.cpp | |
parent | 1fc230c774ff599d14a40682c74f09118db04b2f (diff) |
Remove Screen.orientationUpdateMask
Now Screen.orientation works by default rather than filtering by default.
Task-number: QTBUG-83055
Change-Id: I0f49499ec25ceeebf19bc8ef1adc259023f1bc75
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/quick/items/qquickscreen.cpp')
-rw-r--r-- | src/quick/items/qquickscreen.cpp | 62 |
1 files changed, 11 insertions, 51 deletions
diff --git a/src/quick/items/qquickscreen.cpp b/src/quick/items/qquickscreen.cpp index ed2d7eda3e..9a2799ae96 100644 --- a/src/quick/items/qquickscreen.cpp +++ b/src/quick/items/qquickscreen.cpp @@ -213,18 +213,16 @@ QT_BEGIN_NAMESPACE \qmlattachedproperty Qt::ScreenOrientation Screen::orientation \readonly - This contains the current orientation of the screen, from the accelerometer - (if any). On a desktop computer, this value typically does not change. - - If primaryOrientation == orientation, it means that the screen - automatically rotates all content which is displayed, depending on how you - hold it. But if orientation changes while primaryOrientation does NOT - change, then probably you are using a device which does not rotate its own - display. In that case you may need to use \l {Item::rotation}{Item.rotation} or - \l {Item::transform}{Item.transform} to rotate your content. - - \note This property does not update unless a Screen::orientationUpdateMask - is set to a value other than \c 0. + This contains the current orientation of the screen from the + window system perspective. + + 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, or manually via settings to rotate a desktop + monitor; in that case, this \c orientation property will change. + + \sa primaryOrientation(), QWindow::contentOrientation(), QOrientationSensor */ /*! \qmlattachedmethod int Screen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b) @@ -233,16 +231,6 @@ QT_BEGIN_NAMESPACE orientations \a a and \a b. */ -/*! - \qmlattachedproperty Qt::ScreenOrientations Screen::orientationUpdateMask - \since 5.4 - - This contains the update mask for the orientation. Screen::orientation - only emits changes for the screen orientations matching this mask. - - By default it is set to the value of the QScreen that the window uses. -*/ - QQuickScreenInfo::QQuickScreenInfo(QObject *parent, QScreen *wrappedScreen) : QObject(parent) , m_screen(wrappedScreen) @@ -442,25 +430,6 @@ QQuickScreenAttached::QQuickScreenAttached(QObject* attachee) screenChanged(QGuiApplication::primaryScreen()); } -Qt::ScreenOrientations QQuickScreenAttached::orientationUpdateMask() const -{ - return m_updateMask; -} - -void QQuickScreenAttached::setOrientationUpdateMask(Qt::ScreenOrientations mask) -{ - m_updateMaskSet = true; - if (m_updateMask == mask) - return; - - m_updateMask = mask; - - if (m_screen) - m_screen->setOrientationUpdateMask(m_updateMask); - - emit orientationUpdateMaskChanged(); -} - int QQuickScreenAttached::angleBetween(int a, int b) { if (!m_screen) @@ -481,17 +450,8 @@ void QQuickScreenAttached::windowChanged(QQuickWindow* c) void QQuickScreenAttached::screenChanged(QScreen *screen) { //qDebug() << "QQuickScreenAttached::screenChanged" << (screen ? screen->name() : QString::fromLatin1("null")); - if (screen != m_screen) { + if (screen != m_screen) setWrappedScreen(screen); - if (!m_screen) - return; - if (m_updateMaskSet) { - m_screen->setOrientationUpdateMask(m_updateMask); - } else if (m_updateMask != m_screen->orientationUpdateMask()) { - m_updateMask = m_screen->orientationUpdateMask(); - emit orientationUpdateMaskChanged(); - } - } } QT_END_NAMESPACE |