From 7c8e95612e81e7beb0a665e5a617a6020c7d1953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 4 Aug 2015 18:13:25 +0200 Subject: [PATCH] Make tst_accessibility's characterRect match QAccessibleTextWidget::characterRect The former didn't account for ascent and descent. Change-Id: If741f22f7e79ac3c13e58f2966358010d9f9ec81 Reviewed-by: Frederik Gladhorn --- tests/auto/other/qaccessibility/tst_qaccessibility.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index 8061b1ccb9..4f891fcda0 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -1725,7 +1725,7 @@ static QRect characterRect(const QTextEdit &edit, int offset) int h = fm.height(); qreal x = line.cursorToX(relativeOffset); - QRect r(layoutPosition.x() + x, layoutPosition.y() + line.y(), w, h); + QRect r(layoutPosition.x() + x, layoutPosition.y() + line.y() + line.ascent() + fm.descent() - h, w, h); r.moveTo(edit.viewport()->mapToGlobal(r.topLeft())); return r;