summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@digia.com>2012-10-26 14:20:05 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-28 12:29:35 (GMT)
commitc6e3cea94c2b36aebb76b90b8354a04caa2f9c60 (patch)
tree4cd35fbc0c0a0e43bf3700ba9c2e233a9d6fc18d /src/plugins
parent7d5574202ed67b57b1c4df21ab6eb3695c14df37 (diff)
downloadQt-c6e3cea94c2b36aebb76b90b8354a04caa2f9c60.zip
Qt-c6e3cea94c2b36aebb76b90b8354a04caa2f9c60.tar.gz
Qt-c6e3cea94c2b36aebb76b90b8354a04caa2f9c60.tar.bz2
Make textEditTest more tolerant wrt characterRect verification
Should become more stable due to two changes: 1. When QAccessibleTextWidget::characterRect() calculates the height, make sure the leading is not included. 2. Accept a small error (1) on height and width. It there is an error on the height or width, dump diagnostics This makes it pass with all Latin fonts on my system (roughly ~150 fonts), where it didn't before. Change-Id: I964207bad1f3ceb0103129501bdc857aff5885d2 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/accessible/widgets/qaccessiblewidgets.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
index 590f603..0360e0c 100644
--- a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
+++ b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp
@@ -1433,8 +1433,13 @@ QRect QAccessibleTextWidget::characterRect(int offset, CoordinateType coordType)
r.setWidth(averageCharWidth);
}
+ int height = line.height();
+
+ // make sure that height does not include leading. (only ascent + descent + 1)
+ if (line.leadingIncluded())
+ height -= qRound(line.leading());
r = QRect(layoutPosition.x() + x, layoutPosition.y() + line.y(),
- w, line.height());
+ w, height);
if (coordType == RelativeToScreen) {
r.moveTo(viewport()->mapToGlobal(r.topLeft()));