diff options
authorOlivier Goffart <>2017-03-15 10:56:17 +0100
committerOlivier Goffart (Woboq GmbH) <>2017-03-17 23:14:09 +0000
commit7eeb88a5cdcb9684e5cc123731d78e299135cd69 (patch)
parent93a4bf5c8b38d02dd7489e5c0ffecf6fd3b97d34 (diff)
When changing screen, only update the font if dpi has changed
Generally, this might avoid unnecessary work in a quite common case. But if high dpi scaling is set, the dpi (in logical pixels) does not change. However this event is sent before QGuiApplicationPrivate::processWindowScreenChangedEvent has had time to change the geometry, and might cause a problem in QMenu Amends f3a4b4258f2d207b5a8e73d62822a3afe1bf8a72. Task-number: QTBUG-59484 Change-Id: Ie4ceedcb0754613cf239ae86b225c4139b70d0cc Reviewed-by: Friedemann Kleint <>
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 17f87ef87c..b166cfe271 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -9213,7 +9213,8 @@ bool QWidget::event(QEvent *event)
const QWindow *win = te->window;
d->setWinId((win && win->handle()) ? win->handle()->winId() : 0);
- d->updateFont(d->data.fnt);
+ if (d->data.fnt.d->dpi != logicalDpiY())
+ d->updateFont(d->data.fnt);
#ifndef QT_NO_OPENGL
d->renderToTextureReallyDirty = 1;