diff options
Diffstat (limited to 'src/plugins/platforms/qnx')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxscreen.cpp | 18 | ||||
-rw-r--r-- | src/plugins/platforms/qnx/qqnxscreen.h | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index e788ce94a2..f33de5be21 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -140,6 +140,24 @@ int QQnxScreen::depth() const return defaultDepth(); } +qreal QQnxScreen::refreshRate() const +{ + screen_display_mode_t displayMode; + int result = screen_get_display_property_pv(m_display, SCREEN_PROPERTY_MODE, reinterpret_cast<void **>(&displayMode)); + if (result != 0) { + qWarning("QQnxScreen: Failed to query screen mode. Using default value of 60Hz"); + return 60.0; + } +#if defined(QQNXSCREEN_DEBUG) + qDebug() << Q_FUNC_INFO << "screen mode:" << endl + << " width =" << displayMode.width << endl + << " height =" << displayMode.height << endl + << " refresh =" << displayMode.refresh << endl + << " interlaced =" << displayMode.interlaced; +#endif + return static_cast<qreal>(displayMode.refresh); +} + Qt::ScreenOrientation QQnxScreen::orientation() const { Qt::ScreenOrientation orient; diff --git a/src/plugins/platforms/qnx/qqnxscreen.h b/src/plugins/platforms/qnx/qqnxscreen.h index e7866b5136..e34723c774 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.h +++ b/src/plugins/platforms/qnx/qqnxscreen.h @@ -68,6 +68,8 @@ public: QImage::Format format() const { return (depth() == 32) ? QImage::Format_RGB32 : QImage::Format_RGB16; } QSizeF physicalSize() const { return m_currentPhysicalSize; } + qreal refreshRate() const; + Qt::ScreenOrientation orientation() const; bool isPrimaryScreen() const { return m_primaryScreen; } |