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:
parent
5195b7b45f
commit
26a8f46634
1 changed files with 3 additions and 0 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue