From f0425e115e5fe5d29191f0752659a28e9a4b6757 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Mon, 8 Apr 2013 11:25:08 -0300 Subject: QNX: Adjust rotation according to initial orientation Task-number: QTBUG-29201 Change-Id: I37e82904e0f3d8b372b31ee7d1379e61c788c622 Reviewed-by: Thomas McGuire Reviewed-by: Kevin Krammer --- src/plugins/platforms/qnx/qqnxintegration.cpp | 1 + src/plugins/platforms/qnx/qqnxscreen.cpp | 12 ++++++++++++ src/plugins/platforms/qnx/qqnxscreen.h | 1 + 3 files changed, 14 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp index 5ea4fef698..4cbbfa4da8 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.cpp +++ b/src/plugins/platforms/qnx/qqnxintegration.cpp @@ -486,6 +486,7 @@ void QQnxIntegration::createDisplay(screen_display_t display, bool isPrimary) QQnxScreen *screen = new QQnxScreen(m_screenContext, display, isPrimary); m_screens.append(screen); screenAdded(screen); + screen->adjustOrientation(); QObject::connect(m_screenEventHandler, SIGNAL(newWindowCreated(void*)), screen, SLOT(newWindowCreated(void*))); diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index 7614abdc6a..2b81559ab6 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -498,6 +498,18 @@ void QQnxScreen::onWindowPost(QQnxWindow *window) } } +void QQnxScreen::adjustOrientation() +{ + if (!m_primaryScreen) + return; + + bool ok = false; + const int rotation = qgetenv("ORIENTATION").toInt(&ok); + + if (ok) + setRotation(rotation); +} + QPlatformCursor * QQnxScreen::cursor() const { return m_cursor; diff --git a/src/plugins/platforms/qnx/qqnxscreen.h b/src/plugins/platforms/qnx/qqnxscreen.h index 41dc675599..98f2a90fbc 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.h +++ b/src/plugins/platforms/qnx/qqnxscreen.h @@ -92,6 +92,7 @@ public: void updateHierarchy(); void onWindowPost(QQnxWindow *window); + void adjustOrientation(); QSharedPointer rootWindow() const; -- cgit v1.2.3