diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp index 6c34af1f9f8..2f759158ee6 100644 --- a/src/gui/kernel/qhighdpiscaling.cpp +++ b/src/gui/kernel/qhighdpiscaling.cpp @@ -540,10 +540,8 @@ static const char scaleFactorProperty[] = "_q_scaleFactor"; /* Sets a per-screen scale factor. */ -void QHighDpiScaling::setScreenFactor(QScreen *screen, qreal rawFactor) +void QHighDpiScaling::setScreenFactor(QScreen *screen, qreal factor) { - qreal factor = roundScaleFactor(rawFactor); - if (!qFuzzyCompare(factor, qreal(1))) { m_screenFactorSet = true; m_active = true; diff --git a/tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp b/tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp index 62f61e43fa7..f221c9db909 100644 --- a/tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp +++ b/tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp @@ -313,10 +313,9 @@ void tst_QHighDpi::environment_QT_SCREEN_SCALE_FACTORS() QFETCH(QByteArray, environment); QFETCH(QList, expectedDprValues); - qputenv("QT_SCREEN_SCALE_FACTORS", environment); - // Verify that setting QT_SCREEN_SCALE_FACTORS overrides the from-platform-screen-DPI DPR. { + qputenv("QT_SCREEN_SCALE_FACTORS", environment); std::unique_ptr app(createStandardOffscreenApp(platformScreenDpi)); int i = 0; for (QScreen *screen : app->screens()) { @@ -328,18 +327,6 @@ void tst_QHighDpi::environment_QT_SCREEN_SCALE_FACTORS() QCOMPARE(window.devicePixelRatio(), expextedDpr); } } - - // Verify that setHighDpiScaleFactorRoundingPolicy applies to QT_SCREEN_SCALE_FACTORS as well - QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Round); - { - std::unique_ptr app(createStandardOffscreenApp(platformScreenDpi)); - int i = 0; - for (QScreen *screen : app->screens()) { - qreal expectedRounderDpr = qRound(expectedDprValues[i++]); - qreal windowDpr = QWindow(screen).devicePixelRatio(); - QCOMPARE(windowDpr, expectedRounderDpr); - } - } } void tst_QHighDpi::environment_QT_USE_PHYSICAL_DPI()