diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-04-19 10:54:09 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2010-04-19 10:56:45 (GMT) |
commit | a43355f7d10a72f60719f7e5a617bcd0031f8fba (patch) | |
tree | 4f7a31cf1732924e27a703cb0eaa5a731b40c3b5 /src/gui/text/qfont.cpp | |
parent | 4e42cea17031ff90481a674686afdd5548fba4a9 (diff) | |
download | Qt-a43355f7d10a72f60719f7e5a617bcd0031f8fba.zip Qt-a43355f7d10a72f60719f7e5a617bcd0031f8fba.tar.gz Qt-a43355f7d10a72f60719f7e5a617bcd0031f8fba.tar.bz2 |
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.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 01e4ef6..81d431c 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 |