From 38fc11b74bfb0aca467c1f240af30d4dfbfed642 Mon Sep 17 00:00:00 2001 From: Fabian Bumberger Date: Tue, 25 Mar 2014 14:30:18 +0100 Subject: QNX: Retrieve name of the display Task-number: QTBUG-34545 Change-Id: I51d36c7352351b0770a1a076bdcc738677d7fcb6 Reviewed-by: Bernd Weimer Reviewed-by: Sergio Ahumada --- src/plugins/platforms/qnx/qqnxscreen.cpp | 5 +++++ src/plugins/platforms/qnx/qqnxscreen.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index a6c69164c7..2707f14db2 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -177,6 +177,11 @@ QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display, m_currentGeometry = m_initialGeometry = QRect(0, 0, val[0], val[1]); + char name[100]; + Q_SCREEN_CHECKERROR(screen_get_display_property_cv(m_display, SCREEN_PROPERTY_ID_STRING, 100, + name), "Failed to query display name"); + m_name = QString::fromUtf8(name); + // Cache size of this display in millimeters. We have to take care of the orientation. // libscreen always reports the physical size dimensions as width and height in the // native orientation. Contrary to this, QPlatformScreen::physicalSize() expects the diff --git a/src/plugins/platforms/qnx/qqnxscreen.h b/src/plugins/platforms/qnx/qqnxscreen.h index d39a210d4b..a0b760135f 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.h +++ b/src/plugins/platforms/qnx/qqnxscreen.h @@ -77,6 +77,8 @@ public: int rotation() const { return m_currentRotation; } + QString name() const { return m_name; } + int nativeFormat() const { return (depth() == 32) ? SCREEN_FORMAT_RGBA8888 : SCREEN_FORMAT_RGB565; } screen_display_t nativeDisplay() const { return m_display; } screen_context_t nativeContext() const { return m_screenContext; } @@ -132,6 +134,7 @@ private: int m_initialRotation; int m_currentRotation; int m_keyboardHeight; + QString m_name; QSize m_initialPhysicalSize; QSize m_currentPhysicalSize; Qt::ScreenOrientation m_nativeOrientation; -- cgit v1.2.3