[Back to main] [Printable version] [Leave a comment]

Finding bounding box of a single character in QTextEdit of QT 3.1 [Leave a comment]

by Jarno Elonen, 2003-06-20

The following C++ function finds the location and size (bounding box) of given character in given paragraph of a component derived from QT 3.1's QTextEdit, taking word wrapping into account. It could also pretty easily be modified to work on an QTextEdit pointer (i.e. without subclassing).

The code is hereby released into the Public Domain.

Back to mics tips

Comments on page '/code/misc-notes/char-bbox-qtextedit'

Name:
Email (opt):
Message (no HTML support):
Comment type: Public Private (for page author only)
Spam check: + 2 = 8
Email is optional, not visible to other users, and only used for possible replies.
Please note that the comments are not guaranteed to stay on-line. Trivial questions may be removed after answering them. Corrective and additional notes are sometimes integrated into the main article. Thanks and critisicm are welcome, but are pruned away from time to time. Offensive, abusive, distasteful or aggressive messages are of course removed without a second thougt. Messages sometimes disappear for technical reasons and sometimes just because the administrator felt like removing them.