From 80653bf4ce8d03f4af2fe8cc2f3751d32bd31d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 5 Jun 2012 14:17:24 +0200 Subject: Added QScreen::setOrientationUpdateMask(). It might be too expensive to always have an accelerometer sensor running, so introduce API so that the application has to explictly ask to get the orientation updates it's interested in. Change-Id: Ib7dc5ad8807718409f744ebef53f4476aa05175d Reviewed-by: Ian Monroe Reviewed-by: Sean Harmer Reviewed-by: Gunnar Sletta Reviewed-by: Kevin Ottens --- src/gui/kernel/qscreen_p.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/gui/kernel/qscreen_p.h') diff --git a/src/gui/kernel/qscreen_p.h b/src/gui/kernel/qscreen_p.h index b0e1b8671a..ca29acdd08 100644 --- a/src/gui/kernel/qscreen_p.h +++ b/src/gui/kernel/qscreen_p.h @@ -58,6 +58,7 @@ class QScreenPrivate : public QObjectPrivate public: QScreenPrivate(QPlatformScreen *screen) : platformScreen(screen) + , orientationUpdateMask(0) { orientation = screen->orientation(); geometry = screen->geometry(); @@ -66,18 +67,24 @@ public: refreshRate = screen->refreshRate(); updatePrimaryOrientation(); + + filteredOrientation = orientation; + if (filteredOrientation == Qt::PrimaryOrientation) + filteredOrientation = primaryOrientation; } void updatePrimaryOrientation(); + QPlatformScreen *platformScreen; + + Qt::ScreenOrientations orientationUpdateMask; Qt::ScreenOrientation orientation; + Qt::ScreenOrientation filteredOrientation; Qt::ScreenOrientation primaryOrientation; QRect geometry; QRect availableGeometry; QDpi logicalDpi; qreal refreshRate; - - QPlatformScreen *platformScreen; }; QT_END_NAMESPACE -- cgit v1.2.3