Prefer floor rounding for Qt 5.14+ fractional DPI handling

* Non-integer DPI handling is fundamentally a broken concept, because UIs are
  essentially pixel art with some vector drawing. Rounding down half fractions
  seems to be a better tradeoff than rounding up or trying to render them as-is.
This commit is contained in:
baldurk
2020-08-27 13:19:21 +01:00
parent 6d810f2ca1
commit 3eaaf59319
+5
View File
@@ -94,6 +94,11 @@ int main(int argc, char *argv[])
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#if(QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
Qt::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor);
#endif
QApplication::setApplicationVersion(lit(FULL_VERSION_STRING));
// shortcut here so we can run this with a non-GUI application