iOS: Enable retina resolution for styles

The QStyle code uses the global qApp->devicePixelRatio(),
which queries the screen, not the window.

Implement QIOSScreen::devicePixelRatio().

Change-Id: I0091e5793f8d07ab7a46b6de443edd9457dcff85
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
This commit is contained in:
Morten Johan Sørvig 2013-01-30 20:31:06 +01:00 committed by Tor Arne Vestbø
parent 58415530aa
commit 60685407c2
2 changed files with 6 additions and 0 deletions

View File

@ -64,6 +64,7 @@ public:
QImage::Format format() const;
QSizeF physicalSize() const;
QDpi logicalDpi() const;
qreal devicePixelRatio() const;
Qt::ScreenOrientation nativeOrientation() const;
Qt::ScreenOrientation orientation() const;

View File

@ -183,6 +183,11 @@ QDpi QIOSScreen::logicalDpi() const
return QDpi(72, 72);
}
qreal QIOSScreen::devicePixelRatio() const
{
return [m_uiScreen scale];
}
Qt::ScreenOrientation QIOSScreen::nativeOrientation() const
{
return Qt::PortraitOrientation;