summaryrefslogtreecommitdiffstats
path: root/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2009-09-09 12:46:59 (GMT)
committerGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2009-09-09 13:05:09 (GMT)
commitcc901fb09d9e3e9719b481c3e0bb9e55c5d746da (patch)
treeadcdc42a285fbbf9d680b12ddc04358e872bb8a1 /tests/auto/qfontmetrics/tst_qfontmetrics.cpp
parent4c999f26a2cd255238d3543d2c4fdd3e51e70769 (diff)
downloadQt-cc901fb09d9e3e9719b481c3e0bb9e55c5d746da.zip
Qt-cc901fb09d9e3e9719b481c3e0bb9e55c5d746da.tar.gz
Qt-cc901fb09d9e3e9719b481c3e0bb9e55c5d746da.tar.bz2
Stabilize QFontMetrics test
Reviewed-by: Olivier
Diffstat (limited to 'tests/auto/qfontmetrics/tst_qfontmetrics.cpp')
-rw-r--r--tests/auto/qfontmetrics/tst_qfontmetrics.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
index 1511d33..ee6d442 100644
--- a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
+++ b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
@@ -210,13 +210,13 @@ void tst_QFontMetrics::elidedMultiLength()
QString text1_short = "Shorter";
QString text1_small = "small";
QFontMetrics fm = QFontMetrics(QFont());
- int width_long = fm.width(text1_long);
+ int width_long = fm.boundingRect(text1_long).width();
QCOMPARE(fm.elidedText(text1,Qt::ElideRight, 8000), text1_long);
QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_long + 1), text1_long);
- QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_long - 2), text1_short);
+ QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_long - 1), text1_short);
int width_short = fm.width(text1_short);
QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_short + 1), text1_short);
- QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_short - 2), text1_small);
+ QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_short - 1), text1_small);
// Not even wide enough for "small" - should use ellipsis
QChar ellipsisChar(0x2026);