summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-02-01 13:02:36 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2011-02-01 13:02:36 (GMT)
commit0533cd3a773952490eb0e5686afb7b235799a13f (patch)
treea1f14fe42a51499666921d58a6a5b62f1f916d8e /src/gui/kernel/qwidget.cpp
parent9c132451acc7fbed1611fd3676cceb26e815f50d (diff)
parente5974b024828578945bd4c349f5f87f82a635225 (diff)
downloadQt-0533cd3a773952490eb0e5686afb7b235799a13f.zip
Qt-0533cd3a773952490eb0e5686afb7b235799a13f.tar.gz
Qt-0533cd3a773952490eb0e5686afb7b235799a13f.tar.bz2
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts: mkspecs/features/symbian/application_icon.prf src/sql/drivers/odbc/qsql_odbc.cpp
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r--src/gui/kernel/qwidget.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 547da11..475d4da 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -127,6 +127,10 @@
#include "qtabwidget.h" // Needed in inTabWidget()
#endif // QT_KEYPAD_NAVIGATION
+#ifdef Q_WS_S60
+#include <aknappui.h>
+#endif
+
// widget/widget data creation count
//#define QWIDGET_EXTRA_DEBUG
//#define ALIEN_DEBUG
@@ -10871,6 +10875,42 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
d->registerTouchWindow();
#endif
break;
+ case Qt::WA_LockPortraitOrientation:
+ case Qt::WA_LockLandscapeOrientation:
+ case Qt::WA_AutoOrientation: {
+ const Qt::WidgetAttribute orientations[3] = {
+ Qt::WA_LockPortraitOrientation,
+ Qt::WA_LockLandscapeOrientation,
+ Qt::WA_AutoOrientation
+ };
+
+ if (on) {
+ // We can only have one of these set at a time
+ for (int i = 0; i < 3; ++i) {
+ if (orientations[i] != attribute)
+ setAttribute_internal(orientations[i], false, data, d);
+ }
+ }
+
+#ifdef Q_WS_S60
+ CAknAppUiBase* appUi = static_cast<CAknAppUiBase*>(CEikonEnv::Static()->EikAppUi());
+ const CAknAppUiBase::TAppUiOrientation s60orientations[] = {
+ CAknAppUiBase::EAppUiOrientationPortrait,
+ CAknAppUiBase::EAppUiOrientationLandscape,
+ CAknAppUiBase::EAppUiOrientationAutomatic
+ };
+ CAknAppUiBase::TAppUiOrientation s60orientation = CAknAppUiBase::EAppUiOrientationUnspecified;
+ for (int i = 0; i < 3; ++i) {
+ if (testAttribute(orientations[i])) {
+ s60orientation = s60orientations[i];
+ break;
+ }
+ }
+ QT_TRAP_THROWING(appUi->SetOrientationL(s60orientation));
+ S60->orientationSet = true;
+#endif
+ break;
+ }
default:
break;
}