diff options
Diffstat (limited to 'tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp')
-rw-r--r-- | tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp b/tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp index 09bf8439c8..512209ab73 100644 --- a/tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp +++ b/tests/auto/gui/kernel/qhighdpi/tst_qhighdpi.cpp @@ -49,6 +49,7 @@ private slots: void initTestCase(); void qhighdpiscaling_data(); void qhighdpiscaling(); + void minimumDpr(); void noscreens(); void screenDpiAndDpr_data(); void screenDpiAndDpr(); @@ -223,6 +224,20 @@ void tst_QHighDpi::screenDpiAndDpr() } } +void tst_QHighDpi::minimumDpr() +{ + QList<qreal> dpiValues { 40, 60, 95 }; + std::unique_ptr<QGuiApplication> app(createStandardOffscreenApp(dpiValues)); + for (QScreen *screen : app->screens()) { + // Qt does not currently support DPR values < 1. Make sure + // the minimum DPR value is 1, also when the screen reports + // a low DPI. + QCOMPARE(screen->devicePixelRatio(), 1); + QWindow window(screen); + QCOMPARE(window.devicePixelRatio(), 1); + } +} + void tst_QHighDpi::noscreens() { // Create application object with a no-screens configuration (should not crash) |