summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfont.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qfont.cpp')
-rw-r--r--src/gui/text/qfont.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index b85c045064..e8308dba06 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -50,6 +50,7 @@
#include "qdatastream.h"
#include "qguiapplication.h"
#include "qstringlist.h"
+#include "qscreen.h"
#include "qthread.h"
#include "qthreadstorage.h"
@@ -167,11 +168,10 @@ Q_GUI_EXPORT int qt_defaultDpiX()
extern float qt_mac_defaultDpi_x(); //qpaintdevice_mac.cpp
dpi = qt_mac_defaultDpi_x();
#elif defined(Q_WS_QPA)
- QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
- if (pi) {
- QPlatformScreen *screen = pi->screens().at(0);
+ QScreen *screen = QGuiApplication::primaryScreen();
+ if (screen) {
const QSize screenSize = screen->geometry().size();
- const QSize physicalSize = screen->physicalSize();
+ const QSize physicalSize = screen->handle()->physicalSize();
dpi = qRound(screenSize.width() / (physicalSize.width() / qreal(25.4)));
} else {
//PI has not been initialised, or it is being initialised. Give a default dpi
@@ -198,11 +198,10 @@ Q_GUI_EXPORT int qt_defaultDpiY()
extern float qt_mac_defaultDpi_y(); //qpaintdevice_mac.cpp
dpi = qt_mac_defaultDpi_y();
#elif defined(Q_WS_QPA)
- QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
- if (pi) {
- QPlatformScreen *screen = pi->screens().at(0);
+ QScreen *screen = QGuiApplication::primaryScreen();
+ if (screen) {
const QSize screenSize = screen->geometry().size();
- const QSize physicalSize = screen->physicalSize();
+ const QSize physicalSize = screen->handle()->physicalSize();
dpi = qRound(screenSize.height() / (physicalSize.height() / qreal(25.4)));
} else {
//PI has not been initialised, or it is being initialised. Give a default dpi