Merge pull request #2409 from jplsek/native-text-render

Use native text rendering for qml windows
This commit is contained in:
Kevin Ottens 2020-09-23 13:15:00 +02:00 committed by GitHub
commit a2899eba74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,7 @@
*/
#include <QtGlobal>
#include <cmath>
#include <csignal>
#ifdef Q_OS_UNIX
@ -34,6 +35,7 @@
#include <QMessageBox>
#include <QDebug>
#include <QQuickStyle>
#include <QQuickWindow>
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")) {