diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-12-05 00:22:05 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-12-11 21:17:34 +0000 |
commit | 3d720f38faec4c1c600e128d5d8da5a4435ec1ae (patch) | |
tree | 06114657c47d66cf0bcbe42a2d0c263077258dbd /src/plugins | |
parent | d2d6c6f7813fa38ced6b80ead763ed6e6daaa951 (diff) |
iOS: Implement QIOSScreen::refreshRate to account for 120Hz displays
Task-number: QTBUG-64968
Change-Id: If96f6cde8f2fc6d91beb842d82a881fe057260b5
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/ios/qiosscreen.h | 1 | ||||
-rw-r--r-- | src/plugins/platforms/ios/qiosscreen.mm | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/qiosscreen.h b/src/plugins/platforms/ios/qiosscreen.h index d63fa29ec3..be0f301710 100644 --- a/src/plugins/platforms/ios/qiosscreen.h +++ b/src/plugins/platforms/ios/qiosscreen.h @@ -69,6 +69,7 @@ public: QSizeF physicalSize() const Q_DECL_OVERRIDE; QDpi logicalDpi() const Q_DECL_OVERRIDE; qreal devicePixelRatio() const Q_DECL_OVERRIDE; + qreal refreshRate() const override; Qt::ScreenOrientation nativeOrientation() const Q_DECL_OVERRIDE; Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE; diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index 0d3826fc4c..521495b42f 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -459,6 +459,16 @@ qreal QIOSScreen::devicePixelRatio() const return [m_uiScreen scale]; } +qreal QIOSScreen::refreshRate() const +{ +#if QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_NA, 100300, 110000, __WATCHOS_NA) + if (__builtin_available(iOS 10.3, tvOS 11, *)) + return m_uiScreen.maximumFramesPerSecond; +#endif + + return 60.0; +} + Qt::ScreenOrientation QIOSScreen::nativeOrientation() const { CGRect nativeBounds = |