From 5fa2a13f8db8093d0eadaddaf3bbab9f7f7e50ff Mon Sep 17 00:00:00 2001 From: Jeremy Plsek Date: Thu, 10 Sep 2020 20:36:28 -0400 Subject: [PATCH] Use native text rendering for qml windows Signed-off-by: Jeremy Plsek --- src/gui/main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gui/main.cpp b/src/gui/main.cpp index f4cac4b9c..f35c4ef86 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -14,6 +14,7 @@ */ #include +#include #include #ifdef Q_OS_UNIX @@ -34,6 +35,7 @@ #include #include #include +#include using namespace OCC; @@ -99,6 +101,15 @@ int main(int argc, char **argv) return 0; } +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QQuickWindow::setTextRenderType(QQuickWindow::NativeTextRendering); +#else + // See https://bugreports.qt.io/browse/QTBUG-70481 + if (std::fmod(app.devicePixelRatio(), 1) == 0) { + QQuickWindow::setTextRenderType(QQuickWindow::NativeTextRendering); + } +#endif + // check a environment variable for core dumps #ifdef Q_OS_UNIX if (!qEnvironmentVariableIsEmpty("OWNCLOUD_CORE_DUMP")) { -- 2.30.2