iOS: Implement QIOSScreen::refreshRate to account for 120Hz displays

Task-number: QTBUG-64968
Change-Id: If96f6cde8f2fc6d91beb842d82a881fe057260b5
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
bb10
Tor Arne Vestbø 2017-12-05 00:22:05 +01:00
parent d2d6c6f781
commit 3d720f38fa
2 changed files with 11 additions and 0 deletions

View File

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

View File

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