summaryrefslogtreecommitdiffstats
path: root/src/plugins/qnx/camera/bbcameraorientationhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/qnx/camera/bbcameraorientationhandler.cpp')
-rw-r--r--src/plugins/qnx/camera/bbcameraorientationhandler.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/plugins/qnx/camera/bbcameraorientationhandler.cpp b/src/plugins/qnx/camera/bbcameraorientationhandler.cpp
index b715249f9..393c9e6d8 100644
--- a/src/plugins/qnx/camera/bbcameraorientationhandler.cpp
+++ b/src/plugins/qnx/camera/bbcameraorientationhandler.cpp
@@ -41,7 +41,8 @@
#include "bbcameraorientationhandler.h"
#include <QAbstractEventDispatcher>
-#include <QCoreApplication>
+#include <QGuiApplication>
+#include <QScreen>
#include <QDebug>
#include <bps/orientation.h>
@@ -87,6 +88,10 @@ bool BbCameraOrientationHandler::nativeEventFilter(const QByteArray&, void *mess
const int angle = orientation_event_get_angle(event);
if (angle != m_orientation) {
+#ifndef Q_OS_BLACKBERRY_TABLET
+ if (angle == 180) // The screen does not rotate at 180 degrees
+ return false;
+#endif
m_orientation = angle;
emit orientationChanged(m_orientation);
}
@@ -94,6 +99,17 @@ bool BbCameraOrientationHandler::nativeEventFilter(const QByteArray&, void *mess
return false; // do not drop the event
}
+int BbCameraOrientationHandler::viewfinderOrientation() const
+{
+ // On a keyboard device we do not rotate the screen at all
+ if (qGuiApp->primaryScreen()->nativeOrientation()
+ != qGuiApp->primaryScreen()->primaryOrientation()) {
+ return m_orientation;
+ }
+
+ return 0;
+}
+
int BbCameraOrientationHandler::orientation() const
{
return m_orientation;