From dd4f59b227f3734051a07e35d6a3c33540c68908 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 6 Feb 2015 07:09:03 +0100 Subject: QScreen: add devicePixelRatio property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It has been only an accessor until now. [ChangeLog][QtGui][QScreen] added devicePixelRatio property Change-Id: I3b9d0aed437cc11a8ddb5b601dd8db6ed5ca9748 Reviewed-by: Jørgen Lind --- src/gui/kernel/qscreen.cpp | 7 ++++++- src/gui/kernel/qscreen.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp index eb8ae7a2ca..038be09dc7 100644 --- a/src/gui/kernel/qscreen.cpp +++ b/src/gui/kernel/qscreen.cpp @@ -244,9 +244,14 @@ qreal QScreen::logicalDotsPerInch() const } /*! + \property QScreen::devicePixelRatio + \brief the screen's ratio between physical pixels and device-independent pixels + \since 5.5 + Returns the ratio between physical pixels and device-independent pixels for the screen. - Common values are 1.0 on normal displays and 2.0 on Apple "retina" displays. + Common values are 1.0 on normal displays and 2.0 on "retina" displays. + Higher values are also possible. \sa QWindow::devicePixelRatio(), QGuiApplication::devicePixelRatio() */ diff --git a/src/gui/kernel/qscreen.h b/src/gui/kernel/qscreen.h index 7dd9559299..255e735baf 100644 --- a/src/gui/kernel/qscreen.h +++ b/src/gui/kernel/qscreen.h @@ -75,6 +75,7 @@ class Q_GUI_EXPORT QScreen : public QObject Q_PROPERTY(qreal logicalDotsPerInchX READ logicalDotsPerInchX NOTIFY logicalDotsPerInchChanged) Q_PROPERTY(qreal logicalDotsPerInchY READ logicalDotsPerInchY NOTIFY logicalDotsPerInchChanged) Q_PROPERTY(qreal logicalDotsPerInch READ logicalDotsPerInch NOTIFY logicalDotsPerInchChanged) + Q_PROPERTY(qreal devicePixelRatio READ devicePixelRatio NOTIFY physicalDotsPerInchChanged) Q_PROPERTY(Qt::ScreenOrientation primaryOrientation READ primaryOrientation NOTIFY primaryOrientationChanged) Q_PROPERTY(Qt::ScreenOrientation orientation READ orientation NOTIFY orientationChanged) Q_PROPERTY(Qt::ScreenOrientation nativeOrientation READ nativeOrientation) -- cgit v1.2.3