Allow disabling custom scaling by envvar.

This commit is contained in:
John Preston 2019-10-13 12:52:40 +04:00
parent e824bb2f6b
commit bc62f87f0e
2 changed files with 9 additions and 0 deletions

View file

@ -180,4 +180,11 @@ QPixmap PixmapFromImage(QImage &&image) {
return QPixmap::fromImage(std::move(image), Qt::ColorOnly);
}
void DisableCustomScaling() {
qunsetenv("QT_DEVICE_PIXEL_RATIO");
qunsetenv("QT_SCALE_FACTOR");
qunsetenv("QT_AUTO_SCREEN_SCALE_FACTOR");
qunsetenv("QT_SCREEN_SCALE_FACTORS");
}
} // namespace Ui

View file

@ -192,4 +192,6 @@ QPointer<const Widget> MakeWeak(not_null<const Widget*> object) {
[[nodiscard]] QPixmap PixmapFromImage(QImage &&image);
void DisableCustomScaling();
} // namespace Ui