QNX: Adjust rotation according to initial orientation

Task-number: QTBUG-29201

Change-Id: I37e82904e0f3d8b372b31ee7d1379e61c788c622
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
This commit is contained in:
Rafael Roquetto 2013-04-08 11:25:08 -03:00 committed by The Qt Project
parent 4d7f0ce8d0
commit f0425e115e
3 changed files with 14 additions and 0 deletions

View File

@ -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*)));

View File

@ -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;

View File

@ -92,6 +92,7 @@ public:
void updateHierarchy();
void onWindowPost(QQnxWindow *window);
void adjustOrientation();
QSharedPointer<QQnxRootWindow> rootWindow() const;