Qt, QPlainTextEdit and non-printable characters
I wonder if there is any possibility to render special characters (0-31 ASCII, for example) my own way in Qt/QPlainTextEdit? I want to render them as small rectangles as seen in this screenshot:
Qt does have ways to represent non-characters in QTextDocument
which is used in QTextEdit
and QPlainTextEditor
. There's a sample on inserting an SVG object into a text edit:
http://doc.qt.io/archives/qt-4.7/richtext-textobject.html
Or you can use your own QAbstractTextDocumentLayout
to handle the drawing of various text objects in the QTextDocument
.
精彩评论