From c66b7cf55b6913dcf33d49d4f6bf9db51ccf39a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 4 Oct 2011 13:11:30 +0200 Subject: Added Orientation API to QScreen and QWindow. QScreen now has a primary and current orientation, and a QWindow can set its orientation as well. The current screen orientation is just a hint to the application. Change-Id: I4635982cfac2d16634d4edd5c6ab78e9d0ac55a4 Reviewed-on: http://codereview.qt-project.org/5988 Reviewed-by: Paul Olav Tvete Sanity-Review: Qt Sanity Bot Reviewed-by: Lars Knoll --- src/gui/kernel/qscreen.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/gui/kernel/qscreen.h') diff --git a/src/gui/kernel/qscreen.h b/src/gui/kernel/qscreen.h index 72681eb6da..2d075cfc5e 100644 --- a/src/gui/kernel/qscreen.h +++ b/src/gui/kernel/qscreen.h @@ -48,6 +48,10 @@ #include #include +#include + +#include + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -93,10 +97,21 @@ public: QSize availableVirtualSize() const; QRect availableVirtualGeometry() const; + Qt::ScreenOrientation primaryOrientation() const; + Qt::ScreenOrientation currentOrientation() const; + + static int angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b); + static QTransform transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target); + static QRect mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect); + +Q_SIGNALS: + void currentOrientationChanged(Qt::ScreenOrientation orientation); + private: QScreen(QPlatformScreen *screen); Q_DISABLE_COPY(QScreen) + friend class QGuiApplicationPrivate; friend class QPlatformScreen; }; -- cgit v1.2.3