qhighdpiscaling.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/kernel/qhighdpiscaling.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtGui module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "qhighdpiscaling_p.h"-
41#include "qguiapplication.h"-
42#include "qscreen.h"-
43#include "qplatformintegration.h"-
44#include "private/qscreen_p.h"-
45-
46#include <QtCore/qdebug.h>-
47-
48QT_BEGIN_NAMESPACE-
49-
50Q_LOGGING_CATEGORY(lcScaling, "qt.scaling");
never executed: return category;
0
51-
52#ifndef QT_NO_HIGHDPISCALING-
53static const char legacyDevicePixelEnvVar[] = "QT_DEVICE_PIXEL_RATIO";-
54static const char scaleFactorEnvVar[] = "QT_SCALE_FACTOR";-
55static const char autoScreenEnvVar[] = "QT_AUTO_SCREEN_SCALE_FACTOR";-
56static const char screenFactorsEnvVar[] = "QT_SCREEN_SCALE_FACTORS";-
57-
58static inline qreal initialGlobalScaleFactor()-
59{-
60-
61 qreal result = 1;-
62 if (qEnvironmentVariableIsSet(scaleFactorEnvVar)) {
qEnvironmentVa...eFactorEnvVar)Description
TRUEnever evaluated
FALSEnever evaluated
0
63 bool ok;-
64 const qreal f = qgetenv(scaleFactorEnvVar).toDouble(&ok);-
65 if (ok && f > 0) {
okDescription
TRUEnever evaluated
FALSEnever evaluated
f > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
66 qCDebug(lcScaling) << "Apply " << scaleFactorEnvVar << f;
never executed: QMessageLogger(__FILE__, 66, __PRETTY_FUNCTION__, lcScaling().categoryName()).debug() << "Apply " << scaleFactorEnvVar << f;
qt_category_enabledDescription
TRUEnever evaluated
FALSEnever evaluated
0
67 result = f;-
68 }
never executed: end of block
0
69 } else {
never executed: end of block
0
70 if (qEnvironmentVariableIsSet(legacyDevicePixelEnvVar)) {
qEnvironmentVa...cePixelEnvVar)Description
TRUEnever evaluated
FALSEnever evaluated
0
71 qWarning() << "Warning:" << legacyDevicePixelEnvVar << "is deprecated. Instead use:" << endl-
72 << " " << autoScreenEnvVar << "to enable platform plugin controlled per-screen factors." << endl-
73 << " " << screenFactorsEnvVar << "to set per-screen factors." << endl-
74 << " " << scaleFactorEnvVar << "to set the application global scale factor.";-
75-
76 int dpr = qEnvironmentVariableIntValue(legacyDevicePixelEnvVar);-
77 if (dpr > 0)
dpr > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
78 result = dpr;
never executed: result = dpr;
0
79 }
never executed: end of block
0
80 }
never executed: end of block
0
81 return result;
never executed: return result;
0
82}-
83-
84/*!-
85 \class QHighDpiScaling-
86 \since 5.6-
87 \internal-
88 \preliminary-
89 \ingroup qpa-
90-
91 \brief Collection of utility functions for UI scaling.-
92-
93 QHighDpiScaling implements utility functions for high-dpi scaling for use-
94 on operating systems that provide limited support for native scaling. In-
95 addition this functionality can be used for simulation and testing purposes.-
96-
97 The functions support scaling between the device independent coordinate-
98 system used by Qt applications and the native coordinate system used by-
99 the platform plugins. Intended usage locations are the low level / platform-
100 plugin interfacing parts of QtGui, for example the QWindow, QScreen and-
101 QWindowSystemInterface implementation.-
102-
103 There are now up to three active coordinate systems in Qt:-
104-
105 ----------------------------------------------------
106 | Application Device Independent Pixels | devicePixelRatio-
107 | Qt Widgets | =-
108 | Qt Gui |-
109 |---------------------------------------------------| Qt Scale Factor-
110 | Qt Gui QPlatform* Native Pixels | *-
111 | Qt platform plugin |-
112 |---------------------------------------------------| OS Scale Factor-
113 | Display Device Pixels |-
114 | (Graphics Buffers) |-
115 ------------------------------------------------------
116-
117 This is an simplification and shows the main coordinate system. All layers-
118 may work with device pixels in specific cases: OpenGL, creating the backing-
119 store, and QPixmap management. The "Native Pixels" coordinate system is-
120 internal to Qt and should not be exposed to Qt users: Seen from the outside-
121 there are only two coordinate systems: device independent pixels and device-
122 pixels.-
123-
124 The devicePixelRatio seen by applications is the product of the Qt scale-
125 factor and the OS scale factor. The value of the scale factors may be 1,-
126 in which case two or more of the coordinate systems are equivalent. Platforms-
127 that (may) have an OS scale factor include \macos, iOS and Wayland.-
128-
129 Note that the functions in this file do not work with the OS scale factor-
130 directly and are limited to converting between device independent and native-
131 pixels. The OS scale factor is accunted for by QWindow::devicePixelRatio()-
132 and similar functions.-
133-
134 Configuration Examples:-
135-
136 'Classic': Device Independent Pixels = Native Pixels = Device Pixels-
137 --------------------------------------------------- devicePixelRatio: 1-
138 | Application / Qt Gui 100 x 100 |-
139 | | Qt Scale Factor: 1-
140 | Qt Platform / OS 100 x 100 |-
141 | | OS Scale Factor: 1-
142 | Display 100 x 100 |-
143 ------------------------------------------------------
144-
145 'Retina Device': Device Independent Pixels = Native Pixels-
146 --------------------------------------------------- devicePixelRatio: 2-
147 | Application / Qt Gui 100 x 100 |-
148 | | Qt Scale Factor: 1-
149 | Qt Platform / OS 100 x 100 |-
150 |---------------------------------------------------| OS Scale Factor: 2-
151 | Display 200 x 200 |-
152 ------------------------------------------------------
153-
154 '2x Qt Scaling': Native Pixels = Device Pixels-
155 --------------------------------------------------- devicePixelRatio: 2-
156 | Application / Qt Gui 100 x 100 |-
157 |---------------------------------------------------| Qt Scale Factor: 2-
158 | Qt Platform / OS 200 x 200 |-
159 | | OS Scale Factor: 1-
160 | Display 200 x 200 |-
161 ------------------------------------------------------
162-
163 The Qt Scale Factor is the product of two sub-scale factors, which-
164 are independently either set or determined by the platform plugin.-
165 Several APIs are offered for this, targeting both developers and-
166 end users. All scale factors are of type qreal.-
167-
168 1) A global scale factor-
169 The QT_SCALE_FACTOR environment variable can be used to set-
170 a global scale factor for all windows in the processs. This-
171 is useful for testing and debugging (you can simulate any-
172 devicePixelRatio without needing access to special hardware),-
173 and perhaps also for targeting a specific application to-
174 a specific display type (embedded use cases).-
175-
176 2) Per-screen scale factors-
177 Some platform plugins support providing a per-screen scale-
178 factor based on display density information. These platforms-
179 include X11, Windows, and Android.-
180-
181 There are two APIs for enabling or disabling this behavior:-
182 - The QT_AUTO_SCREEN_SCALE_FACTOR environment variable.-
183 - The AA_EnableHighDpiScaling and AA_DisableHighDpiScaling-
184 application attributes-
185-
186 Enabling either will make QHighDpiScaling call QPlatformScreen::pixelDensity()-
187 and use the value provided as the scale factor for the screen in-
188 question. Disabling is done on a 'veto' basis where either the-
189 environment or the application can disable the scaling. The intended use-
190 cases are 'My system is not providing correct display density-
191 information' and 'My application needs to work in display pixels',-
192 respectively.-
193-
194 The QT_SCREEN_SCALE_FACTORS environment variable can be used to set the screen-
195 scale factors manually. Set this to a semicolon-separated-
196 list of scale factors (matching the order of QGuiApplications::screens()),-
197 or to a list of name=value pairs (where name matches QScreen::name()).-
198-
199 Coordinate conversion functions must be used when writing code that passes-
200 geometry across the Qt Gui / Platform plugin boundary. The main conversion-
201 functions are:-
202 T toNativePixels(T, QWindow *)-
203 T fromNativePixels(T, QWindow*)-
204-
205 The following classes in QtGui use native pixels, for the convenience of the-
206 plataform plugins:-
207 QPlatformWindow-
208 QPlatformScreen-
209 QWindowSystemInterface (API only - Events are in device independent pixels)-
210-
211 As a special consideration platform plugin code should be careful about-
212 calling QtGui geometry accessor functions:-
213 QRect r = window->geometry();-
214 Here the returned geometry is in device independent pixels. Add a conversion call:-
215 QRect r = QHighDpi::toNativePixels(window->geometry());-
216 (Avoiding calling QWindow and instead using the QPlatformWindow geometry-
217 might be a better course of action in this case.)-
218*/-
219-
220qreal QHighDpiScaling::m_factor = 1.0;-
221bool QHighDpiScaling::m_active = false; //"overall active" - is there any scale factor set.-
222bool QHighDpiScaling::m_usePixelDensity = false; // use scale factor from platform plugin-
223bool QHighDpiScaling::m_pixelDensityScalingActive = false; // pixel density scale factor > 1-
224bool QHighDpiScaling::m_globalScalingActive = false; // global scale factor is active-
225bool QHighDpiScaling::m_screenFactorSet = false; // QHighDpiScaling::setScreenFactor has been used-
226QDpi QHighDpiScaling::m_logicalDpi = QDpi(-1,-1); // The scaled logical DPI of the primary screen-
227-
228/*-
229 Initializes the QHighDpiScaling global variables. Called before the-
230 platform plugin is created.-
231*/-
232-
233static inline bool usePixelDensity()-
234{-
235 // Determine if we should set a scale factor based on the pixel density-
236 // reported by the platform plugin. There are several enablers and several-
237 // disablers. A single disable may veto all other enablers.-
238 if (QCoreApplication::testAttribute(Qt::AA_DisableHighDpiScaling))
QCoreApplicati...ighDpiScaling)Description
TRUEnever evaluated
FALSEnever evaluated
0
239 return false;
never executed: return false;
0
240 bool screenEnvValueOk;-
241 const int screenEnvValue = qEnvironmentVariableIntValue(autoScreenEnvVar, &screenEnvValueOk);-
242 if (screenEnvValueOk && screenEnvValue < 1)
screenEnvValueOkDescription
TRUEnever evaluated
FALSEnever evaluated
screenEnvValue < 1Description
TRUEnever evaluated
FALSEnever evaluated
0
243 return false;
never executed: return false;
0
244 return QCoreApplication::testAttribute(Qt::AA_EnableHighDpiScaling)
never executed: return QCoreApplication::testAttribute(Qt::AA_EnableHighDpiScaling) || (screenEnvValueOk && screenEnvValue > 0) || (qEnvironmentVariableIsSet(legacyDevicePixelEnvVar) && qgetenv(legacyDevicePixelEnvVar).toLower() == "auto");
0
245 || (screenEnvValueOk && screenEnvValue > 0)
never executed: return QCoreApplication::testAttribute(Qt::AA_EnableHighDpiScaling) || (screenEnvValueOk && screenEnvValue > 0) || (qEnvironmentVariableIsSet(legacyDevicePixelEnvVar) && qgetenv(legacyDevicePixelEnvVar).toLower() == "auto");
0
246 || (qEnvironmentVariableIsSet(legacyDevicePixelEnvVar) && qgetenv(legacyDevicePixelEnvVar).toLower() == "auto");
never executed: return QCoreApplication::testAttribute(Qt::AA_EnableHighDpiScaling) || (screenEnvValueOk && screenEnvValue > 0) || (qEnvironmentVariableIsSet(legacyDevicePixelEnvVar) && qgetenv(legacyDevicePixelEnvVar).toLower() == "auto");
0
247}-
248-
249void QHighDpiScaling::initHighDpiScaling()-
250{-
251 // Determine if there is a global scale factor set.-
252 m_factor = initialGlobalScaleFactor();-
253 m_globalScalingActive = !qFuzzyCompare(m_factor, qreal(1));-
254-
255 m_usePixelDensity = usePixelDensity();-
256-
257 m_pixelDensityScalingActive = false; //set in updateHighDpiScaling below-
258-
259 // we update m_active in updateHighDpiScaling, but while we create the-
260 // screens, we have to assume that m_usePixelDensity implies scaling-
261 m_active = m_globalScalingActive || m_usePixelDensity;
m_globalScalingActiveDescription
TRUEnever evaluated
FALSEnever evaluated
m_usePixelDensityDescription
TRUEnever evaluated
FALSEnever evaluated
0
262}
never executed: end of block
0
263-
264void QHighDpiScaling::updateHighDpiScaling()-
265{-
266 if (QCoreApplication::testAttribute(Qt::AA_DisableHighDpiScaling))
QCoreApplicati...ighDpiScaling)Description
TRUEnever evaluated
FALSEnever evaluated
0
267 return;
never executed: return;
0
268-
269 if (m_usePixelDensity && !m_pixelDensityScalingActive) {
m_usePixelDensityDescription
TRUEnever evaluated
FALSEnever evaluated
!m_pixelDensityScalingActiveDescription
TRUEnever evaluated
FALSEnever evaluated
0
270 const auto screens = QGuiApplication::screens();-
271 for (QScreen *screen : screens) {-
272 if (!qFuzzyCompare(screenSubfactor(screen->handle()), qreal(1))) {
!qFuzzyCompare...()), qreal(1))Description
TRUEnever evaluated
FALSEnever evaluated
0
273 m_pixelDensityScalingActive = true;-
274 break;
never executed: break;
0
275 }-
276 }
never executed: end of block
0
277 }
never executed: end of block
0
278 if (qEnvironmentVariableIsSet(screenFactorsEnvVar)) {
qEnvironmentVa...FactorsEnvVar)Description
TRUEnever evaluated
FALSEnever evaluated
0
279 int i = 0;-
280 const auto specs = qgetenv(screenFactorsEnvVar).split(';');-
281 for (const QByteArray &spec : specs) {-
282 QScreen *screen = 0;-
283 int equalsPos = spec.lastIndexOf('=');-
284 double factor = 0;-
285 if (equalsPos > 0) {
equalsPos > 0Description
TRUEnever evaluated
FALSEnever evaluated
0
286 // support "name=factor"-
287 QByteArray name = spec.mid(0, equalsPos);-
288 QByteArray f = spec.mid(equalsPos + 1);-
289 bool ok;-
290 factor = f.toDouble(&ok);-
291 if (ok) {
okDescription
TRUEnever evaluated
FALSEnever evaluated
0
292 const auto screens = QGuiApplication::screens();-
293 for (QScreen *s : screens) {-
294 if (s->name() == QString::fromLocal8Bit(name)) {
s->name() == Q...ocal8Bit(name)Description
TRUEnever evaluated
FALSEnever evaluated
0
295 screen = s;-
296 break;
never executed: break;
0
297 }-
298 }
never executed: end of block
0
299 }
never executed: end of block
0
300 } else {
never executed: end of block
0
301 // listing screens in order-
302 bool ok;-
303 factor = spec.toDouble(&ok);-
304 if (ok && i < QGuiApplication::screens().count())
okDescription
TRUEnever evaluated
FALSEnever evaluated
i < QGuiApplic...eens().count()Description
TRUEnever evaluated
FALSEnever evaluated
0
305 screen = QGuiApplication::screens().at(i);
never executed: screen = QGuiApplication::screens().at(i);
0
306 }
never executed: end of block
0
307 if (screen)
screenDescription
TRUEnever evaluated
FALSEnever evaluated
0
308 setScreenFactor(screen, factor);
never executed: setScreenFactor(screen, factor);
0
309 ++i;-
310 }
never executed: end of block
0
311 }
never executed: end of block
0
312 m_active = m_globalScalingActive || m_screenFactorSet || m_pixelDensityScalingActive;
m_globalScalingActiveDescription
TRUEnever evaluated
FALSEnever evaluated
m_screenFactorSetDescription
TRUEnever evaluated
FALSEnever evaluated
m_pixelDensityScalingActiveDescription
TRUEnever evaluated
FALSEnever evaluated
0
313-
314 QPlatformScreen *primaryScreen = QGuiApplication::primaryScreen()->handle();-
315 qreal sf = screenSubfactor(primaryScreen);-
316 QDpi primaryDpi = primaryScreen->logicalDpi();-
317 m_logicalDpi = QDpi(primaryDpi.first / sf, primaryDpi.second / sf);-
318}
never executed: end of block
0
319-
320/*-
321 Sets the global scale factor which is applied to all windows.-
322*/-
323void QHighDpiScaling::setGlobalFactor(qreal factor)-
324{-
325 if (qFuzzyCompare(factor, m_factor))
qFuzzyCompare(...tor, m_factor)Description
TRUEnever evaluated
FALSEnever evaluated
0
326 return;
never executed: return;
0
327 if (!QGuiApplication::allWindows().isEmpty())
!QGuiApplicati...ws().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
328 qWarning("QHighDpiScaling::setFactor: Should only be called when no windows exist.");
never executed: QMessageLogger(__FILE__, 328, __PRETTY_FUNCTION__).warning("QHighDpiScaling::setFactor: Should only be called when no windows exist.");
0
329-
330 m_globalScalingActive = !qFuzzyCompare(factor, qreal(1));-
331 m_factor = m_globalScalingActive ? factor : qreal(1);
m_globalScalingActiveDescription
TRUEnever evaluated
FALSEnever evaluated
0
332 m_active = m_globalScalingActive || m_screenFactorSet || m_pixelDensityScalingActive;
m_globalScalingActiveDescription
TRUEnever evaluated
FALSEnever evaluated
m_screenFactorSetDescription
TRUEnever evaluated
FALSEnever evaluated
m_pixelDensityScalingActiveDescription
TRUEnever evaluated
FALSEnever evaluated
0
333 const auto screens = QGuiApplication::screens();-
334 for (QScreen *screen : screens)-
335 screen->d_func()->updateHighDpi();
never executed: screen->d_func()->updateHighDpi();
0
336}
never executed: end of block
0
337-
338static const char scaleFactorProperty[] = "_q_scaleFactor";-
339-
340/*-
341 Sets a per-screen scale factor.-
342*/-
343void QHighDpiScaling::setScreenFactor(QScreen *screen, qreal factor)-
344{-
345 if (!qFuzzyCompare(factor, qreal(1))) {
!qFuzzyCompare...tor, qreal(1))Description
TRUEnever evaluated
FALSEnever evaluated
0
346 m_screenFactorSet = true;-
347 m_active = true;-
348 }
never executed: end of block
0
349 screen->setProperty(scaleFactorProperty, QVariant(factor));-
350-
351 // hack to force re-evaluation of screen geometry-
352 if (screen->handle())
screen->handle()Description
TRUEnever evaluated
FALSEnever evaluated
0
353 screen->d_func()->setPlatformScreen(screen->handle()); // updates geometries based on scale factor
never executed: screen->d_func()->setPlatformScreen(screen->handle());
0
354}
never executed: end of block
0
355-
356QPoint QHighDpiScaling::mapPositionToNative(const QPoint &pos, const QPlatformScreen *platformScreen)-
357{-
358 if (!platformScreen)
!platformScreenDescription
TRUEnever evaluated
FALSEnever evaluated
0
359 return pos;
never executed: return pos;
0
360 const qreal scaleFactor = factor(platformScreen);-
361 const QPoint topLeft = platformScreen->geometry().topLeft();-
362 return (pos - topLeft) * scaleFactor + topLeft;
never executed: return (pos - topLeft) * scaleFactor + topLeft;
0
363}-
364-
365QPoint QHighDpiScaling::mapPositionFromNative(const QPoint &pos, const QPlatformScreen *platformScreen)-
366{-
367 if (!platformScreen)
!platformScreenDescription
TRUEnever evaluated
FALSEnever evaluated
0
368 return pos;
never executed: return pos;
0
369 const qreal scaleFactor = factor(platformScreen);-
370 const QPoint topLeft = platformScreen->geometry().topLeft();-
371 return (pos - topLeft) / scaleFactor + topLeft;
never executed: return (pos - topLeft) / scaleFactor + topLeft;
0
372}-
373-
374qreal QHighDpiScaling::screenSubfactor(const QPlatformScreen *screen)-
375{-
376 qreal factor = qreal(1.0);-
377 if (screen) {
screenDescription
TRUEnever evaluated
FALSEnever evaluated
0
378 if (m_usePixelDensity)
m_usePixelDensityDescription
TRUEnever evaluated
FALSEnever evaluated
0
379 factor *= screen->pixelDensity();
never executed: factor *= screen->pixelDensity();
0
380 if (m_screenFactorSet) {
m_screenFactorSetDescription
TRUEnever evaluated
FALSEnever evaluated
0
381 QVariant screenFactor = screen->screen()->property(scaleFactorProperty);-
382 if (screenFactor.isValid())
screenFactor.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
383 factor *= screenFactor.toReal();
never executed: factor *= screenFactor.toReal();
0
384 }
never executed: end of block
0
385 }
never executed: end of block
0
386 return factor;
never executed: return factor;
0
387}-
388-
389QDpi QHighDpiScaling::logicalDpi()-
390{-
391 return m_logicalDpi;
never executed: return m_logicalDpi;
0
392}-
393-
394qreal QHighDpiScaling::factor(const QScreen *screen)-
395{-
396 // Fast path for when scaling in Qt is not used at all.-
397 if (!m_active)
!m_activeDescription
TRUEnever evaluated
FALSEnever evaluated
0
398 return qreal(1.0);
never executed: return qreal(1.0);
0
399-
400 // The effective factor for a given screen is the product of the-
401 // screen and global sub-factors-
402 qreal factor = m_factor;-
403 if (screen)
screenDescription
TRUEnever evaluated
FALSEnever evaluated
0
404 factor *= screenSubfactor(screen->handle());
never executed: factor *= screenSubfactor(screen->handle());
0
405 return factor;
never executed: return factor;
0
406}-
407-
408qreal QHighDpiScaling::factor(const QPlatformScreen *platformScreen)-
409{-
410 if (!m_active)
!m_activeDescription
TRUEnever evaluated
FALSEnever evaluated
0
411 return qreal(1.0);
never executed: return qreal(1.0);
0
412-
413 return m_factor * screenSubfactor(platformScreen);
never executed: return m_factor * screenSubfactor(platformScreen);
0
414}-
415-
416qreal QHighDpiScaling::factor(const QWindow *window)-
417{-
418 if (!m_active)
!m_activeDescription
TRUEnever evaluated
FALSEnever evaluated
0
419 return qreal(1.0);
never executed: return qreal(1.0);
0
420-
421 return factor(window ? window->screen() : QGuiApplication::primaryScreen());
never executed: return factor(window ? window->screen() : QGuiApplication::primaryScreen());
0
422}-
423-
424QPoint QHighDpiScaling::origin(const QScreen *screen)-
425{-
426 return screen->geometry().topLeft();
never executed: return screen->geometry().topLeft();
0
427}-
428-
429QPoint QHighDpiScaling::origin(const QPlatformScreen *platformScreen)-
430{-
431 return platformScreen->geometry().topLeft();
never executed: return platformScreen->geometry().topLeft();
0
432}-
433-
434#endif //QT_NO_HIGHDPISCALING-
435QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9