From 7d2cfbe5aa1e67d12010a66481625c9d40f0c174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 30 Sep 2011 14:25:43 +0200 Subject: 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 Reviewed-by: Friedemann Kleint --- src/gui/kernel/qplatformscreen_qpa.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/gui/kernel/qplatformscreen_qpa.h') diff --git a/src/gui/kernel/qplatformscreen_qpa.h b/src/gui/kernel/qplatformscreen_qpa.h index 7c20fba0ba..6917d5eca5 100644 --- a/src/gui/kernel/qplatformscreen_qpa.h +++ b/src/gui/kernel/qplatformscreen_qpa.h @@ -67,6 +67,8 @@ class QPlatformWindow; class QScreen; class QSurfaceFormat; +typedef QPair QDpi; + class Q_GUI_EXPORT QPlatformScreenPageFlipper : public QObject { Q_OBJECT @@ -93,7 +95,9 @@ public: virtual int depth() const = 0; virtual QImage::Format format() const = 0; - virtual QSize physicalSize() const; + + virtual QSizeF physicalSize() const; + virtual QDpi logicalDpi() const; virtual QWindow *topLevelAt(const QPoint &point) const; virtual QList virtualSiblings() const; -- cgit v1.2.3