diff options
author | Jan Arve Saether <jan-arve.saether@digia.com> | 2013-01-04 09:20:21 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-04 13:20:06 +0100 |
commit | 32f7db7686b62fed80ccce4ffe3b72333f152515 (patch) | |
tree | 76fb281bdade0ce9bbf7290821eb8fb7282fbe50 /tests/auto | |
parent | ad330f327e68fb42b3013b72a2b64588d2ce01fe (diff) |
Fix autotest of textEditTest to use currentFont() instead of font()
Change-Id: I5c9b2ad494a7daf9b07804f77c4692d49e774261
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/other/qaccessibility/tst_qaccessibility.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index ceed38d589..03ff0c2206 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -1532,7 +1532,7 @@ static QRect characterRect(const QTextEdit &edit, int offset) QPointF layoutPosition = layout->position(); int relativeOffset = offset - block.position(); QTextLine line = layout->lineForTextPosition(relativeOffset); - QFontMetrics fm(edit.font()); + QFontMetrics fm(edit.currentFont()); QChar ch = edit.document()->characterAt(offset); int w = fm.width(ch); int h = fm.height(); @@ -1559,7 +1559,7 @@ void tst_QAccessibility::textEditTest() QFont font("Helvetica"); font.setPointSizeF(12.5); font.setWordSpacing(1.1); - edit.setFont(font); + edit.setCurrentFont(font); } edit.show(); @@ -1573,7 +1573,7 @@ void tst_QAccessibility::textEditTest() QCOMPARE(startOffset, 13); QCOMPARE(endOffset, 31); QCOMPARE(iface->textInterface()->characterCount(), 48); - QFontMetrics fm(edit.font()); + QFontMetrics fm(edit.currentFont()); QCOMPARE(iface->textInterface()->characterRect(0).size(), QSize(fm.width("h"), fm.height())); QCOMPARE(iface->textInterface()->characterRect(5).size(), QSize(fm.width(" "), fm.height())); QCOMPARE(iface->textInterface()->characterRect(6).size(), QSize(fm.width("w"), fm.height())); |