summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfont.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2010-04-19 12:54:09 +0200
committerJørgen Lind <jorgen.lind@nokia.com>2010-04-19 12:56:45 +0200
commita43355f7d10a72f60719f7e5a617bcd0031f8fba (patch)
tree4f7a31cf1732924e27a703cb0eaa5a731b40c3b5 /src/gui/text/qfont.cpp
parent4e42cea17031ff90481a674686afdd5548fba4a9 (diff)
QPlatformScreen now has default implementation for physicalSize
assuming dpi = 100. This also simplifies minimal slightly. Also use propper apis in qfont for default dpi by using QPlatformScreen
Diffstat (limited to 'src/gui/text/qfont.cpp')
-rw-r--r--src/gui/text/qfont.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 01e4ef6eb1..81d431ce3e 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -75,6 +75,10 @@
#ifdef Q_OS_SYMBIAN
#include "qt_s60_p.h"
#endif
+#ifdef Q_WS_LITE
+#include <QtGui/qplatformscreen_lite.h>
+#include <QtGui/private/qapplication_p.h>
+#endif
#include <QMutexLocker>
@@ -173,7 +177,10 @@ Q_GUI_EXPORT int qt_defaultDpiX()
screen = subScreens.at(0);
dpi = qRound(screen->width() / (screen->physicalWidth() / qreal(25.4)));
#elif defined(Q_WS_LITE)
- dpi = 72;
+ QPlatformScreen *screen = QApplicationPrivate::platformIntegration()->screens().at(0);
+ const QSize screenSize = screen->geometry().size();
+ const QSize physicalSize = screen->physicalSize();
+ dpi = qRound(screenSize.width() / (physicalSize.width() / qreal(25.4)));
#elif defined(Q_OS_SYMBIAN)
dpi = S60->defaultDpiX;
#endif // Q_WS_X11
@@ -203,7 +210,10 @@ Q_GUI_EXPORT int qt_defaultDpiY()
screen = subScreens.at(0);
dpi = qRound(screen->height() / (screen->physicalHeight() / qreal(25.4)));
#elif defined(Q_WS_LITE)
- dpi = 72;
+ QPlatformScreen *screen = QApplicationPrivate::platformIntegration()->screens().at(0);
+ const QSize screenSize = screen->geometry().size();
+ const QSize physicalSize = screen->physicalSize();
+ dpi = qRound(screenSize.height() / (physicalSize.height() / qreal(25.4)));
#elif defined(Q_OS_SYMBIAN)
dpi = S60->defaultDpiY;
#endif // Q_WS_X11