diff options
Diffstat (limited to 'tests/auto/quick/qquicktext/tst_qquicktext.cpp')
-rw-r--r-- | tests/auto/quick/qquicktext/tst_qquicktext.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp index 143c10435d..b7335ccc4a 100644 --- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp +++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp @@ -2675,14 +2675,15 @@ void tst_qquicktext::lineLaidOutRelayout() qreal maxH = 0; for (int i = 0; i < textPrivate->layout.lineCount(); ++i) { - QRectF r = textPrivate->layout.lineAt(i).rect(); - + QTextLine line = textPrivate->layout.lineAt(i); + const QRectF r = line.rect(); + const qreal h = line.height(); if (r.x() == 0) { - QCOMPARE(r.y(), i * r.height()); - maxH = qMax(maxH, r.y() + r.height()); + QCOMPARE(r.y(), i * h); + maxH = qMax(maxH, r.y() + h); } else { QCOMPARE(r.x(), myText->width() / 2); - QCOMPARE(r.y(), (i * r.height()) - maxH); + QCOMPARE(r.y(), i * h - maxH); } } |