diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-05-18 15:17:37 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-05-18 15:17:37 +0200 |
commit | 5861dc4869e2bb313a0ea20d39b3c7a198664acf (patch) | |
tree | 24538a98ddd31e11dce2bc25b7744c59a8792fed /tests/auto/quick/qquicktext | |
parent | 709f6370884b110def2e4665df8fa7bbf5fae734 (diff) | |
parent | b9e4a4df577959579b2322fb6077bde82d9ffce3 (diff) |
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
src/qml/qml/v8/qqmlbuiltinfunctions_p.h
tests/auto/qml/qqmlqt/tst_qqmlqt.cpp
Change-Id: I9dd93732f4b19513576ca1dd89ae18c69de0203b
Diffstat (limited to 'tests/auto/quick/qquicktext')
-rw-r--r-- | tests/auto/quick/qquicktext/tst_qquicktext.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp index 79d4adbb3d..8b7d8c0711 100644 --- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp +++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp @@ -915,8 +915,10 @@ void tst_qquicktext::hAlignImplicitWidth() // Try to check whether alignment works by checking the number of black // pixels in the thirds of the grabbed image. - const int windowWidth = 220; - const int textWidth = qCeil(text->implicitWidth()); + // QQuickWindow::grabWindow() scales the returned image by the devicePixelRatio of the screen. + const qreal devicePixelRatio = view.screen()->devicePixelRatio(); + const int windowWidth = 220 * devicePixelRatio; + const int textWidth = qCeil(text->implicitWidth()) * devicePixelRatio; QVERIFY2(textWidth < windowWidth, "System font too large."); const int sectionWidth = textWidth / 3; const int centeredSection1 = (windowWidth - textWidth) / 2; |