From 05d0f60ebefaeb7721ac572f1253c2c7b2f42dec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Sun, 4 Nov 2012 23:30:50 +0100 Subject: iOS: Flesh out initial QPlatformScreen implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We check the device's model identifier to tweak the screen values based on the precense of older iPhone/iPod touch models, or the iPad Mini. This does not work when running under the simulator, which reports its model identifier as the architecture of the host platform. There doesn't appear to be any APIs to get the simulated device of the simulator, but if this becomes an issue we can always look at the UIDevice model and screen resolution and apply a few heuristics. We do not update the screen geometry on orientation-changes. This matches what UIScreen reports for bounds, but may not be the most intuitive solution from a Qt perspective compared to the way other platform-plugins work. Change-Id: I74783e053601de9ce805f8b52b944c116f9a1e3e Reviewed-by: Richard Moe Gustavsen Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/ios/qiosscreen.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/plugins/platforms/ios/qiosscreen.h') diff --git a/src/plugins/platforms/ios/qiosscreen.h b/src/plugins/platforms/ios/qiosscreen.h index 98771b9ac2..8af7779f9d 100644 --- a/src/plugins/platforms/ios/qiosscreen.h +++ b/src/plugins/platforms/ios/qiosscreen.h @@ -52,24 +52,21 @@ class QIOSScreen : public QPlatformScreen { public: QIOSScreen(unsigned int screenIndex); - ~QIOSScreen(); enum ScreenIndex { MainScreen = 0 }; - QRect geometry() const { return m_geometry; } - int depth() const { return m_depth; } - QImage::Format format() const { return m_format; } - QSizeF physicalSize() const { return m_physicalSize; } + QRect geometry() const; + int depth() const; + QImage::Format format() const; + QSizeF physicalSize() const; UIScreen *uiScreen() const; - void updateInterfaceOrientation(); private: UIScreen *m_uiScreen; QRect m_geometry; int m_depth; - QImage::Format m_format; - QSize m_physicalSize; + QSizeF m_physicalSize; }; QT_END_NAMESPACE -- cgit v1.2.3