diff options
author | Jan Arve Saether <jan-arve.saether@digia.com> | 2014-09-16 13:31:20 +0200 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@digia.com> | 2014-09-17 14:39:09 +0200 |
commit | 67777986284410cbe307f58250ee8e557b7ebaad (patch) | |
tree | 5d67bba2b7b2cbb4eeb0711d4fbb3831a3a86ec6 /tests | |
parent | 428b676d84c5576cbbaf549381f47b73e2c9b6aa (diff) |
Fix QQuickText::lineLaidOutRelayout autotest on OS X
QTextLine::height() can be different that QTextLine::rect().height()
Task-number: QTBUG-37829
Change-Id: I7fa93d50e29397237220ba111baa3bd1a56b88f2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'tests')
-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); } } |