summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBernd Weimer <bweimer@rim.com>2012-10-04 13:16:46 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-20 11:46:05 +0200
commita37c2733b37857e1ca60d36653559c1528d72b64 (patch)
treed0da5e67451ed160b5717c4308046f43c3c75087 /src
parent1279045ab270cdd34af0a41aa7642593aa93d19b (diff)
Blackberry: implemented "orientation lock" widget attribute
Qt::WA_LockPortraitOrientation and Qt::WA_LockLandscapeOrientation will be adhered to. This is not needed in Qt5, as those attributes have been removed from Qt5. Change-Id: I5f29cad0e2c784caa6201b683d7b658a5b0d083d Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qwidget.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 43fe26cb0d..3a0261e88a 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -131,6 +131,10 @@
#include <aknappui.h>
#endif
+#ifdef Q_OS_BLACKBERRY
+#include <bps/navigator.h>
+#endif
+
// widget/widget data creation count
//#define QWIDGET_EXTRA_DEBUG
//#define ALIEN_DEBUG
@@ -11012,6 +11016,16 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
}
}
+#ifdef Q_OS_BLACKBERRY
+ if (testAttribute(Qt::WA_AutoOrientation)) {
+ navigator_rotation_lock(false);
+ } else {
+ navigator_set_orientation_mode((testAttribute(Qt::WA_LockPortraitOrientation) ?
+ NAVIGATOR_PORTRAIT : NAVIGATOR_LANDSCAPE), 0);
+ navigator_rotation_lock(true);
+ }
+#endif
+
#ifdef Q_WS_S60
CAknAppUiBase* appUi = static_cast<CAknAppUiBase*>(CEikonEnv::Static()->EikAppUi());
const CAknAppUiBase::TAppUiOrientation s60orientations[] = {