From a989e5c54fd2f97bd3fd9b9da9d2b677c64c7ea8 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 16 Apr 2015 15:47:15 +0200 Subject: [PATCH] Enhance QWindow::devicePixelRatio() docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document that fact that for non-create()'ed windows this is the same as QGuiApplication::devicePixelRatio() which is the highest dpr in the system. This has consequences when running with multiple displays so application developer's have to be aware of this. Change-Id: Ic05a18732ff021659da04428cb49421ac3453870 Reviewed-by: Morten Johan Sørvig --- src/gui/kernel/qwindow.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index c0f953bcef..a1057691f2 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -1075,6 +1075,10 @@ Qt::ScreenOrientation QWindow::contentOrientation() const Common values are 1.0 on normal displays and 2.0 on Apple "retina" displays. + \note For windows not backed by a platform window, meaning that create() was not + called, the function will fall back to QGuiApplication::devicePixelRatio() which in + turn returns the highest screen device pixel ratio found on the system. + \sa QScreen::devicePixelRatio(), QGuiApplication::devicePixelRatio() */ qreal QWindow::devicePixelRatio() const