This code:
#include <QApplication>
#include <QTextEdit>
int main(int argc, char** argv)
{
textEdit.setStyleSheet("QTextEdit { padding-left:10; padding-top:10; padding-bottom:10; padding-right:10}");
textEdit.show();
return a.exec();
}
#include <QApplication>
#include <QTextEdit>
int main(int argc, char** argv)
{
QApplication a(argc, argv);
QTextEdit textEdit;
textEdit.setStyleSheet("QTextEdit { padding-left:10; padding-top:10; padding-bottom:10; padding-right:10}");
textEdit.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Gives the following window:
padding.jpg
So make sure you set the padding to the textedit you really want to.
LE: On my system it works for QPlainTextEdit too: textEdit.setStyleSheet("QPlainTextEdit { padding-left:10; padding-top:10; padding-bottom:10; padding-right:10}"); (the padding just has a grayer background - i don't know why)
Bookmarks