QplainTextEdit bottom margin (empty space below text)
Unsolved
General and Desktop
-
wrote on 28 Nov 2019, 17:44 last edited by
Hi everyone
I'm trying to add an empty space below the text in a QPlainTextEdit, allow the user to scroll past the text.
You can find this in visual studio, visual studio code or sublime for exampleI've managed to to it on a QTextEdit like this:
QTextFrameFormat format = document()->rootFrame()->frameFormat(); format.setBottomMargin(contentsRect().height()); document()->rootFrame()->setFrameFormat(format);
but it doesn't work with a QPlainTextEdit
Here is what i'm trying to achieve implemented in a QTextEdit:
Any ideas are welcome.
-
wrote on 6 Oct 2022, 22:05 last edited by
You need to use this method:
class CodeEditor(QPlainTextEdit): ... self.setCenterOnScroll(True)