Fix global scale reset with custom platformthemes

At least Kvantum makes QGuiApplication constructor to call QGuiApplication::devicePixelRatio, so the value is cached and won't change.

Resetting the cache fixes the issue.
This commit is contained in:
Ilya Fedin 2021-12-16 04:54:49 +04:00 committed by John Preston
parent 5195b7b45f
commit 26a8f46634

View file

@ -13,6 +13,8 @@
#include <QtGui/QWindow> #include <QtGui/QWindow>
#include <QtGui/QtEvents> #include <QtGui/QtEvents>
#include <QWheelEvent> #include <QWheelEvent>
#include <private/qguiapplication_p.h>
#include <private/qhighdpiscaling_p.h> #include <private/qhighdpiscaling_p.h>
#include <array> #include <array>
@ -214,6 +216,7 @@ bool IsContentVisible(
void DisableCustomScaling() { void DisableCustomScaling() {
QHighDpiScaling::setGlobalFactor(1); QHighDpiScaling::setGlobalFactor(1);
QGuiApplicationPrivate::resetCachedDevicePixelRatio();
} }
int WheelDirection(not_null<QWheelEvent*> e) { int WheelDirection(not_null<QWheelEvent*> e) {