summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Bumberger <fbumberger@rim.com>2014-03-25 14:30:18 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-27 14:41:11 +0100
commit38fc11b74bfb0aca467c1f240af30d4dfbfed642 (patch)
treee22960506dc5f7f6e3130761cb8eec33c301a421
parentf16d690a2f8c6ff1830a15794950c8564ae18a29 (diff)
QNX: Retrieve name of the display
Task-number: QTBUG-34545 Change-Id: I51d36c7352351b0770a1a076bdcc738677d7fcb6 Reviewed-by: Bernd Weimer <bweimer@blackberry.com> Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.cpp5
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.h3
2 files changed, 8 insertions, 0 deletions
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;