summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformscreen_qpa.cpp
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens.qnx@kdab.com>2012-05-25 10:30:52 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-05 16:01:29 +0200
commit99b3a15dcf2075806390ac2c9e259af31b0ad402 (patch)
tree017a4b8677c1162ec118d4eb6305c36a39db4267 /src/gui/kernel/qplatformscreen_qpa.cpp
parent24aad8d663834d484438c19a433f19d7c044e828 (diff)
Introduce nativeOrientation() to QPlatformScreen
Now QPlatformScreen has a nativeOrientation() method which default implementation return Qt::PrimaryOrientation. Its purpose is to return the native orientation of the device (e.g. when the device logo is right up). Only the QPA backend can know for sure what this native orientation is, so allow QPA backends to override it with a finer result. Change-Id: I3bef14acb6b8568e64398ff919d9cb4461a2c9cc Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui/kernel/qplatformscreen_qpa.cpp')
-rw-r--r--src/gui/kernel/qplatformscreen_qpa.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformscreen_qpa.cpp b/src/gui/kernel/qplatformscreen_qpa.cpp
index e40550a633..fdb5d32687 100644
--- a/src/gui/kernel/qplatformscreen_qpa.cpp
+++ b/src/gui/kernel/qplatformscreen_qpa.cpp
@@ -172,6 +172,18 @@ qreal QPlatformScreen::refreshRate() const
}
/*!
+ Reimplement this function in subclass to return the native orientation
+ of the screen, e.g. the orientation where the logo sticker of the device
+ appears the right way up.
+
+ The default implementation returns Qt::PrimaryOrientation.
+*/
+Qt::ScreenOrientation QPlatformScreen::nativeOrientation() const
+{
+ return Qt::PrimaryOrientation;
+}
+
+/*!
Reimplement this function in subclass to return the current orientation
of the screen, for example based on accelerometer data to determine
the device orientation.