Hello. I have another question connected with my application - a Ms Notepad-ish thing. I use QPlainTextEdit to work with text files. Unlike QTextEdit, QPlainTextEdit seems to have this nice property of scrolling text line by line by default, so that no line is displayed cut in half. The only problem is, the first displayed line is uncomfortably close to QTextEdit's top edge. What I'd like to do is to set padding for the text inside the control, just like in Ms Notepad, but text only - I still want the scrollbar to fit snugly in its place, with no gaps.
I tried using QPlainTextEdit::setContentsMargins(), QPlainTextEdit::setStyleSheet() with margins and padding, and some things that I even don't remember. I went through documentation of QPlainTextEdit, QTextEdit, and their ancestors, but didn't find anything that looked promising.
Is there any way of doing this without reimplementing text edit?
I attached my little app; everything's in mainwindow.cpp, if you care to have a look. Thanks.
Bookmarks