App: Use the same high dpi scale factor rounding as Qt 5 does

After brief usage of a Qt 6 build of Qt Creator under non-rounded
scaling factors such as 150% or 175%, all kinds of rendering artifacts
are noticeable.

Proper support of these scaling factors requires fixes in several
places. This change is the quickest alternative fix/workaround: restore
the behavior of Qt 5.

Fixes: QDS-4739
Fixes: QTCREATORBUG-25862
Change-Id: Ia8bfda088ee20ebbe08cb4f79325d5a51ef7124b
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Alessandro Portale
2021-07-27 21:49:35 +02:00
parent 3bf5be3c46
commit 6595650804

View File

@@ -476,6 +476,8 @@ int main(int argc, char **argv)
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
#else
qputenv("QSG_RHI_BACKEND", "opengl");
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
Qt::HighDpiScaleFactorRoundingPolicy::Round);
#endif
if (qEnvironmentVariableIsSet("QTCREATOR_DISABLE_NATIVE_MENUBAR")