diff options
author | Jason Barron <jbarron@trolltech.com> | 2009-05-28 07:09:07 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-05-28 07:12:26 (GMT) |
commit | 2f42ad94f671d50568afa2a1d0ef82e921cc73a0 (patch) | |
tree | 71c0a656a81119e1f902ee17ab3d4b607427ef47 /src/gui/text/qfont.cpp | |
parent | f734da2aac362a72d246d8c2a61ab6ef04fb6bd9 (diff) | |
download | Qt-2f42ad94f671d50568afa2a1d0ef82e921cc73a0.zip Qt-2f42ad94f671d50568afa2a1d0ef82e921cc73a0.tar.gz Qt-2f42ad94f671d50568afa2a1d0ef82e921cc73a0.tar.bz2 |
Optimize font DPI calculation by using cached value.
The default DPI is stored in the S60 structure, so that can simply be
used here instead of re-calculating it each time.
Task-number: 247279
Diffstat (limited to 'src/gui/text/qfont.cpp')
-rw-r--r-- | src/gui/text/qfont.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 4d316f6..930e8af 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -173,8 +173,7 @@ Q_GUI_EXPORT int qt_defaultDpiX() screen = subScreens.at(0); dpi = qRound(screen->width() / (screen->physicalWidth() / qreal(25.4))); #elif defined(Q_WS_S60) - const TReal inchWidth = (TReal)S60->screenWidthInTwips / KTwipsPerInch; - dpi = S60->screenWidthInPixels / inchWidth; + dpi = S60->defaultDpiX; #endif // Q_WS_X11 return dpi; @@ -202,8 +201,7 @@ Q_GUI_EXPORT int qt_defaultDpiY() screen = subScreens.at(0); dpi = qRound(screen->height() / (screen->physicalHeight() / qreal(25.4))); #elif defined(Q_WS_S60) - const TReal inchHeight = (TReal)S60->screenHeightInTwips / KTwipsPerInch; - dpi = S60->screenHeightInPixels / inchHeight; + dpi = S60->defaultDpiY; #endif // Q_WS_X11 return dpi; |