Have you tried setting a style sheet yet?
Qt Code:
textEdit->setStyleSheet("margin: 5px");To copy to clipboard, switch view to plain text mode
See Qt Style Sheets
Have you tried setting a style sheet yet?
Qt Code:
textEdit->setStyleSheet("margin: 5px");To copy to clipboard, switch view to plain text mode
See Qt Style Sheets
Thanks, that works.
I didn't know you could apply stylesheets to widgets, and I couldn't find a way to do it in the class reference of QTextEdit.
But I need to use padding, not margin. Margin seems to set the distance to other widgets not to the text in the textEdit.
If you follow the link above, you will find the "box model" which explains what's margin and padding and what not. If you do use style sheets, you might want to consider placing the style sheet definitions in an external file, so that they are centered in one place and easily modifiable without even having to recompile.
Bookmarks