diff options
author | Bernd Weimer <bweimer@rim.com> | 2012-10-04 11:16:46 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-20 09:46:05 (GMT) |
commit | a37c2733b37857e1ca60d36653559c1528d72b64 (patch) | |
tree | d0da5e67451ed160b5717c4308046f43c3c75087 /src/gui | |
parent | 1279045ab270cdd34af0a41aa7642593aa93d19b (diff) | |
download | Qt-a37c2733b37857e1ca60d36653559c1528d72b64.zip Qt-a37c2733b37857e1ca60d36653559c1528d72b64.tar.gz Qt-a37c2733b37857e1ca60d36653559c1528d72b64.tar.bz2 |
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/gui')
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 43fe26c..3a0261e 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[] = { |