I would like to add a vertical line that would mark 80 characters in QPlainTextEdit
. I looked at docs but I couldn't see anything in docs. Do I need to paint it somehow myself?
Asked
Active
Viewed 269 times
1

gruszczy
- 40,948
- 31
- 128
- 181
-
1Yes, you need to paint QFrame onto QPlainTextEdit widget. – Blood Sep 09 '12 at 19:20
-
Are the characters supposed to have fixed width? – Luca Carlon Sep 09 '12 at 19:53
-
Yes, they should have fixed width. How should paint QFrame onto a QPlainTextEdit. Could you show me some example? – gruszczy Sep 09 '12 at 19:56
1 Answers
1
I think one possible way is to reimplement the paintEvent() and draw the line using a QPainter after calling the base class implementation. The position of the line might be computed using QFontMetrics.

Luca Carlon
- 9,546
- 13
- 59
- 91