diff options
author | Rafael Roquetto <rafael.roquetto.qnx@kdab.com> | 2013-04-10 19:07:15 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-11 12:35:54 (GMT) |
commit | c0daaf1c701345b5e97684f9b564343ada3ad346 (patch) | |
tree | 9b4973a242b363a32f376e8748712cbf7db42ba9 /src | |
parent | 81fdb1725d38d9b73f09e5b98e690111a366234f (diff) | |
download | Qt-c0daaf1c701345b5e97684f9b564343ada3ad346.zip Qt-c0daaf1c701345b5e97684f9b564343ada3ad346.tar.gz Qt-c0daaf1c701345b5e97684f9b564343ada3ad346.tar.bz2 |
BlackBerry: Adjust rotation according to initial orientation
cherry-picked from qtbase f0425e115e5fe5d29191f0752659a28e9a4b6757
Task-number: QTBUG-29201
Change-Id: Iec31057749d98d66d43f13635da20d097756c8ea
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/blackberry/qbbintegration.cpp | 1 | ||||
-rw-r--r-- | src/plugins/platforms/blackberry/qbbscreen.cpp | 12 | ||||
-rw-r--r-- | src/plugins/platforms/blackberry/qbbscreen.h | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/platforms/blackberry/qbbintegration.cpp b/src/plugins/platforms/blackberry/qbbintegration.cpp index 5a6e6e2..8e04e2d 100644 --- a/src/plugins/platforms/blackberry/qbbintegration.cpp +++ b/src/plugins/platforms/blackberry/qbbintegration.cpp @@ -369,6 +369,7 @@ void QBBIntegration::createDisplay(screen_display_t display, int screenIndex) { QBBScreen *screen = new QBBScreen(mContext, display, screenIndex); mScreens.append(screen); + screen->adjustOrientation(); QObject::connect(mScreenEventHandler, SIGNAL(newWindowCreated(screen_window_t)), screen, SLOT(newWindowCreated(screen_window_t))); diff --git a/src/plugins/platforms/blackberry/qbbscreen.cpp b/src/plugins/platforms/blackberry/qbbscreen.cpp index 9edd204..997535e 100644 --- a/src/plugins/platforms/blackberry/qbbscreen.cpp +++ b/src/plugins/platforms/blackberry/qbbscreen.cpp @@ -493,6 +493,18 @@ void QBBScreen::onWindowPost(QBBWindow* window) } } +void QBBScreen::adjustOrientation() +{ + if (!mPrimaryDisplay) + return; + + bool ok = false; + const int rotation = qgetenv("ORIENTATION").toInt(&ok); + + if (ok) + setRotation(rotation); +} + QPlatformCursor * QBBScreen::cursor() const { return mCursor; diff --git a/src/plugins/platforms/blackberry/qbbscreen.h b/src/plugins/platforms/blackberry/qbbscreen.h index a5a8e32..7b03387 100644 --- a/src/plugins/platforms/blackberry/qbbscreen.h +++ b/src/plugins/platforms/blackberry/qbbscreen.h @@ -83,6 +83,7 @@ public: void updateHierarchy(); void onWindowPost(QBBWindow* window); + void adjustOrientation(); void ensureDisplayCreated(); QSharedPointer<QBBRootWindow> rootWindow() const { return mRootWindow; } |