diff options
author | Sami Lempinen <sami.lempinen@nokia.com> | 2011-04-28 08:10:57 (GMT) |
---|---|---|
committer | Sami Lempinen <sami.lempinen@nokia.com> | 2011-04-28 08:10:57 (GMT) |
commit | 95de3f34d9dba4cd95f1f3d32b35c4a4d97e70d9 (patch) | |
tree | 7be35a9028b5c83b792190fb954127e9f558baf5 /src/plugins/platforms/uikit/quikitscreen.mm | |
parent | 9d6530b9774de482b0b3a29720f7f756e986f5c7 (diff) | |
parent | 8e615d9b07f6146b5cb6b56c4cd2e32376a8b429 (diff) | |
download | Qt-95de3f34d9dba4cd95f1f3d32b35c4a4d97e70d9.zip Qt-95de3f34d9dba4cd95f1f3d32b35c4a4d97e70d9.tar.gz Qt-95de3f34d9dba4cd95f1f3d32b35c4a4d97e70d9.tar.bz2 |
Merge remote-tracking branch 'qt/4.8'
Diffstat (limited to 'src/plugins/platforms/uikit/quikitscreen.mm')
-rw-r--r-- | src/plugins/platforms/uikit/quikitscreen.mm | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/plugins/platforms/uikit/quikitscreen.mm b/src/plugins/platforms/uikit/quikitscreen.mm index ec94e3a..21494c9 100644 --- a/src/plugins/platforms/uikit/quikitscreen.mm +++ b/src/plugins/platforms/uikit/quikitscreen.mm @@ -41,6 +41,8 @@ #include "quikitscreen.h" +#include <QtGui/QApplication> + #include <QtDebug> QT_BEGIN_NAMESPACE @@ -51,21 +53,22 @@ QUIKitScreen::QUIKitScreen(int screenIndex) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; UIScreen *screen = [[UIScreen screens] objectAtIndex:screenIndex]; - UIScreenMode *mode = [screen currentMode]; - CGSize size = [mode size]; - m_geometry = QRect(0, 0, size.width, size.height); - CGRect bounds = [screen bounds]; // in 'points', 1p == 1/160in - -// qreal xDpi = size.width * 160. / bounds.size.width; -// qreal yDpi = size.height * 160. / bounds.size.height; -// qDebug() << xDpi << yDpi; + CGRect bounds = [screen bounds]; + m_geometry = QRect(0, 0, bounds.size.width, bounds.size.height); m_format = QImage::Format_ARGB32; m_depth = 24; const qreal inch = 25.4; - m_physicalSize = QSize(qRound(bounds.size.width * inch / 160.), qRound(bounds.size.height * inch / 160.)); + qreal dpi = 160.; + int dragDistance = 14; + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { + dpi = 132.; + dragDistance = 10; + } + m_physicalSize = QSize(qRound(bounds.size.width * inch / dpi), qRound(bounds.size.height * inch / dpi)); + qApp->setStartDragDistance(dragDistance); [pool release]; } |