Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QplainTextEdit bottom margin (empty space below text)



  • 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 example

    I'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:
    code_editor_empty_space.PNG

    Any ideas are welcome.


Log in to reply