diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-09-30 14:25:43 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-06 09:36:39 +0200 |
commit | 7d2cfbe5aa1e67d12010a66481625c9d40f0c174 (patch) | |
tree | 26734132827c40ba425d79481c2c4193bac5c5ea /src/plugins/platforms/qvfb | |
parent | 29948e666583a26966ddb97faf4808099824b80d (diff) |
Improved logical and physical DPI APIs.
Made physicalSize() return QSizeF instead, to prevent rounding errors.
Added logicalSize() as the base to compute font pixel sizes instead, and
added convenience functions in QScreen to access the logical and
physical sizes and DPI metrics.
Task-number: QTBUG-21736
Task-number: QTBUG-21737
Change-Id: Ic705dc98eb3632617659e65a0c9a552673dc0c65
Reviewed-on: http://codereview.qt-project.org/5888
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src/plugins/platforms/qvfb')
-rw-r--r-- | src/plugins/platforms/qvfb/qvfbintegration.cpp | 4 | ||||
-rw-r--r-- | src/plugins/platforms/qvfb/qvfbintegration.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/platforms/qvfb/qvfbintegration.cpp b/src/plugins/platforms/qvfb/qvfbintegration.cpp index d4d8183936..1ddf934ee9 100644 --- a/src/plugins/platforms/qvfb/qvfbintegration.cpp +++ b/src/plugins/platforms/qvfb/qvfbintegration.cpp @@ -392,8 +392,8 @@ QImage::Format QVFbScreen::format() const return d_ptr->format(); } -QSize QVFbScreen::physicalSize() const { - return (d_ptr->screenSize()*254)/720; +QSizeF QVFbScreen::physicalSize() const { + return (QSizeF(d_ptr->screenSize())*254)/720.; } #if 0 diff --git a/src/plugins/platforms/qvfb/qvfbintegration.h b/src/plugins/platforms/qvfb/qvfbintegration.h index 1c736c24e0..c6bfcc519c 100644 --- a/src/plugins/platforms/qvfb/qvfbintegration.h +++ b/src/plugins/platforms/qvfb/qvfbintegration.h @@ -60,7 +60,7 @@ public: QRect geometry() const; int depth() const; QImage::Format format() const; - QSize physicalSize() const; + QSizeF physicalSize() const; QImage *screenImage(); |