Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
None
-
5.14.0 Alpha, 6.2.2, 6.3.0 Alpha
-
None
-
Windows / QtQuick / Software Rasterizer
Description
Thanks to QTBUG-53022 5.14 will allow fractional devicePixelRatio values. When using OpenGL/Angle this works quite good - some artefacts due to scaling have to accepted.
However using the software renderer now shows some serious rendering problems. Please see the attached screenshots:
- real_application_extract.png shows the effect in a real application (this is only a part of the window).
- example_xxx.png show the effect of the example program with different scale factors. Factor 2.x (200%) is fine.
It looks as if the updated region calculation is also not working correctly with fractional scaling.
With non-fractional scaling this does not seem to be a problem.
import QtQuick 2.12 import QtQuick.Window 2.12 import QtQuick.Controls 2.12 as C import QtQuick.Layouts 1.12 Window { id: root visible: true width: 600 height: 400 title: qsTr("Hello World") ColumnLayout { anchors.centerIn: parent C.Label { text: "devicePixelRatio " + Screen.devicePixelRatio } Grid { flow: Grid.LeftToRight spacing: 1 columns: 10 Repeater { model: 100 Rectangle { height: 30 width: 30 color: "blue" } } } } }
#include <QGuiApplication> #include <QQmlApplicationEngine> #include <QFont> int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); #endif QGuiApplication app(argc, argv); QFont f("Segoe UI"); f.setPixelSize(12); app.setFont(f); QQmlApplicationEngine engine; const QUrl url(QStringLiteral("qrc:/main.qml")); QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { if (!obj && url == objUrl) QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.load(url); return app.exec(); }